gandrewstone / LIN

The LIN protocol implemented over Arduino APIs (Serial and Digital IO)
119 stars 46 forks source link

LIN diagnostic frames shall always use checksum calculation of protocol version 1. #9

Open ChrisPHL opened 3 years ago

ChrisPHL commented 3 years ago

in lin.cpp, line 124 should be exchanged to accomplish this automatically:

  // LIN diagnostic frame shall always use CHKSUM of protocol version 1.
  uint8_t cksum = dataChecksum(message, nBytes, (proto == 1 || addr == 0x3C) ? 0 : addrbyte);

Line 182 accordingly ;-):

    // LIN diagnostic frame shall always use CHKSUM of protocol version 1.
    if (proto == 1 || addr == 0x3D) idByte = 0; // Don't cksum the ID byte in LIN 1.x