This document is based on email conversation with Hannes Kaelber
Hannes Kaelber translated the original documentation from German
|payload_length||message type||checksum type||PID||checksum||errors|
|Field||Length in Bits||Meaning|
|msg_format_rev||8||LIN Message Format Revision, this field must always be set to 1, 0 is invalid value|
|payload_length||4||Number of LIN payload bytes|
|message_type||2||Message type (0=LIN-Frame, 3=LIN-Event, 1 and 2=undefined)|
Checksum type (0=unknown/error, 1=classic, 2=enhanced, 3=undefined)
unknown/error means that either the checksum is incorrect (usually the case) or that a checksum algorithm we do not know has been used (should not happen). Since we detect which checksum variant has been used and we cannot say that for sure if the checksum is incorrect, we have introduced this value.
|PID||8||Protected Identifier, as described in section 184.108.40.206 "PID field" of ISO 17987-3:2016|
|checksum||8||Checksum, as described in section 220.127.116.11 "Checksum" of ISO 17987-3:2016|
|errors||8||Error Bits (see below)|
|payload[n]||8||Payload Byte n. Payload 5-8 exists only if payload_length is larger than 4|
The Error Bits are as follows:
|Error Bit||Bits Bitmask||Meaning|
|e_overflow||0x20||Overflow Error, we have lost at least one message during reception because there was no space in the receiving controller's buffer|
|e_invalidid||0x10||Invalid ID, i.e. a frame ID of 0x3E or 0x3F has been received|
|e_parity||0x04||Parity Error in the Protected Identifier field|
|e_framing||0x02||Framing Error, low-level transmissions/reception error|
|e_noslaveresp||0x01||No Slave Response Error; no slave wrote the Response part of the frame, as per section 4.2.2 "Frames" of ISO 17987-3:2016|
LIN FrameIf a message is a LIN-Frame, the payload is a LIN N_PDU, as described in section 7.4 "Transport layer protocol data units" of ISO 17987-2.
LIN EventIf a message is a LIN-Event, the following rules apply:
- payload_length is always 4.
- The fields checksum_type, PID, checksum and errors are set to 0 and must be ignored.
- The payload bytes 1-4 contain the type of the LIN event (big endian)
|0xB0B00001||Go-to-Sleep Event caused by a Go-to-Sleep Frame|
|0xB0B00002||Go-to-Sleep Event caused by bus inactivity for more than 4s|
|0xB0B00004||Wake-up Event caused by a Wake-up Signal|