Skip to content

File syn_uds.h

FileList > proto > syn_uds.h

Go to the source code of this file

ISO 14229 Unified Diagnostic Services (UDS) Server Implementation. More...

  • #include <stdbool.h>
  • #include <stddef.h>
  • #include <stdint.h>

Classes

Type Name
struct SYN_UDS_DIDEntry
Data Identifier (DID) Registry Entry.
struct SYN_UDS_DTCEntry
Diagnostic Trouble Code (DTC) Registry Entry.
struct SYN_UDS_Server
UDS Server Instance Context.

Public Types

Type Name
typedef bool(* SYN_UDS_AccessTimingHandler
AccessTimingParameter (0x83) callback function signature.
enum SYN_UDS_AccessTimingType
UDS AccessTimingParameter (0x83) Subfunctions.
enum SYN_UDS_AddrMode
UDS Addressing Modes (ISO 14229-1)
typedef bool(* SYN_UDS_AuthHandler
Authentication (0x29) callback function signature.
typedef bool(* SYN_UDS_CommControlHandler
CommunicationControl (0x28) callback function signature.
enum SYN_UDS_CommControlType
UDS CommunicationControl (0x28) Subfunctions.
typedef bool(* SYN_UDS_DTCHandler
ReadDTCInformation (0x19) callback function signature.
typedef bool(* SYN_UDS_DynamicDIDHandler
DynamicallyDefineDataIdentifier (0x2C) callback function signature.
typedef bool(* SYN_UDS_FileTransferHandler
RequestFileTransfer (0x38) callback function signature.
typedef bool(* SYN_UDS_IOControlHandler
InputOutputControlByIdentifier (0x2F) callback function signature.
typedef bool(* SYN_UDS_LinkControlHandler
LinkControl (0x87) callback function signature.
typedef bool(* SYN_UDS_MemoryHandler
ReadMemoryByAddress (0x23) and WriteMemoryByAddress (0x3D) callback function signature.
typedef bool(* SYN_UDS_PeriodicDataHandler
ReadDataByPeriodicIdentifier (0x2A) callback function signature.
typedef void(* SYN_UDS_ResetHandler
ECUReset (0x11) deferred post-TX reset callback function signature.
typedef bool(* SYN_UDS_ResponseOnEventHandler
ResponseOnEvent (0x86) callback function signature.
typedef bool(* SYN_UDS_RoutineControlHandler
RoutineControl (0x31) callback function signature.
typedef bool(* SYN_UDS_ScalingDataHandler
ReadScalingDataByIdentifier (0x24) callback function signature.
typedef bool(* SYN_UDS_SecuredDataHandler
SecuredDataTransmission (0x84) callback function signature.
enum SYN_UDS_SecurityState
UDS Security Access Unlock States.
enum SYN_UDS_Session
UDS Diagnostic Session Types (ISO 14229-1)
typedef bool(* SYN_UDS_SessionTransitionHandler
DiagnosticSessionControl (0x10) session transition rule callback signature.
enum SYN_UDS_TransferState
UDS Data Transfer States.

Public Functions

Type Name
void syn_uds_clear_pending_reset (SYN_UDS_Server * server)
Clear pending ECU reset flag after executing reset or transmitting response.
bool syn_uds_disable_aes128_security (SYN_UDS_Server * server)
Disable AES-128 security mode and revert to standard XOR security key calculation.
bool syn_uds_dtc_get_status (SYN_UDS_Server * server, uint32_t dtc, uint8_t * out_status)
Get current 8-bit status byte for a registered DTC.
bool syn_uds_dtc_report_test_result (SYN_UDS_Server * server, uint32_t dtc, bool failed)
Report diagnostic test result for a registered DTC according to ISO 14229-1 state transitions.
bool syn_uds_dtc_start_operation_cycle (SYN_UDS_Server * server)
Advance server state to a new operation cycle. Clears testFailedThisOperationCycle and sets testNotCompletedThisOperationCycle for all registered DTCs.
bool syn_uds_enable_aes128_security (SYN_UDS_Server * server, const uint8_t key)
Enable AES-128 algorithm for UDS SecurityAccess (0x27) seed/key unlock.
uint8_t syn_uds_get_pending_reset (const SYN_UDS_Server * server)
Get pending ECU reset sub-function requested by 0x11 service.
uint8_t syn_uds_get_security_level (const SYN_UDS_Server * server)
Get currently unlocked security level (0 = locked, 1 = level 1, 2 = level 2...).
bool syn_uds_init (SYN_UDS_Server * server)
Initialize UDS Server context.
bool syn_uds_is_sid_functional_supported (uint8_t sid)
Check if Service Identifier (SID) supports Functional Addressing (1:N Broadcast).
bool syn_uds_process_request (SYN_UDS_Server * server, const uint8_t * req, uint16_t req_len, uint8_t * resp_buf, uint16_t max_resp_len, uint16_t * resp_len, SYN_UDS_AddrMode addr_mode)
Process incoming UDS request diagnostic payload and format response.
bool syn_uds_register_access_timing (SYN_UDS_Server * server, SYN_UDS_AccessTimingHandler handler, void * ctx)
Register AccessTimingParameter (0x83) callback handler.
bool syn_uds_register_auth_handler (SYN_UDS_Server * server, SYN_UDS_AuthHandler handler, void * ctx)
Register Authentication (0x29) handler.
bool syn_uds_register_comm_control (SYN_UDS_Server * server, SYN_UDS_CommControlHandler handler, void * ctx)
Register CommunicationControl (0x28) callback handler.
bool syn_uds_register_did (SYN_UDS_Server * server, uint16_t did, uint8_t * data, uint16_t len, bool writable)
Register Data Identifier (DID) mapping in UDS Server table.
bool syn_uds_register_did_ext (SYN_UDS_Server * server, uint16_t did, uint8_t * data, uint16_t len, bool writable, uint8_t session_mask, uint16_t security_mask)
Register Data Identifier (DID) with custom session & security permission bitmask.
bool syn_uds_register_dtc (SYN_UDS_Server * server, uint32_t dtc, uint8_t status, uint8_t severity)
Register Diagnostic Trouble Code (DTC) in UDS Server table.
bool syn_uds_register_dtc_handler (SYN_UDS_Server * server, SYN_UDS_DTCHandler handler, void * ctx)
Register ReadDTCInformation (0x19) callback handler.
bool syn_uds_register_dynamic_did_handler (SYN_UDS_Server * server, SYN_UDS_DynamicDIDHandler handler, void * ctx)
Register DynamicallyDefineDataIdentifier (0x2C) callback handler.
bool syn_uds_register_file_transfer (SYN_UDS_Server * server, SYN_UDS_FileTransferHandler handler, void * ctx)
Register RequestFileTransfer (0x38) handler.
bool syn_uds_register_io_control (SYN_UDS_Server * server, SYN_UDS_IOControlHandler handler, void * ctx)
Register InputOutputControlByIdentifier (0x2F) callback handler.
bool syn_uds_register_link_control (SYN_UDS_Server * server, SYN_UDS_LinkControlHandler handler, void * ctx)
Register LinkControl (0x87) callback handler.
bool syn_uds_register_memory_handler (SYN_UDS_Server * server, SYN_UDS_MemoryHandler handler, void * ctx)
Register ReadMemoryByAddress (0x23) and WriteMemoryByAddress (0x3D) handler.
bool syn_uds_register_periodic_data_handler (SYN_UDS_Server * server, SYN_UDS_PeriodicDataHandler handler, void * ctx)
Register ReadDataByPeriodicIdentifier (0x2A) callback handler.
bool syn_uds_register_roe_handler (SYN_UDS_Server * server, SYN_UDS_ResponseOnEventHandler handler, void * ctx)
Register ResponseOnEvent (0x86) callback handler.
bool syn_uds_register_routine_control (SYN_UDS_Server * server, SYN_UDS_RoutineControlHandler handler, void * ctx)
Register RoutineControl (0x31) callback handler.
bool syn_uds_register_scaling_data_handler (SYN_UDS_Server * server, SYN_UDS_ScalingDataHandler handler, void * ctx)
Register ReadScalingDataByIdentifier (0x24) callback handler.
bool syn_uds_register_secured_data (SYN_UDS_Server * server, SYN_UDS_SecuredDataHandler handler, void * ctx)
Register SecuredDataTransmission (0x84) callback handler.
void syn_uds_set_reset_handler (SYN_UDS_Server * server, SYN_UDS_ResetHandler cb, void * ctx)
Register deferred post-TX ECU reset handler callback.
void syn_uds_set_reset_wait_ms (SYN_UDS_Server * server, uint16_t wait_ms)
Set post-TX ECU reset delay window duration in milliseconds.
bool syn_uds_set_security_seed_bytes (SYN_UDS_Server * server, const uint8_t seed)
Set custom 16-byte seed for AES-128 SecurityAccess.
bool syn_uds_set_service_security_mask (SYN_UDS_Server * server, uint8_t sid, uint16_t security_mask)
Configure required security level mask for a specific Service Identifier.
bool syn_uds_set_service_session_mask (SYN_UDS_Server * server, uint8_t sid, uint8_t session_mask)
Configure allowed diagnostic session mask for a specific Service Identifier.
void syn_uds_set_session_transition_handler (SYN_UDS_Server * server, SYN_UDS_SessionTransitionHandler cb, void * ctx)
Register optional session transition policy callback.
void syn_uds_tick (SYN_UDS_Server * server, uint32_t dt_ms)
Advance periodic S3 server timer by dt_ms milliseconds. Reverts session to DEFAULT and locks security state if S3 timer expires (5000ms).

Macros

Type Name
define SYN_UDS_DEFAULT_RESET_TX_WAIT_MS 50U
define SYN_UDS_DTC_CLASS_MASK (0x1FU)
define SYN_UDS_DTC_FORMAT_ISO14229_1 0x00U
define SYN_UDS_DTC_FORMAT_ISO15031_6 0x01U
define SYN_UDS_DTC_FORMAT_ISO27145_4 0x03U
define SYN_UDS_DTC_FORMAT_SAE_J1939_73 0x02U
define SYN_UDS_DTC_GROUP_ALL 0xFFFFFFU
define SYN_UDS_DTC_GROUP_BODY 0x800000U
define SYN_UDS_DTC_GROUP_CHASSIS 0x400000U
define SYN_UDS_DTC_GROUP_EMISSIONS 0x000000U
define SYN_UDS_DTC_GROUP_NETWORK 0xC00000U
define SYN_UDS_DTC_GROUP_POWERTRAIN 0x100000U
define SYN_UDS_DTC_REPORT_BY_SEVERITY_MASK 0x08U
define SYN_UDS_DTC_REPORT_BY_STATUS_MASK 0x02U
define SYN_UDS_DTC_REPORT_EMISSIONS_OBD_BY_STATUS_MASK 0x13U
define SYN_UDS_DTC_REPORT_EXT_DATA_RECORD_BY_DTC 0x06U
define SYN_UDS_DTC_REPORT_EXT_DATA_RECORD_BY_RECORD_NUM 0x16U
define SYN_UDS_DTC_REPORT_FAULT_DETECTION_COUNTER 0x14U
define SYN_UDS_DTC_REPORT_FIRST_CONFIRMED 0x0CU
define SYN_UDS_DTC_REPORT_FIRST_TEST_FAILED 0x0BU
define SYN_UDS_DTC_REPORT_MIRROR_MEMORY_BY_STATUS_MASK 0x0FU
define SYN_UDS_DTC_REPORT_MIRROR_MEMORY_EXT_DATA 0x10U
define SYN_UDS_DTC_REPORT_MOST_RECENT_CONFIRMED 0x0EU
define SYN_UDS_DTC_REPORT_MOST_RECENT_TEST_FAILED 0x0DU
define SYN_UDS_DTC_REPORT_NUMBER_BY_SEVERITY_MASK 0x07U
define SYN_UDS_DTC_REPORT_NUMBER_BY_STATUS_MASK 0x01U
define SYN_UDS_DTC_REPORT_NUMBER_EMISSIONS_OBD_BY_STATUS_MASK 0x12U
define SYN_UDS_DTC_REPORT_NUMBER_MIRROR_MEMORY_BY_STATUS_MASK 0x11U
define SYN_UDS_DTC_REPORT_SEVERITY_INFO 0x09U
define SYN_UDS_DTC_REPORT_SNAPSHOT_IDENTIFICATION 0x03U
define SYN_UDS_DTC_REPORT_SNAPSHOT_RECORD_BY_DTC 0x04U
define SYN_UDS_DTC_REPORT_STORED_DATA_BY_RECORD_NUM 0x05U
define SYN_UDS_DTC_REPORT_SUPPORTED 0x0AU
define SYN_UDS_DTC_REPORT_USER_DEF_MEMORY_BY_STATUS_MASK 0x17U
define SYN_UDS_DTC_REPORT_USER_DEF_MEMORY_EXT_DATA_BY_DTC 0x19U
define SYN_UDS_DTC_REPORT_USER_DEF_MEMORY_SNAPSHOT_BY_DTC 0x18U
define SYN_UDS_DTC_REPORT_WITH_PERMANENT_STATUS 0x15U
define SYN_UDS_DTC_REPORT_WWH_OBD_BY_MASK_RECORD 0x42U
define SYN_UDS_DTC_REPORT_WWH_OBD_WITH_PERMANENT_STATUS 0x55U
define SYN_UDS_DTC_SEVERITY_CHECK_AT_NEXT_HALT (0x02U &lt;&lt; 5)
define SYN_UDS_DTC_SEVERITY_CHECK_IMMEDIATELY (0x03U &lt;&lt; 5)
define SYN_UDS_DTC_SEVERITY_MAINTENANCE_REQUIRED (0x01U &lt;&lt; 5)
define SYN_UDS_DTC_SEVERITY_MASK (0x07U &lt;&lt; 5)
define SYN_UDS_DTC_SEVERITY_NO_SEVERITY (0x00U &lt;&lt; 5)
define SYN_UDS_DTC_STATUS_AVAILABILITY_MASK 0xFFU
define SYN_UDS_DTC_STATUS_CONFIRMED_DTC (1U &lt;&lt; 3)
define SYN_UDS_DTC_STATUS_PENDING_DTC (1U &lt;&lt; 2)
define SYN_UDS_DTC_STATUS_TEST_FAILED (1U &lt;&lt; 0)
define SYN_UDS_DTC_STATUS_TEST_FAILED_SINCE_LAST_CLEAR (1U &lt;&lt; 5)
define SYN_UDS_DTC_STATUS_TEST_FAILED_THIS_OP_CYCLE (1U &lt;&lt; 1)
define SYN_UDS_DTC_STATUS_TEST_NOT_COMPLETED_SINCE_LAST_CLEAR (1U &lt;&lt; 4)
define SYN_UDS_DTC_STATUS_TEST_NOT_COMPLETED_THIS_OP_CYCLE (1U &lt;&lt; 6)
define SYN_UDS_DTC_STATUS_WARNING_INDICATOR_REQUESTED (1U &lt;&lt; 7)
define SYN_UDS_MAX_DIDS 16U
define SYN_UDS_MAX_DTCS 32U
define SYN_UDS_MAX_SERVICE_OVERRIDES 8U
define SYN_UDS_NRC_CONDITIONS_NOT_CORRECT 0x22U
define SYN_UDS_NRC_EXCEEDED_NUMBER_OF_ATTEMPTS 0x36U
define SYN_UDS_NRC_GENERAL_PROGRAMMING_FAILURE 0x72U
define SYN_UDS_NRC_INCORRECT_MESSAGE_LENGTH 0x13U
define SYN_UDS_NRC_INVALID_KEY 0x35U
define SYN_UDS_NRC_REQUEST_OUT_OF_RANGE 0x31U
define SYN_UDS_NRC_REQUEST_SEQUENCE_ERROR 0x24U
define SYN_UDS_NRC_REQUIRED_TIME_DELAY_NOT_EXPIRED 0x37U
define SYN_UDS_NRC_RESPONSE_TOO_LONG 0x14U
define SYN_UDS_NRC_SECURITY_ACCESS_DENIED 0x33U
define SYN_UDS_NRC_SERVICE_NOT_SUPPORTED 0x11U
define SYN_UDS_NRC_SUBFUNCTION_NOT_SUPPORTED 0x12U
define SYN_UDS_NRC_SUBFUNCTION_NOT_SUPPORTED_IN_ACTIVE_SESSION 0x7EU
define SYN_UDS_NRC_SUCCESS 0x00U
define SYN_UDS_NRC_TRANSFER_DATA_SUSPENDED 0x71U
define SYN_UDS_NRC_WRONG_BLOCK_SEQUENCE_COUNTER 0x73U
define SYN_UDS_RESET_DISABLE_RAPID_POWER_SHUTDOWN 0x05U
define SYN_UDS_RESET_ENABLE_RAPID_POWER_SHUTDOWN 0x04U
define SYN_UDS_RESET_HARD 0x01U
define SYN_UDS_RESET_KEY_OFF_ON 0x02U
define SYN_UDS_RESET_SOFT 0x03U
define SYN_UDS_RESPONSE_NEGATIVE 0x7FU
define SYN_UDS_S3_TIMEOUT_MS 5000U
define SYN_UDS_SECURITY_DELAY_MS 10000U
define SYN_UDS_SECURITY_MASK_ALL (0xFFFFU)
define SYN_UDS_SECURITY_MASK_LEVEL_1 (1U &lt;&lt; 1)
define SYN_UDS_SECURITY_MASK_LEVEL_2 (1U &lt;&lt; 2)
define SYN_UDS_SECURITY_MASK_LEVEL_3 (1U &lt;&lt; 3)
define SYN_UDS_SECURITY_MASK_NONE (1U &lt;&lt; 0)
define SYN_UDS_SECURITY_MAX_ATTEMPTS 3U
define SYN_UDS_SESSION_MASK_ALL (0x0FU)
define SYN_UDS_SESSION_MASK_DEFAULT (1U &lt;&lt; 0)
define SYN_UDS_SESSION_MASK_EXTENDED (1U &lt;&lt; 2)
define SYN_UDS_SESSION_MASK_PROGRAMMING (1U &lt;&lt; 1)
define SYN_UDS_SESSION_MASK_SAFETY (1U &lt;&lt; 3)
define SYN_UDS_SID_ACCESS_TIMING_PARAMETER 0x83U
define SYN_UDS_SID_AUTHENTICATION 0x29U
define SYN_UDS_SID_CLEAR_DIAGNOSTIC_INFORMATION 0x14U
define SYN_UDS_SID_COMMUNICATION_CONTROL 0x28U
define SYN_UDS_SID_CONTROL_DTC_SETTING 0x85U
define SYN_UDS_SID_DIAGNOSTIC_SESSION_CONTROL 0x10U
define SYN_UDS_SID_DYNAMICALLY_DEFINE_DATA_IDENTIFIER 0x2CU
define SYN_UDS_SID_ECU_RESET 0x11U
define SYN_UDS_SID_INPUT_OUTPUT_CONTROL_BY_IDENTIFIER 0x2FU
define SYN_UDS_SID_LINK_CONTROL 0x87U
define SYN_UDS_SID_READ_DATA_BY_IDENTIFIER 0x22U
define SYN_UDS_SID_READ_DATA_BY_PERIODIC_IDENTIFIER 0x2AU
define SYN_UDS_SID_READ_DTC_INFORMATION 0x19U
define SYN_UDS_SID_READ_MEMORY_BY_ADDRESS 0x23U
define SYN_UDS_SID_READ_SCALING_DATA_BY_IDENTIFIER 0x24U
define SYN_UDS_SID_REQUEST_DOWNLOAD 0x34U
define SYN_UDS_SID_REQUEST_FILE_TRANSFER 0x38U
define SYN_UDS_SID_REQUEST_TRANSFER_EXIT 0x37U
define SYN_UDS_SID_REQUEST_UPLOAD 0x35U
define SYN_UDS_SID_RESPONSE_ON_EVENT 0x86U
define SYN_UDS_SID_ROUTINE_CONTROL 0x31U
define SYN_UDS_SID_SECURED_DATA_TRANSMISSION 0x84U
define SYN_UDS_SID_SECURITY_ACCESS 0x27U
define SYN_UDS_SID_TESTER_PRESENT 0x3EU
define SYN_UDS_SID_TRANSFER_DATA 0x36U
define SYN_UDS_SID_WRITE_DATA_BY_IDENTIFIER 0x2EU
define SYN_UDS_SID_WRITE_MEMORY_BY_ADDRESS 0x3DU

Detailed Description

Provides a zero-allocation, lightweight UDS server protocol stack for automotive diagnostic session management, Data Identifier (DID) read/write, security access seed/key unlocks, routine controls, and ECU reset over ISO-TP.

Public Types Documentation

typedef SYN_UDS_AccessTimingHandler

AccessTimingParameter (0x83) callback function signature.

typedef bool(* SYN_UDS_AccessTimingHandler) (SYN_UDS_AccessTimingType timing_type, uint16_t *p2_max_ms, uint16_t *p2_star_max_10ms, void *ctx);


enum SYN_UDS_AccessTimingType

UDS AccessTimingParameter (0x83) Subfunctions.

enum SYN_UDS_AccessTimingType {
    SYN_UDS_TIMING_READ_EXTENDED = 0x01U,
    SYN_UDS_TIMING_SET_TO_DEFAULT = 0x02U,
    SYN_UDS_TIMING_READ_ACTIVE = 0x03U,
    SYN_UDS_TIMING_SET_TO_GIVEN = 0x04U
};


enum SYN_UDS_AddrMode

UDS Addressing Modes (ISO 14229-1)

enum SYN_UDS_AddrMode {
    SYN_UDS_ADDR_PHYSICAL = 0U,
    SYN_UDS_ADDR_FUNCTIONAL = 1U
};


typedef SYN_UDS_AuthHandler

Authentication (0x29) callback function signature.

typedef bool(* SYN_UDS_AuthHandler) (uint8_t subfunction, const uint8_t *in_data, uint16_t in_len, uint8_t *out_buf, uint16_t max_out_len, uint16_t *out_len, void *ctx);


typedef SYN_UDS_CommControlHandler

CommunicationControl (0x28) callback function signature.

typedef bool(* SYN_UDS_CommControlHandler) (SYN_UDS_CommControlType control_type, uint8_t comm_type, void *ctx);


enum SYN_UDS_CommControlType

UDS CommunicationControl (0x28) Subfunctions.

enum SYN_UDS_CommControlType {
    SYN_UDS_COMM_ENABLE_RX_AND_TX = 0x00U,
    SYN_UDS_COMM_ENABLE_RX_DISABLE_TX = 0x01U,
    SYN_UDS_COMM_DISABLE_RX_ENABLE_TX = 0x02U,
    SYN_UDS_COMM_DISABLE_RX_AND_TX = 0x03U,
    SYN_UDS_COMM_ENABLE_RX_TX_ENHANCED = 0x04U,
    SYN_UDS_COMM_ENABLE_RX_ENHANCED = 0x05U
};


typedef SYN_UDS_DTCHandler

ReadDTCInformation (0x19) callback function signature.

typedef bool(* SYN_UDS_DTCHandler) (uint8_t subfunction, const uint8_t *in_data, uint16_t in_len, uint8_t *out_buf, uint16_t max_out_len, uint16_t *out_len, void *ctx);


typedef SYN_UDS_DynamicDIDHandler

DynamicallyDefineDataIdentifier (0x2C) callback function signature.

typedef bool(* SYN_UDS_DynamicDIDHandler) (uint8_t subfunction, uint16_t dyn_did, const uint8_t *in_data, uint16_t in_len, uint8_t *out_buf, uint16_t max_out_len, uint16_t *out_len, void *ctx);


typedef SYN_UDS_FileTransferHandler

RequestFileTransfer (0x38) callback function signature.

typedef bool(* SYN_UDS_FileTransferHandler) (uint8_t mode, const char *file_path, uint16_t path_len, uint8_t *out_buf, uint16_t max_out_len, uint16_t *out_len, void *ctx);


typedef SYN_UDS_IOControlHandler

InputOutputControlByIdentifier (0x2F) callback function signature.

typedef bool(* SYN_UDS_IOControlHandler) (uint16_t did, uint8_t control_opt, const uint8_t *in_data, uint16_t in_len, uint8_t *out_buf, uint16_t max_out_len, uint16_t *out_len, void *ctx);


typedef SYN_UDS_LinkControlHandler

LinkControl (0x87) callback function signature.

typedef bool(* SYN_UDS_LinkControlHandler) (uint8_t subfunction, const uint8_t *in_data, uint16_t in_len, uint8_t *out_buf, uint16_t max_out_len, uint16_t *out_len, void *ctx);


typedef SYN_UDS_MemoryHandler

ReadMemoryByAddress (0x23) and WriteMemoryByAddress (0x3D) callback function signature.

typedef bool(* SYN_UDS_MemoryHandler) (bool is_write, uint32_t address, uint32_t size, uint8_t *data_buf, void *ctx);


typedef SYN_UDS_PeriodicDataHandler

ReadDataByPeriodicIdentifier (0x2A) callback function signature.

typedef bool(* SYN_UDS_PeriodicDataHandler) (uint8_t mode, const uint8_t *in_data, uint16_t in_len, uint8_t *out_buf, uint16_t max_out_len, uint16_t *out_len, void *ctx);


typedef SYN_UDS_ResetHandler

ECUReset (0x11) deferred post-TX reset callback function signature.

typedef void(* SYN_UDS_ResetHandler) (uint8_t reset_type, void *ctx);


typedef SYN_UDS_ResponseOnEventHandler

ResponseOnEvent (0x86) callback function signature.

typedef bool(* SYN_UDS_ResponseOnEventHandler) (uint8_t subfunction, const uint8_t *in_data, uint16_t in_len, uint8_t *out_buf, uint16_t max_out_len, uint16_t *out_len, void *ctx);


typedef SYN_UDS_RoutineControlHandler

RoutineControl (0x31) callback function signature.

typedef bool(* SYN_UDS_RoutineControlHandler) (uint8_t subfunction, uint16_t routine_id, const uint8_t *in_data, uint16_t in_len, uint8_t *out_buf, uint16_t max_out_len, uint16_t *out_len, void *ctx);


typedef SYN_UDS_ScalingDataHandler

ReadScalingDataByIdentifier (0x24) callback function signature.

typedef bool(* SYN_UDS_ScalingDataHandler) (uint16_t did, uint8_t *out_buf, uint16_t max_out_len, uint16_t *out_len, void *ctx);


typedef SYN_UDS_SecuredDataHandler

SecuredDataTransmission (0x84) callback function signature.

typedef bool(* SYN_UDS_SecuredDataHandler) (const uint8_t *in_data, uint16_t in_len, uint8_t *out_buf, uint16_t max_out_len, uint16_t *out_len, void *ctx);


enum SYN_UDS_SecurityState

UDS Security Access Unlock States.

enum SYN_UDS_SecurityState {
    SYN_UDS_SECURITY_LOCKED = 0x00U,
    SYN_UDS_SECURITY_SEED_SENT = 0x01U,
    SYN_UDS_SECURITY_UNLOCKED = 0x02U
};


enum SYN_UDS_Session

UDS Diagnostic Session Types (ISO 14229-1)

enum SYN_UDS_Session {
    SYN_UDS_SESSION_DEFAULT = 0x01U,
    SYN_UDS_SESSION_PROGRAMMING = 0x02U,
    SYN_UDS_SESSION_EXTENDED = 0x03U,
    SYN_UDS_SESSION_SAFETY_SYSTEM = 0x04U
};


typedef SYN_UDS_SessionTransitionHandler

DiagnosticSessionControl (0x10) session transition rule callback signature.

typedef bool(* SYN_UDS_SessionTransitionHandler) (SYN_UDS_Session from_session, SYN_UDS_Session to_session, void *ctx);


enum SYN_UDS_TransferState

UDS Data Transfer States.

enum SYN_UDS_TransferState {
    SYN_UDS_TRANSFER_IDLE = 0U,
    SYN_UDS_TRANSFER_DOWNLOAD = 1U,
    SYN_UDS_TRANSFER_UPLOAD = 2U
};


Public Functions Documentation

function syn_uds_clear_pending_reset

Clear pending ECU reset flag after executing reset or transmitting response.

void syn_uds_clear_pending_reset (
    SYN_UDS_Server * server
) 

Parameters:

  • server Pointer to UDS server instance.

function syn_uds_disable_aes128_security

Disable AES-128 security mode and revert to standard XOR security key calculation.

bool syn_uds_disable_aes128_security (
    SYN_UDS_Server * server
) 

Parameters:

  • server Pointer to UDS server instance.

Returns:

true on success, false if server is NULL.


function syn_uds_dtc_get_status

Get current 8-bit status byte for a registered DTC.

bool syn_uds_dtc_get_status (
    SYN_UDS_Server * server,
    uint32_t dtc,
    uint8_t * out_status
) 

Parameters:

  • server Pointer to UDS server instance.
  • dtc 24-bit Diagnostic Trouble Code.
  • out_status Output pointer to store DTC status byte.

Returns:

true if DTC found, false otherwise.


function syn_uds_dtc_report_test_result

Report diagnostic test result for a registered DTC according to ISO 14229-1 state transitions.

bool syn_uds_dtc_report_test_result (
    SYN_UDS_Server * server,
    uint32_t dtc,
    bool failed
) 

Updates DTC status bits (testFailed, testFailedThisOperationCycle, pendingDTC, confirmedDTC, etc.) and fault detection counter.

Parameters:

  • server Pointer to UDS server instance.
  • dtc 24-bit Diagnostic Trouble Code.
  • failed True if test failed, false if test passed.

Returns:

true if DTC found and updated, false otherwise.


function syn_uds_dtc_start_operation_cycle

Advance server state to a new operation cycle. Clears testFailedThisOperationCycle and sets testNotCompletedThisOperationCycle for all registered DTCs.

bool syn_uds_dtc_start_operation_cycle (
    SYN_UDS_Server * server
) 

Parameters:

  • server Pointer to UDS server instance.

Returns:

true on success, false if server is NULL.


function syn_uds_enable_aes128_security

Enable AES-128 algorithm for UDS SecurityAccess (0x27) seed/key unlock.

bool syn_uds_enable_aes128_security (
    SYN_UDS_Server * server,
    const uint8_t key
) 

Parameters:

  • server Pointer to UDS server instance.
  • key 16-byte AES-128 secret key.

Returns:

true on success, false if server or key is NULL.


function syn_uds_get_pending_reset

Get pending ECU reset sub-function requested by 0x11 service.

uint8_t syn_uds_get_pending_reset (
    const SYN_UDS_Server * server
) 

Parameters:

  • server Pointer to UDS server instance.

Returns:

Pending reset type (e.g. 0x01 = hard, 0x02 = keyOffOn, 0x03 = soft), or 0 if none.


function syn_uds_get_security_level

Get currently unlocked security level (0 = locked, 1 = level 1, 2 = level 2...).

uint8_t syn_uds_get_security_level (
    const SYN_UDS_Server * server
) 

Parameters:

  • server Pointer to UDS server instance.

Returns:

Active security level uint8_t.


function syn_uds_init

Initialize UDS Server context.

bool syn_uds_init (
    SYN_UDS_Server * server
) 

Parameters:

  • server Pointer to UDS server instance.

Returns:

true on success, false if server is NULL.


function syn_uds_is_sid_functional_supported

Check if Service Identifier (SID) supports Functional Addressing (1:N Broadcast).

bool syn_uds_is_sid_functional_supported (
    uint8_t sid
) 

Parameters:

  • sid Service Identifier (SID).

Returns:

true if service supports functional addressing, false if physical addressing only.


function syn_uds_process_request

Process incoming UDS request diagnostic payload and format response.

bool syn_uds_process_request (
    SYN_UDS_Server * server,
    const uint8_t * req,
    uint16_t req_len,
    uint8_t * resp_buf,
    uint16_t max_resp_len,
    uint16_t * resp_len,
    SYN_UDS_AddrMode addr_mode
) 

Parameters:

  • server Pointer to UDS server instance.
  • req Pointer to input request bytes.
  • req_len Length of request payload in bytes.
  • resp_buf Output buffer for response bytes.
  • max_resp_len Capacity of output response buffer.
  • resp_len Pointer to store generated response byte length.
  • addr_mode Addressing mode (SYN_UDS_ADDR_PHYSICAL or SYN_UDS_ADDR_FUNCTIONAL).

Returns:

true if response frame generated, false on invalid parameters.


function syn_uds_register_access_timing

Register AccessTimingParameter (0x83) callback handler.

bool syn_uds_register_access_timing (
    SYN_UDS_Server * server,
    SYN_UDS_AccessTimingHandler handler,
    void * ctx
) 

Parameters:

  • server Pointer to UDS server instance.
  • handler Callback function invoked when Service 0x83 is processed.
  • ctx User context passed to handler.

Returns:

true on success, false if server is NULL.


function syn_uds_register_auth_handler

Register Authentication (0x29) handler.

bool syn_uds_register_auth_handler (
    SYN_UDS_Server * server,
    SYN_UDS_AuthHandler handler,
    void * ctx
) 

Parameters:

  • server Pointer to UDS server instance.
  • handler Callback function invoked when Service 0x29 is processed.
  • ctx User context passed to handler.

Returns:

true on success, false if server is NULL.


function syn_uds_register_comm_control

Register CommunicationControl (0x28) callback handler.

bool syn_uds_register_comm_control (
    SYN_UDS_Server * server,
    SYN_UDS_CommControlHandler handler,
    void * ctx
) 

Parameters:

  • server Pointer to UDS server instance.
  • handler Callback function invoked when Service 0x28 is processed.
  • ctx User context passed to handler.

Returns:

true on success, false if server is NULL.


function syn_uds_register_did

Register Data Identifier (DID) mapping in UDS Server table.

bool syn_uds_register_did (
    SYN_UDS_Server * server,
    uint16_t did,
    uint8_t * data,
    uint16_t len,
    bool writable
) 

Parameters:

  • server Pointer to UDS server instance.
  • did 16-bit Data Identifier code (e.g., 0xF190 for VIN).
  • data Pointer to data memory buffer.
  • len Data byte length.
  • writable True if DID allows WriteDataByIdentifier (0x2E).

Returns:

true on success, false if table full or invalid params.


function syn_uds_register_did_ext

Register Data Identifier (DID) with custom session & security permission bitmask.

bool syn_uds_register_did_ext (
    SYN_UDS_Server * server,
    uint16_t did,
    uint8_t * data,
    uint16_t len,
    bool writable,
    uint8_t session_mask,
    uint16_t security_mask
) 

Parameters:

  • server Pointer to UDS server instance.
  • did 16-bit Data Identifier code (e.g., 0xF190 for VIN).
  • data Pointer to data memory buffer.
  • len Data byte length.
  • writable True if DID allows WriteDataByIdentifier (0x2E).
  • session_mask Permitted session bitmask (SYN_UDS_SESSION_MASK_*).
  • security_mask Permitted security level bitmask (SYN_UDS_SECURITY_MASK_*).

Returns:

true on success, false if table full or invalid params.


function syn_uds_register_dtc

Register Diagnostic Trouble Code (DTC) in UDS Server table.

bool syn_uds_register_dtc (
    SYN_UDS_Server * server,
    uint32_t dtc,
    uint8_t status,
    uint8_t severity
) 

Parameters:

  • server Pointer to UDS server instance.
  • dtc 24-bit Diagnostic Trouble Code (e.g., 0x012345).
  • status Initial DTCStatusByte bitmask.
  • severity DTCSeverityByte (severity & class).

Returns:

true on success, false if table full or invalid params.


function syn_uds_register_dtc_handler

Register ReadDTCInformation (0x19) callback handler.

bool syn_uds_register_dtc_handler (
    SYN_UDS_Server * server,
    SYN_UDS_DTCHandler handler,
    void * ctx
) 

Parameters:

  • server Pointer to UDS server instance.
  • handler Callback function invoked for custom DTC subfunctions.
  • ctx User context passed to handler.

Returns:

true on success, false if server is NULL.


function syn_uds_register_dynamic_did_handler

Register DynamicallyDefineDataIdentifier (0x2C) callback handler.

bool syn_uds_register_dynamic_did_handler (
    SYN_UDS_Server * server,
    SYN_UDS_DynamicDIDHandler handler,
    void * ctx
) 

Parameters:

  • server Pointer to UDS server instance.
  • handler Callback function invoked when Service 0x2C is processed.
  • ctx User context passed to handler.

Returns:

true on success, false if server is NULL.


function syn_uds_register_file_transfer

Register RequestFileTransfer (0x38) handler.

bool syn_uds_register_file_transfer (
    SYN_UDS_Server * server,
    SYN_UDS_FileTransferHandler handler,
    void * ctx
) 

Parameters:

  • server Pointer to UDS server instance.
  • handler Callback function invoked when Service 0x38 is processed.
  • ctx User context passed to handler.

Returns:

true on success, false if server is NULL.


function syn_uds_register_io_control

Register InputOutputControlByIdentifier (0x2F) callback handler.

bool syn_uds_register_io_control (
    SYN_UDS_Server * server,
    SYN_UDS_IOControlHandler handler,
    void * ctx
) 

Parameters:

  • server Pointer to UDS server instance.
  • handler Callback function invoked when Service 0x2F is processed.
  • ctx User context passed to handler.

Returns:

true on success, false if server is NULL.


Register LinkControl (0x87) callback handler.

bool syn_uds_register_link_control (
    SYN_UDS_Server * server,
    SYN_UDS_LinkControlHandler handler,
    void * ctx
) 

Parameters:

  • server Pointer to UDS server instance.
  • handler Callback function invoked when Service 0x87 is processed.
  • ctx User context passed to handler.

Returns:

true on success, false if server is NULL.


function syn_uds_register_memory_handler

Register ReadMemoryByAddress (0x23) and WriteMemoryByAddress (0x3D) handler.

bool syn_uds_register_memory_handler (
    SYN_UDS_Server * server,
    SYN_UDS_MemoryHandler handler,
    void * ctx
) 

Parameters:

  • server Pointer to UDS server instance.
  • handler Callback function invoked when memory services are processed.
  • ctx User context passed to handler.

Returns:

true on success, false if server is NULL.


function syn_uds_register_periodic_data_handler

Register ReadDataByPeriodicIdentifier (0x2A) callback handler.

bool syn_uds_register_periodic_data_handler (
    SYN_UDS_Server * server,
    SYN_UDS_PeriodicDataHandler handler,
    void * ctx
) 

Parameters:

  • server Pointer to UDS server instance.
  • handler Callback function invoked when Service 0x2A is processed.
  • ctx User context passed to handler.

Returns:

true on success, false if server is NULL.


function syn_uds_register_roe_handler

Register ResponseOnEvent (0x86) callback handler.

bool syn_uds_register_roe_handler (
    SYN_UDS_Server * server,
    SYN_UDS_ResponseOnEventHandler handler,
    void * ctx
) 

Parameters:

  • server Pointer to UDS server instance.
  • handler Callback function invoked when Service 0x86 is processed.
  • ctx User context passed to handler.

Returns:

true on success, false if server is NULL.


function syn_uds_register_routine_control

Register RoutineControl (0x31) callback handler.

bool syn_uds_register_routine_control (
    SYN_UDS_Server * server,
    SYN_UDS_RoutineControlHandler handler,
    void * ctx
) 

Parameters:

  • server Pointer to UDS server instance.
  • handler Callback function invoked when Service 0x31 is processed.
  • ctx User context passed to handler.

Returns:

true on success, false if server is NULL.


function syn_uds_register_scaling_data_handler

Register ReadScalingDataByIdentifier (0x24) callback handler.

bool syn_uds_register_scaling_data_handler (
    SYN_UDS_Server * server,
    SYN_UDS_ScalingDataHandler handler,
    void * ctx
) 

Parameters:

  • server Pointer to UDS server instance.
  • handler Callback function invoked when Service 0x24 is processed.
  • ctx User context passed to handler.

Returns:

true on success, false if server is NULL.


function syn_uds_register_secured_data

Register SecuredDataTransmission (0x84) callback handler.

bool syn_uds_register_secured_data (
    SYN_UDS_Server * server,
    SYN_UDS_SecuredDataHandler handler,
    void * ctx
) 

Parameters:

  • server Pointer to UDS server instance.
  • handler Callback function invoked when Service 0x84 is processed.
  • ctx User context passed to handler.

Returns:

true on success, false if server is NULL.


function syn_uds_set_reset_handler

Register deferred post-TX ECU reset handler callback.

void syn_uds_set_reset_handler (
    SYN_UDS_Server * server,
    SYN_UDS_ResetHandler cb,
    void * ctx
) 

Parameters:

  • server Pointer to UDS server instance.
  • cb Callback function to execute after post-TX reset delay.
  • ctx Context pointer passed to callback function.

function syn_uds_set_reset_wait_ms

Set post-TX ECU reset delay window duration in milliseconds.

void syn_uds_set_reset_wait_ms (
    SYN_UDS_Server * server,
    uint16_t wait_ms
) 

Parameters:

  • server Pointer to UDS server instance.
  • wait_ms Delay duration in ms before executing reset callback.

function syn_uds_set_security_seed_bytes

Set custom 16-byte seed for AES-128 SecurityAccess.

bool syn_uds_set_security_seed_bytes (
    SYN_UDS_Server * server,
    const uint8_t seed
) 

Parameters:

  • server Pointer to UDS server instance.
  • seed 16-byte seed buffer.

Returns:

true on success, false if server or seed is NULL.


function syn_uds_set_service_security_mask

Configure required security level mask for a specific Service Identifier.

bool syn_uds_set_service_security_mask (
    SYN_UDS_Server * server,
    uint8_t sid,
    uint16_t security_mask
) 

Parameters:

  • server Pointer to UDS server instance.
  • sid Service Identifier (e.g. 0x27, 0x34).
  • security_mask Required security level bitmask (SYN_UDS_SECURITY_MASK_*).

Returns:

true on success, false if server is NULL.


function syn_uds_set_service_session_mask

Configure allowed diagnostic session mask for a specific Service Identifier.

bool syn_uds_set_service_session_mask (
    SYN_UDS_Server * server,
    uint8_t sid,
    uint8_t session_mask
) 

Parameters:

  • server Pointer to UDS server instance.
  • sid Service Identifier (e.g. 0x27, 0x34).
  • session_mask Allowed session bitmask (SYN_UDS_SESSION_MASK_*).

Returns:

true on success, false if server is NULL.


function syn_uds_set_session_transition_handler

Register optional session transition policy callback.

void syn_uds_set_session_transition_handler (
    SYN_UDS_Server * server,
    SYN_UDS_SessionTransitionHandler cb,
    void * ctx
) 

Parameters:

  • server Pointer to UDS server instance.
  • cb Callback function to validate session transition graph permissions.
  • ctx Context pointer passed to callback function.

function syn_uds_tick

Advance periodic S3 server timer by dt_ms milliseconds. Reverts session to DEFAULT and locks security state if S3 timer expires (5000ms).

void syn_uds_tick (
    SYN_UDS_Server * server,
    uint32_t dt_ms
) 

Parameters:

  • server Pointer to UDS server instance.
  • dt_ms Milliseconds elapsed since last tick.

Macro Definition Documentation

define SYN_UDS_DEFAULT_RESET_TX_WAIT_MS

#define SYN_UDS_DEFAULT_RESET_TX_WAIT_MS `50U`

Default post-TX ECU reset wait time in ms


define SYN_UDS_DTC_CLASS_MASK

#define SYN_UDS_DTC_CLASS_MASK `(0x1FU)`

DTC class mask


define SYN_UDS_DTC_FORMAT_ISO14229_1

#define SYN_UDS_DTC_FORMAT_ISO14229_1 `0x00U`

ISO 14229-1 DTC format


define SYN_UDS_DTC_FORMAT_ISO15031_6

#define SYN_UDS_DTC_FORMAT_ISO15031_6 `0x01U`

ISO 15031-6 DTC format


define SYN_UDS_DTC_FORMAT_ISO27145_4

#define SYN_UDS_DTC_FORMAT_ISO27145_4 `0x03U`

ISO 27145-4 DTC format


define SYN_UDS_DTC_FORMAT_SAE_J1939_73

#define SYN_UDS_DTC_FORMAT_SAE_J1939_73 `0x02U`

SAE J1939-73 DTC format


define SYN_UDS_DTC_GROUP_ALL

#define SYN_UDS_DTC_GROUP_ALL `0xFFFFFFU`

All DTC groups


define SYN_UDS_DTC_GROUP_BODY

#define SYN_UDS_DTC_GROUP_BODY `0x800000U`

Body DTC group


define SYN_UDS_DTC_GROUP_CHASSIS

#define SYN_UDS_DTC_GROUP_CHASSIS `0x400000U`

Chassis DTC group


define SYN_UDS_DTC_GROUP_EMISSIONS

#define SYN_UDS_DTC_GROUP_EMISSIONS `0x000000U`

Emissions-related systems DTC group


define SYN_UDS_DTC_GROUP_NETWORK

#define SYN_UDS_DTC_GROUP_NETWORK `0xC00000U`

Network DTC group


define SYN_UDS_DTC_GROUP_POWERTRAIN

#define SYN_UDS_DTC_GROUP_POWERTRAIN `0x100000U`

Powertrain DTC group


define SYN_UDS_DTC_REPORT_BY_SEVERITY_MASK

#define SYN_UDS_DTC_REPORT_BY_SEVERITY_MASK `0x08U`

Report DTCs by severity mask


define SYN_UDS_DTC_REPORT_BY_STATUS_MASK

#define SYN_UDS_DTC_REPORT_BY_STATUS_MASK `0x02U`

Report DTCs by status mask


define SYN_UDS_DTC_REPORT_EMISSIONS_OBD_BY_STATUS_MASK

#define SYN_UDS_DTC_REPORT_EMISSIONS_OBD_BY_STATUS_MASK `0x13U`

Report OBD DTCs


define SYN_UDS_DTC_REPORT_EXT_DATA_RECORD_BY_DTC

#define SYN_UDS_DTC_REPORT_EXT_DATA_RECORD_BY_DTC `0x06U`

Report extended data record by DTC


define SYN_UDS_DTC_REPORT_EXT_DATA_RECORD_BY_RECORD_NUM

#define SYN_UDS_DTC_REPORT_EXT_DATA_RECORD_BY_RECORD_NUM `0x16U`

Report extended data by record num


define SYN_UDS_DTC_REPORT_FAULT_DETECTION_COUNTER

#define SYN_UDS_DTC_REPORT_FAULT_DETECTION_COUNTER `0x14U`

Report fault detection counter


define SYN_UDS_DTC_REPORT_FIRST_CONFIRMED

#define SYN_UDS_DTC_REPORT_FIRST_CONFIRMED `0x0CU`

Report first confirmed DTC


define SYN_UDS_DTC_REPORT_FIRST_TEST_FAILED

#define SYN_UDS_DTC_REPORT_FIRST_TEST_FAILED `0x0BU`

Report first test failed DTC


define SYN_UDS_DTC_REPORT_MIRROR_MEMORY_BY_STATUS_MASK

#define SYN_UDS_DTC_REPORT_MIRROR_MEMORY_BY_STATUS_MASK `0x0FU`

Report mirror memory by status mask


define SYN_UDS_DTC_REPORT_MIRROR_MEMORY_EXT_DATA

#define SYN_UDS_DTC_REPORT_MIRROR_MEMORY_EXT_DATA `0x10U`

Report mirror memory extended data


define SYN_UDS_DTC_REPORT_MOST_RECENT_CONFIRMED

#define SYN_UDS_DTC_REPORT_MOST_RECENT_CONFIRMED `0x0EU`

Report most recent confirmed DTC


define SYN_UDS_DTC_REPORT_MOST_RECENT_TEST_FAILED

#define SYN_UDS_DTC_REPORT_MOST_RECENT_TEST_FAILED `0x0DU`

Report most recent test failed DTC \


define SYN_UDS_DTC_REPORT_NUMBER_BY_SEVERITY_MASK

#define SYN_UDS_DTC_REPORT_NUMBER_BY_SEVERITY_MASK `0x07U`

Report number of DTCs by severity mask


define SYN_UDS_DTC_REPORT_NUMBER_BY_STATUS_MASK

#define SYN_UDS_DTC_REPORT_NUMBER_BY_STATUS_MASK `0x01U`

Report number of DTCs by status mask \


define SYN_UDS_DTC_REPORT_NUMBER_EMISSIONS_OBD_BY_STATUS_MASK

#define SYN_UDS_DTC_REPORT_NUMBER_EMISSIONS_OBD_BY_STATUS_MASK `0x12U`

Report number of OBD DTCs


define SYN_UDS_DTC_REPORT_NUMBER_MIRROR_MEMORY_BY_STATUS_MASK

#define SYN_UDS_DTC_REPORT_NUMBER_MIRROR_MEMORY_BY_STATUS_MASK `0x11U`

Report number of mirror memory DTCs


define SYN_UDS_DTC_REPORT_SEVERITY_INFO

#define SYN_UDS_DTC_REPORT_SEVERITY_INFO `0x09U`

Report DTC severity info


define SYN_UDS_DTC_REPORT_SNAPSHOT_IDENTIFICATION

#define SYN_UDS_DTC_REPORT_SNAPSHOT_IDENTIFICATION `0x03U`

Report DTC snapshot identification \


define SYN_UDS_DTC_REPORT_SNAPSHOT_RECORD_BY_DTC

#define SYN_UDS_DTC_REPORT_SNAPSHOT_RECORD_BY_DTC `0x04U`

Report DTC snapshot record by DTC


define SYN_UDS_DTC_REPORT_STORED_DATA_BY_RECORD_NUM

#define SYN_UDS_DTC_REPORT_STORED_DATA_BY_RECORD_NUM `0x05U`

Report stored data by record number


define SYN_UDS_DTC_REPORT_SUPPORTED

#define SYN_UDS_DTC_REPORT_SUPPORTED `0x0AU`

Report supported DTCs


define SYN_UDS_DTC_REPORT_USER_DEF_MEMORY_BY_STATUS_MASK

#define SYN_UDS_DTC_REPORT_USER_DEF_MEMORY_BY_STATUS_MASK `0x17U`

Report user-def memory by status mask


define SYN_UDS_DTC_REPORT_USER_DEF_MEMORY_EXT_DATA_BY_DTC

#define SYN_UDS_DTC_REPORT_USER_DEF_MEMORY_EXT_DATA_BY_DTC `0x19U`

Report user-def ext data by DTC


define SYN_UDS_DTC_REPORT_USER_DEF_MEMORY_SNAPSHOT_BY_DTC

#define SYN_UDS_DTC_REPORT_USER_DEF_MEMORY_SNAPSHOT_BY_DTC `0x18U`

Report user-def snapshot by DTC


define SYN_UDS_DTC_REPORT_WITH_PERMANENT_STATUS

#define SYN_UDS_DTC_REPORT_WITH_PERMANENT_STATUS `0x15U`

Report DTCs with permanent status


define SYN_UDS_DTC_REPORT_WWH_OBD_BY_MASK_RECORD

#define SYN_UDS_DTC_REPORT_WWH_OBD_BY_MASK_RECORD `0x42U`

Report WWH-OBD by mask record


define SYN_UDS_DTC_REPORT_WWH_OBD_WITH_PERMANENT_STATUS

#define SYN_UDS_DTC_REPORT_WWH_OBD_WITH_PERMANENT_STATUS `0x55U`

Report WWH-OBD with permanent status


define SYN_UDS_DTC_SEVERITY_CHECK_AT_NEXT_HALT

#define SYN_UDS_DTC_SEVERITY_CHECK_AT_NEXT_HALT `(0x02U << 5)`

Check at next halt


define SYN_UDS_DTC_SEVERITY_CHECK_IMMEDIATELY

#define SYN_UDS_DTC_SEVERITY_CHECK_IMMEDIATELY `(0x03U << 5)`

Check immediately


define SYN_UDS_DTC_SEVERITY_MAINTENANCE_REQUIRED

#define SYN_UDS_DTC_SEVERITY_MAINTENANCE_REQUIRED `(0x01U << 5)`

Maintenance required


define SYN_UDS_DTC_SEVERITY_MASK

#define SYN_UDS_DTC_SEVERITY_MASK `(0x07U << 5)`

DTC severity mask


define SYN_UDS_DTC_SEVERITY_NO_SEVERITY

#define SYN_UDS_DTC_SEVERITY_NO_SEVERITY `(0x00U << 5)`

No severity


define SYN_UDS_DTC_STATUS_AVAILABILITY_MASK

#define SYN_UDS_DTC_STATUS_AVAILABILITY_MASK `0xFFU`

DTC status availability bitmask


define SYN_UDS_DTC_STATUS_CONFIRMED_DTC

#define SYN_UDS_DTC_STATUS_CONFIRMED_DTC `(1U << 3)`

Confirmed DTC bit


define SYN_UDS_DTC_STATUS_PENDING_DTC

#define SYN_UDS_DTC_STATUS_PENDING_DTC `(1U << 2)`

Pending DTC bit


define SYN_UDS_DTC_STATUS_TEST_FAILED

#define SYN_UDS_DTC_STATUS_TEST_FAILED `(1U << 0)`

Test failed bit


define SYN_UDS_DTC_STATUS_TEST_FAILED_SINCE_LAST_CLEAR

#define SYN_UDS_DTC_STATUS_TEST_FAILED_SINCE_LAST_CLEAR `(1U << 5)`

Test failed since clear


define SYN_UDS_DTC_STATUS_TEST_FAILED_THIS_OP_CYCLE

#define SYN_UDS_DTC_STATUS_TEST_FAILED_THIS_OP_CYCLE `(1U << 1)`

Test failed this operation cycle


define SYN_UDS_DTC_STATUS_TEST_NOT_COMPLETED_SINCE_LAST_CLEAR

#define SYN_UDS_DTC_STATUS_TEST_NOT_COMPLETED_SINCE_LAST_CLEAR `(1U << 4)`

Test not completed since clear


define SYN_UDS_DTC_STATUS_TEST_NOT_COMPLETED_THIS_OP_CYCLE

#define SYN_UDS_DTC_STATUS_TEST_NOT_COMPLETED_THIS_OP_CYCLE `(1U << 6)`

Test not completed this op cycle


define SYN_UDS_DTC_STATUS_WARNING_INDICATOR_REQUESTED

#define SYN_UDS_DTC_STATUS_WARNING_INDICATOR_REQUESTED `(1U << 7)`

Warning indicator requested \


define SYN_UDS_MAX_DIDS

#define SYN_UDS_MAX_DIDS `16U`

Maximum supported DIDs


define SYN_UDS_MAX_DTCS

#define SYN_UDS_MAX_DTCS `32U`

Maximum stored DTC count


define SYN_UDS_MAX_SERVICE_OVERRIDES

#define SYN_UDS_MAX_SERVICE_OVERRIDES `8U`

Maximum supported per-service policy overrides (default: 8)


define SYN_UDS_NRC_CONDITIONS_NOT_CORRECT

#define SYN_UDS_NRC_CONDITIONS_NOT_CORRECT `0x22U`

Conditions not correct (0x22)


define SYN_UDS_NRC_EXCEEDED_NUMBER_OF_ATTEMPTS

#define SYN_UDS_NRC_EXCEEDED_NUMBER_OF_ATTEMPTS `0x36U`

Exceeded number of attempts (0x36)


define SYN_UDS_NRC_GENERAL_PROGRAMMING_FAILURE

#define SYN_UDS_NRC_GENERAL_PROGRAMMING_FAILURE `0x72U`

General programming failure (0x72)


define SYN_UDS_NRC_INCORRECT_MESSAGE_LENGTH

#define SYN_UDS_NRC_INCORRECT_MESSAGE_LENGTH `0x13U`

Incorrect message length or invalid format (0x13)


define SYN_UDS_NRC_INVALID_KEY

#define SYN_UDS_NRC_INVALID_KEY `0x35U`

Invalid key (0x35)


define SYN_UDS_NRC_REQUEST_OUT_OF_RANGE

#define SYN_UDS_NRC_REQUEST_OUT_OF_RANGE `0x31U`

Request out of range (0x31)


define SYN_UDS_NRC_REQUEST_SEQUENCE_ERROR

#define SYN_UDS_NRC_REQUEST_SEQUENCE_ERROR `0x24U`

Request sequence error (0x24)


define SYN_UDS_NRC_REQUIRED_TIME_DELAY_NOT_EXPIRED

#define SYN_UDS_NRC_REQUIRED_TIME_DELAY_NOT_EXPIRED `0x37U`

Required time delay not expired (0x37)


define SYN_UDS_NRC_RESPONSE_TOO_LONG

#define SYN_UDS_NRC_RESPONSE_TOO_LONG `0x14U`

Response too long (0x14)


define SYN_UDS_NRC_SECURITY_ACCESS_DENIED

#define SYN_UDS_NRC_SECURITY_ACCESS_DENIED `0x33U`

Security access denied (0x33)


define SYN_UDS_NRC_SERVICE_NOT_SUPPORTED

#define SYN_UDS_NRC_SERVICE_NOT_SUPPORTED `0x11U`

Service not supported (0x11)


define SYN_UDS_NRC_SUBFUNCTION_NOT_SUPPORTED

#define SYN_UDS_NRC_SUBFUNCTION_NOT_SUPPORTED `0x12U`

Sub-function not supported (0x12)


define SYN_UDS_NRC_SUBFUNCTION_NOT_SUPPORTED_IN_ACTIVE_SESSION

#define SYN_UDS_NRC_SUBFUNCTION_NOT_SUPPORTED_IN_ACTIVE_SESSION `0x7EU`

Sub-function not supported in active session (0x7E)


define SYN_UDS_NRC_SUCCESS

#define SYN_UDS_NRC_SUCCESS `0x00U`

Positive response (0x00)


define SYN_UDS_NRC_TRANSFER_DATA_SUSPENDED

#define SYN_UDS_NRC_TRANSFER_DATA_SUSPENDED `0x71U`

Transfer data suspended (0x71)


define SYN_UDS_NRC_WRONG_BLOCK_SEQUENCE_COUNTER

#define SYN_UDS_NRC_WRONG_BLOCK_SEQUENCE_COUNTER `0x73U`

Wrong block sequence counter (0x73)


define SYN_UDS_RESET_DISABLE_RAPID_POWER_SHUTDOWN

#define SYN_UDS_RESET_DISABLE_RAPID_POWER_SHUTDOWN `0x05U`

Disable rapid power shutdown


define SYN_UDS_RESET_ENABLE_RAPID_POWER_SHUTDOWN

#define SYN_UDS_RESET_ENABLE_RAPID_POWER_SHUTDOWN `0x04U`

Enable rapid power shutdown


define SYN_UDS_RESET_HARD

#define SYN_UDS_RESET_HARD `0x01U`

Hard reset


define SYN_UDS_RESET_KEY_OFF_ON

#define SYN_UDS_RESET_KEY_OFF_ON `0x02U`

Key off/on reset


define SYN_UDS_RESET_SOFT

#define SYN_UDS_RESET_SOFT `0x03U`

Soft reset


define SYN_UDS_RESPONSE_NEGATIVE

#define SYN_UDS_RESPONSE_NEGATIVE `0x7FU`

Negative response code header


define SYN_UDS_S3_TIMEOUT_MS

#define SYN_UDS_S3_TIMEOUT_MS `5000U`

S3 session timeout in ms


define SYN_UDS_SECURITY_DELAY_MS

#define SYN_UDS_SECURITY_DELAY_MS `10000U`

Security delay penalty in ms


define SYN_UDS_SECURITY_MASK_ALL

#define SYN_UDS_SECURITY_MASK_ALL `(0xFFFFU)`

Allowed in all security states


define SYN_UDS_SECURITY_MASK_LEVEL_1

#define SYN_UDS_SECURITY_MASK_LEVEL_1 `(1U << 1)`

Security Level 1 required


define SYN_UDS_SECURITY_MASK_LEVEL_2

#define SYN_UDS_SECURITY_MASK_LEVEL_2 `(1U << 2)`

Security Level 2 required


define SYN_UDS_SECURITY_MASK_LEVEL_3

#define SYN_UDS_SECURITY_MASK_LEVEL_3 `(1U << 3)`

Security Level 3 required


define SYN_UDS_SECURITY_MASK_NONE

#define SYN_UDS_SECURITY_MASK_NONE `(1U << 0)`

Unlocked without security (Level 0 / Locked)


define SYN_UDS_SECURITY_MAX_ATTEMPTS

#define SYN_UDS_SECURITY_MAX_ATTEMPTS `3U`

Max security unlock attempts


define SYN_UDS_SESSION_MASK_ALL

#define SYN_UDS_SESSION_MASK_ALL `(0x0FU)`

Allowed in all sessions


define SYN_UDS_SESSION_MASK_DEFAULT

#define SYN_UDS_SESSION_MASK_DEFAULT `(1U << 0)`

Default Session


define SYN_UDS_SESSION_MASK_EXTENDED

#define SYN_UDS_SESSION_MASK_EXTENDED `(1U << 2)`

Extended Diagnostic Session


define SYN_UDS_SESSION_MASK_PROGRAMMING

#define SYN_UDS_SESSION_MASK_PROGRAMMING `(1U << 1)`

Programming Session


define SYN_UDS_SESSION_MASK_SAFETY

#define SYN_UDS_SESSION_MASK_SAFETY `(1U << 3)`

Safety System Session


define SYN_UDS_SID_ACCESS_TIMING_PARAMETER

#define SYN_UDS_SID_ACCESS_TIMING_PARAMETER `0x83U`

AccessTimingParameter


define SYN_UDS_SID_AUTHENTICATION

#define SYN_UDS_SID_AUTHENTICATION `0x29U`

Authentication


define SYN_UDS_SID_CLEAR_DIAGNOSTIC_INFORMATION

#define SYN_UDS_SID_CLEAR_DIAGNOSTIC_INFORMATION `0x14U`

ClearDiagnosticInformation


define SYN_UDS_SID_COMMUNICATION_CONTROL

#define SYN_UDS_SID_COMMUNICATION_CONTROL `0x28U`

CommunicationControl


define SYN_UDS_SID_CONTROL_DTC_SETTING

#define SYN_UDS_SID_CONTROL_DTC_SETTING `0x85U`

ControlDTCSetting


define SYN_UDS_SID_DIAGNOSTIC_SESSION_CONTROL

#define SYN_UDS_SID_DIAGNOSTIC_SESSION_CONTROL `0x10U`

DiagnosticSessionControl


define SYN_UDS_SID_DYNAMICALLY_DEFINE_DATA_IDENTIFIER

#define SYN_UDS_SID_DYNAMICALLY_DEFINE_DATA_IDENTIFIER `0x2CU`

DynamicallyDefineDataIdentifier \


define SYN_UDS_SID_ECU_RESET

#define SYN_UDS_SID_ECU_RESET `0x11U`

ECUReset


define SYN_UDS_SID_INPUT_OUTPUT_CONTROL_BY_IDENTIFIER

#define SYN_UDS_SID_INPUT_OUTPUT_CONTROL_BY_IDENTIFIER `0x2FU`

InputOutputControlByIdentifier \


#define SYN_UDS_SID_LINK_CONTROL `0x87U`

LinkControl


define SYN_UDS_SID_READ_DATA_BY_IDENTIFIER

#define SYN_UDS_SID_READ_DATA_BY_IDENTIFIER `0x22U`

ReadDataByIdentifier


define SYN_UDS_SID_READ_DATA_BY_PERIODIC_IDENTIFIER

#define SYN_UDS_SID_READ_DATA_BY_PERIODIC_IDENTIFIER `0x2AU`

ReadDataByPeriodicIdentifier


define SYN_UDS_SID_READ_DTC_INFORMATION

#define SYN_UDS_SID_READ_DTC_INFORMATION `0x19U`

ReadDTCInformation


define SYN_UDS_SID_READ_MEMORY_BY_ADDRESS

#define SYN_UDS_SID_READ_MEMORY_BY_ADDRESS `0x23U`

ReadMemoryByAddress


define SYN_UDS_SID_READ_SCALING_DATA_BY_IDENTIFIER

#define SYN_UDS_SID_READ_SCALING_DATA_BY_IDENTIFIER `0x24U`

ReadScalingDataByIdentifier


define SYN_UDS_SID_REQUEST_DOWNLOAD

#define SYN_UDS_SID_REQUEST_DOWNLOAD `0x34U`

RequestDownload


define SYN_UDS_SID_REQUEST_FILE_TRANSFER

#define SYN_UDS_SID_REQUEST_FILE_TRANSFER `0x38U`

RequestFileTransfer


define SYN_UDS_SID_REQUEST_TRANSFER_EXIT

#define SYN_UDS_SID_REQUEST_TRANSFER_EXIT `0x37U`

RequestTransferExit


define SYN_UDS_SID_REQUEST_UPLOAD

#define SYN_UDS_SID_REQUEST_UPLOAD `0x35U`

RequestUpload


define SYN_UDS_SID_RESPONSE_ON_EVENT

#define SYN_UDS_SID_RESPONSE_ON_EVENT `0x86U`

ResponseOnEvent


define SYN_UDS_SID_ROUTINE_CONTROL

#define SYN_UDS_SID_ROUTINE_CONTROL `0x31U`

RoutineControl


define SYN_UDS_SID_SECURED_DATA_TRANSMISSION

#define SYN_UDS_SID_SECURED_DATA_TRANSMISSION `0x84U`

SecuredDataTransmission


define SYN_UDS_SID_SECURITY_ACCESS

#define SYN_UDS_SID_SECURITY_ACCESS `0x27U`

SecurityAccess


define SYN_UDS_SID_TESTER_PRESENT

#define SYN_UDS_SID_TESTER_PRESENT `0x3EU`

TesterPresent


define SYN_UDS_SID_TRANSFER_DATA

#define SYN_UDS_SID_TRANSFER_DATA `0x36U`

TransferData


define SYN_UDS_SID_WRITE_DATA_BY_IDENTIFIER

#define SYN_UDS_SID_WRITE_DATA_BY_IDENTIFIER `0x2EU`

WriteDataByIdentifier


define SYN_UDS_SID_WRITE_MEMORY_BY_ADDRESS

#define SYN_UDS_SID_WRITE_MEMORY_BY_ADDRESS `0x3DU`

WriteMemoryByAddress



The documentation for this class was generated from the following file src/syntropic/proto/syn_uds.h