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

linSetChecksumModel

Valid for: CANoe DE

Function Syntax

  • long linSetChecksumModel(long channel, long frameID, long checksumModel); // form 1
  • long linSetChecksumModel(long frameID, long checksumModel); // form 2

Description

Sets the checksum calculation model of a single frame. Note
  • This function may only be called in the event procedure on preStart.
  • If the affected LIN channel uses a protocol version that does not support the enhanced checksum model, setting a frame identifier to enhanced checksum model will fail.

Parameters

  • channel: The channel for which the checksum model of the frame should be changed. Value range: 1..32
  • frameId: The unprotected identifier of the frame. Value range: 0 .. 63 (excluding 60 and 61).
  • checksumModel:
    • Value range: 0..1
    • 0: classic (LIN 1.x) checksum model
    • 1: enhanced (LIN 2.x) checksum model

Return Values

On success, a value unequal to zero, otherwise zero.

Example

on prestart
{
  /*send and receive the frame with the ID "4" using the classic checksum model*/
  linSetChecksumModel(4,0);
}

on prestart
{
  /*send and receive the frame with the ID "4" on channel 1 using the classic checksum model*/
  linSetChecksumModel(1,4,0);
}
linGetChecksumlinSetChecksumCompatibility