saleae / lin-analyzer

Saleae Local Interconnect Network (LIN) Analyzer
MIT License
8 stars 8 forks source link

Fix checksum computation if using PID greater or equal than 0x3C #1

Closed francois-berder closed 3 years ago

francois-berder commented 5 years ago

As per LIN 2.0 specification section 2.1.5, "Identifiers 60 (0x3c) to 63 (0x3f) shall always use classic checksum."

Signed-off-by: Francois Berder 18538310+francois-berder@users.noreply.github.com

Marcus10110 commented 3 years ago

Sorry this sat for so long! Thanks for sending this in. Several other users have reported this too.

One quick note - the 2.2A Specification says this about checksums:

Frame identifiers 60 (0x3C) to 61 (0x3D) shall always use classic checksum.

retrieved from here: https://www.cs-group.de/wp-content/uploads/2016/11/LIN_Specification_Package_2.2A.pdf

The 60 to 63 range is mentioned in the "Assign frame ID range" section here:

It is important to notice that the request provides the protected identifier, i.e. the frame identifier and its parity. Furthermore, frames with frame identifiers 60 (0x3C) to 63 (0x3F) can not be changed (diagnostic frames and reserved frames).

The equality operator has been replaced with assignment, but I've left the original 2 ids 0x3C and 0x3D in there. Please re-open if this is incorrect. (also please contact support, which we're monitoring properly. Again, sorry for the delays with issues here!)