This page documents the services supported by iso14229.
| Service ID | Service Name | Server | Client | Standard Responses* |
|---|---|---|---|---|
| 0x10 | \ref service_0x10 "Diagnostic Session Control" | Y | Y | \ref service_0x10_supported_responses "NRCs" |
| 0x11 | \ref service_0x11 "ECU Reset" | Y | Y | \ref service_0x11_supported_responses "NRCs" |
| 0x14 | \ref service_0x14 "Clear Diagnostic Information" | Y | N | \ref service_0x14_supported_responses "NRCs" |
| 0x19 | Read DTC Information | N | N | |
| 0x22 | \ref service_0x22 "Read Data By Identifier" | Y | Y | \ref service_0x22_supported_responses "NRCs" |
| 0x23 | Read Memory By Address | N | N | |
| 0x24 | Read Scaling Data By Identifier | N | N | |
| 0x27 | \ref service_0x27 "Security Access" | Y | Y | \ref service_0x27_supported_responses "NRCs" |
| 0x28 | \ref service_0x28 "Communication Control" | Y | Y | \ref service_0x28_supported_responses "NRCs" |
| 0x2A | Read Periodic Data By Identifier | N | N | |
| 0x2C | Dynamically Define Data Identifier | N | N | |
| 0x2E | \ref service_0x2e "Write Data By Identifier" | Y | Y | \ref service_0x2e_supported_responses "NRCs" |
| 0x2F | Input/Output Control By Identifier | Y | N | |
| 0x31 | \ref service_0x31 "Routine Control" | Y | Y | \ref service_0x31_supported_responses "NRCs" |
| 0x34 | \ref service_0x34 "Request Download" | Y | Y | \ref service_0x34_supported_responses "NRCs" |
| 0x35 | Request Upload | Y | Y | |
| 0x36 | \ref service_0x36 "Transfer Data" | Y | Y | \ref service_0x36_supported_responses "NRCs" |
| 0x37 | \ref service_0x37 "Request Transfer Exit" | Y | Y | \ref service_0x37_supported_responses "NRCs" |
| 0x38 | Request File Transfer | Y | Y | |
| 0x3D | Write Memory By Address | Y | N | |
| 0x3E | Tester Present | Y | Y | |
| 0x83 | Access Timing Parameter | N | N | |
| 0x84 | Secured Data Transmission | N | N | |
| 0x85 | Control DTC Setting | Y | Y | |
| 0x86 | Response On Event | N | N | |
| 0x87 | Link Control | Y | N |
The standard lists a set of supported NRCs for each service. In your server implementation, it is recommended to use to these whenever possible.
Change the diagnostic session type.
UDS_EVT_DiagSessCtrl
typedef struct {
const uint8_t type; /*! requested session type */
uint16_t p2_ms; /*! optional return value: p2 timing override */
uint32_t p2_star_ms; /*! optional return value: p2* timing override */
} UDSDiagSessCtrlArgs_t;| Value | Define | Description |
|---|---|---|
| 0x01 | UDS_LEV_DS_DS |
Default Session |
| 0x02 | UDS_LEV_DS_PRGS |
Programming Session |
| 0x03 | UDS_LEV_DS_EXTDS |
Extended Diagnostic Session |
| 0x04 | UDS_LEV_DS_SSDS |
Safety System Diagnostic Session |
| Value | Enum | Meaning |
|---|---|---|
0x00 |
UDS_PositiveResponse |
Request accepted |
0x12 |
UDS_NRC_SubFunctionNotSupported |
Requested session type not supported |
0x22 |
UDS_NRC_ConditionsNotCorrect |
Conditions not correct |
\ref UDSSendDiagSessCtrl
Request ECU reset.
UDS_EVT_EcuReset
typedef struct {
const uint8_t type; /*! reset type */
uint32_t powerDownTimeMillis; /*! delay before reset event */
} UDSECUResetArgs_t;| Value | Define | Description |
|---|---|---|
| 0x01 | UDS_LEV_RT_HR |
Hard Reset |
| 0x02 | UDS_LEV_RT_KOFFONR |
Key Off On Reset |
| 0x03 | UDS_LEV_RT_SR |
Soft Reset |
| 0x04 | UDS_LEV_RT_ERPSD |
Enable Rapid Power Shutdown |
| 0x05 | UDS_LEV_RT_DRPSD |
Disable Rapid Power Shutdown |
| Value | Enum | Meaning |
|---|---|---|
0x00 |
UDS_PositiveResponse |
Reset will occur |
0x12 |
UDS_NRC_SubFunctionNotSupported |
Reset type not supported |
0x22 |
UDS_NRC_ConditionsNotCorrect |
Conditions not correct for reset |
0x33 |
UDS_NRC_SecurityAccessDenied |
Security access required |
\ref UDSSendECUReset
Clear diagnostic trouble codes.
UDS_EVT_ClearDiagnosticInfo
typedef struct {
const uint32_t groupOfDTC; /*! DTC group to clear */
const bool hasMemorySelection; /*! memory selection present */
const uint8_t memorySelection; /*! memory selection (optional) */
} UDSCDIArgs_t;| Value | Enum | Meaning |
|---|---|---|
0x00 |
UDS_PositiveResponse |
DTCs cleared |
0x22 |
UDS_NRC_ConditionsNotCorrect |
Cannot clear DTCs now |
0x31 |
UDS_NRC_RequestOutOfRange |
Invalid DTC group |
Read data identified by a 16-bit identifier.
UDS_EVT_ReadDataByIdent
typedef struct {
const uint16_t dataId; /*! data identifier */
uint8_t (*copy)(UDSServer_t *srv, const void *src, uint16_t count);
} UDSRDBIArgs_t;| Value | Enum | Meaning |
|---|---|---|
0x00 |
UDS_PositiveResponse |
Data returned successfully |
0x14 |
UDS_NRC_ResponseTooLong |
Response exceeds buffer |
0x22 |
UDS_NRC_ConditionsNotCorrect |
Cannot read data now |
0x31 |
UDS_NRC_RequestOutOfRange |
Data identifier not supported |
0x33 |
UDS_NRC_SecurityAccessDenied |
Security access required |
\ref UDSSendRDBI, \ref UDSUnpackRDBIResponse
See \ref examples/linux_rdbi_wdbi/README.md
Unlock security-protected diagnostic services.
UDS_EVT_SecAccessRequestSeed- Client requests seedUDS_EVT_SecAccessValidateKey- Client sends key for validation
Request Seed:
typedef struct {
const uint8_t level; /*! security level */
const uint8_t *const dataRecord; /*! request data */
const uint16_t len; /*! data length */
uint8_t (*copySeed)(UDSServer_t *srv, const void *src, uint16_t len);
} UDSSecAccessRequestSeedArgs_t;Validate Key:
typedef struct {
const uint8_t level; /*! security level */
const uint8_t *const key; /*! key to validate */
const uint16_t len; /*! key length */
} UDSSecAccessValidateKeyArgs_t;Odd levels (0x01, 0x03, ...) request seed, even levels (0x02, 0x04, ...) send key.
| Value | Enum | Meaning |
|---|---|---|
0x00 |
UDS_PositiveResponse |
Seed provided or key accepted |
0x12 |
UDS_NRC_SubFunctionNotSupported |
Security level not supported |
0x22 |
UDS_NRC_ConditionsNotCorrect |
Wrong sequence |
0x24 |
UDS_NRC_RequestSequenceError |
Request out of sequence |
0x35 |
UDS_NRC_InvalidKey |
Key verification failed |
0x36 |
UDS_NRC_ExceedNumberOfAttempts |
Too many failed attempts |
0x37 |
UDS_NRC_RequiredTimeDelayNotExpired |
Must wait before retry |
\ref UDSSendSecurityAccess, \ref UDSUnpackSecurityAccessResponse
See \ref examples/linux_server_0x27/README.md
Control communication messages.
UDS_EVT_CommCtrl
typedef struct {
uint8_t ctrlType; /*! control type */
uint8_t commType; /*! communication type */
uint16_t nodeId; /*! node ID (optional) */
} UDSCommCtrlArgs_t;| Value | Define | Description |
|---|---|---|
| 0x00 | UDS_LEV_CTRLTP_ERXTX |
Enable RX and TX |
| 0x01 | UDS_LEV_CTRLTP_ERXDTX |
Enable RX, Disable TX |
| 0x02 | UDS_LEV_CTRLTP_DRXETX |
Disable RX, Enable TX |
| 0x03 | UDS_LEV_CTRLTP_DRXTX |
Disable RX and TX |
| Value | Enum | Meaning |
|---|---|---|
0x00 |
UDS_PositiveResponse |
Control accepted |
0x12 |
UDS_NRC_SubFunctionNotSupported |
Control type not supported |
0x22 |
UDS_NRC_ConditionsNotCorrect |
Cannot apply control |
0x31 |
UDS_NRC_RequestOutOfRange |
Invalid parameters |
\ref UDSSendCommCtrl
Write data identified by a 16-bit identifier.
UDS_EVT_WriteDataByIdent
typedef struct {
const uint16_t dataId; /*! data identifier */
const uint8_t *const data; /*! data to write */
const uint16_t len; /*! data length */
} UDSWDBIArgs_t;| Value | Enum | Meaning |
|---|---|---|
0x00 |
UDS_PositiveResponse |
Data written successfully |
0x13 |
UDS_NRC_IncorrectMessageLengthOrInvalidFormat |
Invalid data length |
0x22 |
UDS_NRC_ConditionsNotCorrect |
Cannot write now |
0x31 |
UDS_NRC_RequestOutOfRange |
Data identifier not supported |
0x33 |
UDS_NRC_SecurityAccessDenied |
Security access required |
\ref UDSSendWDBI
See \ref examples/linux_rdbi_wdbi/README.md
Start, stop, or request results from server-side routines.
UDS_EVT_RoutineCtrl
typedef struct {
const uint8_t ctrlType; /*! routine control type */
const uint16_t id; /*! routine identifier */
const uint8_t *optionRecord; /*! optional data */
const uint16_t len; /*! option data length */
uint8_t (*copyStatusRecord)(UDSServer_t *srv, const void *src, uint16_t len);
} UDSRoutineCtrlArgs_t;| Value | Define | Description |
|---|---|---|
| 0x01 | UDS_LEV_RCTP_STR |
Start Routine |
| 0x02 | UDS_LEV_RCTP_STPR |
Stop Routine |
| 0x03 | UDS_LEV_RCTP_RRR |
Request Routine Results |
| Value | Enum | Meaning |
|---|---|---|
0x00 |
UDS_PositiveResponse |
Routine control accepted |
0x12 |
UDS_NRC_SubFunctionNotSupported |
Control type not supported |
0x22 |
UDS_NRC_ConditionsNotCorrect |
Cannot execute routine |
0x24 |
UDS_NRC_RequestSequenceError |
Wrong sequence |
0x31 |
UDS_NRC_RequestOutOfRange |
Routine ID not supported |
0x33 |
UDS_NRC_SecurityAccessDenied |
Security access required |
\ref UDSSendRoutineCtrl, \ref UDSUnpackRoutineControlResponse
Initiate data download to server (flash programming, calibration update).
UDS_EVT_RequestDownload
typedef struct {
const void *addr; /*! memory address */
const size_t size; /*! download size */
const uint8_t dataFormatIdentifier; /*! data format */
uint16_t maxNumberOfBlockLength; /*! max block size response */
} UDSRequestDownloadArgs_t;| Value | Enum | Meaning |
|---|---|---|
0x00 |
UDS_PositiveResponse |
Download accepted |
0x22 |
UDS_NRC_ConditionsNotCorrect |
Cannot download now |
0x31 |
UDS_NRC_RequestOutOfRange |
Invalid address/size |
0x33 |
UDS_NRC_SecurityAccessDenied |
Security access required |
0x70 |
UDS_NRC_UploadDownloadNotAccepted |
Download rejected |
\ref UDSSendRequestDownload, \ref UDSUnpackRequestDownloadResponse
Transfer data blocks after Request Download/Upload.
UDS_EVT_TransferData
typedef struct {
const uint8_t *const data; /*! transfer data */
const uint16_t len; /*! data length */
const uint16_t maxRespLen; /*! max response length */
uint8_t (*copyResponse)(UDSServer_t *srv, const void *src, uint16_t len);
} UDSTransferDataArgs_t;| Value | Enum | Meaning |
|---|---|---|
0x00 |
UDS_PositiveResponse |
Data transferred |
0x24 |
UDS_NRC_RequestSequenceError |
No active transfer |
0x71 |
UDS_NRC_TransferDataSuspended |
Transfer suspended |
0x72 |
UDS_NRC_GeneralProgrammingFailure |
Programming failed |
0x73 |
UDS_NRC_WrongBlockSequenceCounter |
Block sequence error |
\ref UDSSendTransferData
Terminate data transfer.
UDS_EVT_RequestTransferExit
typedef struct {
const uint8_t *const data; /*! request data */
const uint16_t len; /*! data length */
uint8_t (*copyResponse)(UDSServer_t *srv, const void *src, uint16_t len);
} UDSRequestTransferExitArgs_t;| Value | Enum | Meaning |
|---|---|---|
0x00 |
UDS_PositiveResponse |
Transfer exited successfully |
0x24 |
UDS_NRC_RequestSequenceError |
No active transfer |
0x72 |
UDS_NRC_GeneralProgrammingFailure |
Exit processing failed |
\ref UDSSendRequestTransferExit
- \ref client "Client API"
- \ref server "Server API"
- ISO 14229-1:2020 - Road vehicles - Unified diagnostic services (UDS)