Skip to main content
Open topic with navigation

CAPL Functions » General » Function Overview » Crc_CalculateCRC32P4

Crc_CalculateCRC32P4

Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE

Function Syntax

Description

Calculates the corresponding checksum for CRC32P4 based on the data. The calculation of the CRC value corresponds to AUTOSAR Profile 4.

Parameters

  • data: Payload data for which the checksum is to be calculated.
  • dataSize: Length of data block to be calculated in bytes.
  • dataOffset: Start index for the calculation of the CRC in the payload data.
  • crcLength: The length of the data for the CRC is calculated.
  • crcStartValue: CRC initial value depending on whether it is the first call or a subsequent call. Value is ignored if firstCall is 1.
  • firstCall: Flag for first call or a subsequent call. Possible values are 0 (subsequent call) or 1 (first call).
  • crcCalculated: Calculated CRC32P4 value.

Return Values

  • 0: Successful
  • -1: Not successful: CRC length must not be 0
  • -2: Not successful: Offset must not be greater or equal length
  • -3: Not successful: Length outside array range
  • -4: Not successful: Summary of Length and offset are outside array range

Example