iso14229 0.9.0
ISO14229-1 (UDS) C Library
Loading...
Searching...
No Matches
UDS Services

This page documents the services supported by iso14229.

Supported Services

Service ID Service Name Server Client Standard Responses*
0x10 Diagnostic Session Control Y Y NRCs
0x11 ECU Reset Y Y NRCs
0x14 Clear Diagnostic Information Y N NRCs
0x19 Read DTC Information N N
0x22 Read Data By Identifier Y Y NRCs
0x23 Read Memory By Address N N
0x24 Read Scaling Data By Identifier N N
0x27 Security Access Y Y NRCs
0x28 Communication Control Y Y NRCs
0x2A Read Periodic Data By Identifier N N
0x2C Dynamically Define Data Identifier N N
0x2E Write Data By Identifier Y Y NRCs
0x2F Input/Output Control By Identifier Y N
0x31 Routine Control Y Y NRCs
0x34 Request Download Y Y NRCs
0x35 Request Upload Y Y
0x36 Transfer Data Y Y NRCs
0x37 Request Transfer Exit Y Y 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

Standard Responses*

The standard lists a set of supported NRCs for each service. In your server implementation, it is recommended to use to these whenever possible.


0x10 Diagnostic Session Control

Change the diagnostic session type.

Server Event

UDS_EVT_DiagSessCtrl

Arguments

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 */
Diagnostic session control arguments.
Definition iso14229.h:905

Session Types

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

Supported Responses

Value Enum Meaning
0x00 UDS_PositiveResponse Request accepted
0x12 UDS_NRC_SubFunctionNotSupported Requested session type not supported
0x22 UDS_NRC_ConditionsNotCorrect Conditions not correct

Client API

UDSSendDiagSessCtrl


0x11 ECU Reset

Request ECU reset.

Server Event

UDS_EVT_EcuReset

Arguments

typedef struct {
const uint8_t type; /*! reset type */
uint32_t powerDownTimeMillis; /*! delay before reset event */
ECU reset arguments.
Definition iso14229.h:914

Reset Types

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

Supported Responses

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

Client API

UDSSendECUReset


0x14 Clear Diagnostic Information

Clear diagnostic trouble codes.

Server Event

UDS_EVT_ClearDiagnosticInfo

Arguments

typedef struct {
const uint32_t groupOfDTC; /*! DTC group to clear */
const bool hasMemorySelection; /*! memory selection present */
const uint8_t memorySelection; /*! memory selection (optional) */
Clear diagnostic information arguments.
Definition iso14229.h:923

Supported Responses

Value Enum Meaning
0x00 UDS_PositiveResponse DTCs cleared
0x22 UDS_NRC_ConditionsNotCorrect Cannot clear DTCs now
0x31 UDS_NRC_RequestOutOfRange Invalid DTC group

0x22 Read Data By Identifier

Read data identified by a 16-bit identifier.

Server Event

UDS_EVT_ReadDataByIdent

Arguments

typedef struct {
const uint16_t dataId; /*! data identifier */
uint8_t (*copy)(UDSServer_t *srv, const void *src, uint16_t count);
Read data by identifier arguments.
Definition iso14229.h:978
UDS server structure.
Definition iso14229.h:850

Supported Responses

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

Client API

UDSSendRDBI, UDSUnpackRDBIResponse

Example

See Read/Write Data By Identifier Example


0x27 Security Access

Unlock security-protected diagnostic services.

Server Events

  • UDS_EVT_SecAccessRequestSeed - Client requests seed
  • UDS_EVT_SecAccessValidateKey - Client sends key for validation

Arguments

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);
Security access request seed arguments.
Definition iso14229.h:1006

Validate Key:

typedef struct {
const uint8_t level; /*! security level */
const uint8_t *const key; /*! key to validate */
const uint16_t len; /*! key length */
Security access validate key arguments.
Definition iso14229.h:1017

Security Levels

Odd levels (0x01, 0x03, ...) request seed, even levels (0x02, 0x04, ...) send key.

Supported Responses

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

Client API

UDSSendSecurityAccess, UDSUnpackSecurityAccessResponse

Example

See Security Access Example (0x27)


0x28 Communication Control

Control communication messages.

Server Event

UDS_EVT_CommCtrl

Arguments

typedef struct {
uint8_t ctrlType; /*! control type */
uint8_t commType; /*! communication type */
uint16_t nodeId; /*! node ID (optional) */
Communication control arguments.
Definition iso14229.h:997

Control Types

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

Supported Responses

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

Client API

UDSSendCommCtrl


0x2E Write Data By Identifier

Write data identified by a 16-bit identifier.

Server Event

UDS_EVT_WriteDataByIdent

Arguments

typedef struct {
const uint16_t dataId; /*! data identifier */
const uint8_t *const data; /*! data to write */
const uint16_t len; /*! data length */
Write data by identifier arguments.
Definition iso14229.h:1026

Supported Responses

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

Client API

UDSSendWDBI

Example

See Read/Write Data By Identifier Example


0x31 Routine Control

Start, stop, or request results from server-side routines.

Server Event

UDS_EVT_RoutineCtrl

Arguments

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);
Routine control arguments.
Definition iso14229.h:1078

Control Types

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

Supported Responses

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

Client API

UDSSendRoutineCtrl, UDSUnpackRoutineControlResponse


0x34 Request Download

Initiate data download to server (flash programming, calibration update).

Server Event

UDS_EVT_RequestDownload

Arguments

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 */
Request download arguments.
Definition iso14229.h:1090

Supported Responses

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

Client API

UDSSendRequestDownload, UDSUnpackRequestDownloadResponse


0x36 Transfer Data

Transfer data blocks after Request Download/Upload.

Server Event

UDS_EVT_TransferData

Arguments

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);
Transfer data arguments.
Definition iso14229.h:1112

Supported Responses

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

Client API

UDSSendTransferData


0x37 Request Transfer Exit

Terminate data transfer.

Server Event

UDS_EVT_RequestTransferExit

Arguments

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);
Request transfer exit arguments.
Definition iso14229.h:1124

Supported Responses

Value Enum Meaning
0x00 UDS_PositiveResponse Transfer exited successfully
0x24 UDS_NRC_RequestSequenceError No active transfer
0x72 UDS_NRC_GeneralProgrammingFailure Exit processing failed

Client API

UDSSendRequestTransferExit


See Also