Skip to main content
Open topic with navigation CAPL Functions » LIN » linGetChecksum

linGetChecksum

Valid for: CANoe DE • CANoe4SW DE

Function Syntax

  • byte linGetChecksum(linFrame linFrame); form 1
  • byte linGetChecksum(linCSError linCsError); // form 2

Description

Returns the checksum of a LIN frame or LIN checksum error. Checksum model (classic/enhanced) is determined automatically.

Parameters

  • linFrame: LIN frame object
  • linCsError: LIN checksum error object

Return Values

Calculated checksum

Example

Get the checksum of a received LIN frame with name myframe
on linFrame myframe
{
    byte checksum;
    checksum = linGetChecksum(this);
}
// Calculate the checksum of a LIN frame object
...
byte checksum;
// create a LIN frame object
linFrame 0x1 myLinFrame = { dlc = 1, byte(0) = 1 };
// calculate its checksum
checksum = linGetChecksum(myLinFrame);
linSetChecksumErrorlinSetManualChecksum