incorrectMessageLengthOrlnvalidFormatThe length of the message is wrong.
M
IMLOIF
22
conditionsNotCorrectThis return code shall be sent if a server receives a request for this service while inthe process of receiving a download of a software or calibration module. This couldoccur if there is a data size mismatch between the server and the client during thedownload of a module.
M
CNC
31
requestOutOfRangeThis return code shall be sent ifthe specified dataFormatldentifier is not valid.The specified addressAndLengthFormatldentifier is not valid,orThe specified memory Address/memory Size is not valid.
M
ROOR
33
securityAccessDeniedThis return code shall be sent if the server is secure (for servers that support the Security Access service) when a request for this service has been received.
M
SAD
70
uploadDownloadNotAcceptedThis response code indicates that an attempt to download to a server's memorycannot be accomplished due to fault conditions.
M
UDNA
举例如下:
tester 发送:
0x34 0x00 0x44 0x80 01 C0 00 0x00 01 C0 00
ECU响应:
0x74 0x20 0x0FFF (Positive response starting with 0x34+ 0x40 = 0x74, the length of maxNumberOfBlockLength is 0x2 Byte, maxNumberOfBlockLength is 0FFF, 3KB, the amount of data block transferred by each 0x36 Service.) 36服务功能:诊断刷写进行数据传输
TransferData (0x36)—— 数据传输
这个服务通常是用来下载/上传数据时用的,数据的传输方向由不同的服务控制:0x34服务表示下载,0x35服务表示上传。
0x36服务包含了一个blockSequenceCounter,在多个服务请求序列失败的时候以提高错误处理机制。在接收到0x34/0x35服务以后,blockSequenceCounter会被初始化为1。
服务请求报文中参数定义:
(1)blockSequenceCounter
这个值在第一次初始化的时候为0x01,往后每增加一次0x36服务的请求这个值也跟着增加1,直到增加到0xFF,会重新再从0x00增加(笔者的理解就是blockSequenceCounter的值对应用户此次请求传输出去的数据,以确保数据传输无误)。
例如以下2种情形:
数据已经正确的传输给ECU了,但是用户这边没有收到肯定响应,timeout以后用户这边会再次重复刚刚发出去的数据(blockSequenceCounter还是之前那个值)。这时候ECU通过blockSequenceCounter的值就可以知道用户又重复传了一次相同的数据,就不用再次重新写一遍Memory而直接给用户发送肯定响应。
如果数据没有正确传输给ECU,用户这边也不会收到肯定响应,timeout以后用户这边会再次重复刚刚发出去的数据(blockSequenceCounter还是之前那个值)。这时候ECU通过blockSequenceCounter的值就可以知道这是新传来的数据,则执行写Memory的操作,并且在成功后发送相应的肯定响应。
命令格式(请求&应答): 诊断请求: