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 22.214.171.124 "PID field" of ISO 17987-3:2016.|
|checksum||8||Checksum, as described in section 126.96.36.199 "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|
||Overflow Error, we have lost at least one message during reception because there was no space in the receiving controller's buffer.|
||Invalid ID, i.e. a frame ID of
||Parity Error in the Protected Identifier field.|
||Framing Error, low-level transmissions/reception error.|
||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).
||Go-to-Sleep Event caused by a Go-to-Sleep Frame.|
||Go-to-Sleep Event caused by bus inactivity for more than 4s.|
||Wake-up Event caused by a Wake-up Signal.|