DoCAN UDS Client Demo

There is an example implementation of UDS client available in apps folder. In this implementation, a simple command line interface (CLI) is used to trigger various services on to the ECU/server.

While all the implementation are meant to be tested without any underlying hardware, enabling a compile time macro PLATFORM_TEST_SUPPORT, will call some function that can be used to certain real functionalities.

Diagnostic Session Control (0x10) request

The CLI menu request the user to select one of Default, Programming, Extended or Safety System Diagnostic types. Based on the user input, relevant request code is sent. Based on the server response, prints are shown to indicate the session type established or the error that occurred.

ECU Reset (0x11) request

The type of request is obtained and sent accordingly. After receiving the response, the power down time is printed.

Clear Diagnostic Information (0x14) request

The CLI menu inputs the DTC group code to be cleared and send it to the server. The response error code is printed.

Read DTC Information (0x19) request

Specific DTC record IDs can be read using RS_IS14229_READ_DTC_REPORT_DTC_STORED_DATA_BY_RECORD_NUMBER sub-function code. Others are not supported. With 0xFF, all the 3 DTC records can be read in a single shot. In PLATFORM_TEST_SUPPORT mode, CAN transmit/receive counters and Air bag information from a GPIO are used.

Read Data By ID (0x22) request

Prompts the user to enter the number of data IDs to be read. Then each of the IDs are obtained and requested.

Read Memory By Address (0x23) request

Data can be read from the given memory address for the given number of bytes and the result is printed.

Read Scaling Data By Identifier (0x24) request

Scaling data can be read for the given data ID

Security Access (0x27) request

Obtains the type and optional data bytes to be sent to the server. Response data is printed as received.

Communication Control (0x28) request

Simply prints the control type information received from the tester. Few global variables updated but not used.

Read Data By Periodic Identifier (0x2A) request

Yet to be implemented in the example.

Write Data By Identifier (0x2E) request

Data ID specified as Read/Write are allowed to be written

Input Output Control By Identifier (0x2F) request

Only prints are supported with fixed response value.

Routine Control (0x31) request

A single routine to blink a LED is supported. When starting the routine, number of blinks to be done can be passed. The same can be stopped and or status queried.

RequestDownload (0x34) request

The example allows the client to download a data and optionally store it in local file system as a file.

TransferData (0x36) request

The example allows the client to transfer data.

RequestTransferExit (0x37) request

The example allows the client to complete data transfer.

Write Memory By Address (0x3D) request

Data can be written from address 0x20001000 using this service for up to 1500 bytes.

Tester Present (0x3E) request

A simple print can be seen on receiving this service request.

Access Timing Parameter (0x83) request

Simple prints can be seen on receiving this service request.

SecuredDataTransmission (0x84) request

The example simply returns one’s complement of the given input.

Control DTC Setting (0x85) request

The example simply prints the given input.