tags: UDS
1. CommunicationControl (0x28) service
This service is to control a type of communication shutdown / enable reception or send. When UDS needs to download an upgrade or transfer a large amount of data, you need to make the CAN bus resources out and increase transport efficiency. At this time, you can turn off a certain type of communication through 28 service to the CAN bus. After the upgrade or transfer data is completed, the communication will be turned on by the 28 service.
1.1 Request format:

From the above figure, the service request format is divided into four parts.
Part 1: The first byte is SID 0x28
Part II: The second byte is sub function, controlling the reception and transmission of this type of communication is open or closed
0x00 enablerxandtx (enabled reception and send)
0x01 enablerxanddisabletx (enabled reception and closing send)
0x02 DisablerxandenableEtX (enabled sending and closing reception)
0x03 DisablerxandTX (shut down reception and send)
0x04 enablerxanddisabletxwithenhancedaddressInformation (enabled receiving and closing send, for a specific address)
0x05 enablerxandtxwithenhancedaddressInformation (enabled receiving and sending, for a specific address)
0x06 - 0x7f is all reserved or left to the vendor custom.
Part III: CommunicationType: Which type of communication is controlled

From the figure, you can know that CommunicationType accounts for one byte, I only use 0-2 bits parameters. 0x1 represents ordinary application packets, 0x2 represents network management packets, 0x3 represents normal application packets and network management messages.
1.2 Response format:

From the above figure, it is known that the response format is divided into two parts: Part 1: RESPONSE SID, the second part: SUB Function. The two parts each take up one byte.
1.3 example
The diagnostic requests ECU turn off the reception and transmission of ordinary application packets, that is, SUB Function: 0x03, Communication Type: 0x01. Send requests and responses as shown below:

2. ControlDTCSetting (0x85) service
The service is used to control the ECU's DTC storage. This service is often used with the 28 service mentioned earlier. For example, before starting writing parameters, in order to get a faster transfer speed, we use 28 service to turn all ECU communication. However, because the ECU will not necessarily store many DTCs, if we use the 85 service to temporarily disable the ECU storage DTC, it will not cause this trouble. For example: ECU will detect the CAN bus message. When using 28 service to close the reception and send messages, the CAN bus does not have a message, and the ECU will store the CAN bus error DTC, so sometimes it will use 85 before using 28 service. Service shutdown response DTC storage function.
2.1 Request format:

The request format is divided into three parts;
Part 1: Request SID 0x85
Part II: SUB FUNCTION, occupying one byte, parameters are as follows
0x00: IsosaereServed (reserved)
0x01: ON (DTC open)
0x02: OFF (DTC close)
0x03-0x7f: reserve or manufacturers custom
Part III: DTCSETTINGCONTROLOPTIONRECORD manufacturers custom, for example, can use FF FF FF to indicate this diagnostic command for all DTCs.
2.2 Response format

The response format is divided into two parts, the first part: Response SID: 0xc5; Part I: DTCSETTINGTYPE: Request Sub Function Echo.
2.3 Examples
The diagnostic request ECU turns off all DTC storage, manufacturers custom request parameters DTCSETTINGCONTROLOPTIONRECORD = 0xfffff for all DTC storage control code. The request and response as shown below:

Reference: https://zhuanlan.zhihu.com/p/33852614
0x00 Overview UDS (University Diagnostics System Universal Diagnostic System) is a maintenance protocol commonly used in the vehicle system. The main regulations as follows: ISO-15765, ISO-14229, whic...
I am a software engineer in the automotive application layer and joined a new company last year. In the middle of the year, we must use the computer to realize the interactive functions of quantitativ...
The UDS diagnostic service is located at the application layer, and the network layer is below the application layer, so the diagnostic data is pushed down from the application layer to the network la...
In the second article on UDS, I mentioned that the services defined by UDS are logically divided into six categories. The first five categories have been explained in the second to sixth articles. In ...
Application layer and kernel layer data transmission Linux - cut all documents! The corresponding operation of the file is opened, closed, read and written The operation of the device node is open, cl...
The network layer defines six time parameters: N_Ar, N_As, N_Br, N_Bs, N_Cr, N_Cs。 The network layer transmits to the upper user at the time the error is detected 1. When the N_As expires, that is, th...
Article Directory 1 Session layer and addressing method of diagnostic service Portal ==>> AutoSAR Practical Series 300 Lectures "Candy Autosar" General Directory 1 Session layer and ad...
Copyright (C) Professor Xiaowen Dong @ School of Automation, Beijing University of Technology 7 The Application Layer 7.1 DNS—the Domain Name System 7.2 Electronic Mail 7.3 The World Wide Web Ap...
1. Background Automobile fault diagnosis is to use ECU to monitor the working conditions of each component of the control system, and automatically start the fault recording and processing logic after...