Skip to main content

checksum

Function checksum 

Source
pub const fn checksum(frame: &[u8], crc_extra: u8) -> u16
Expand description

Computes the checksum a frame carries: the CRC over its bytes with the message’s CRC_EXTRA folded in last.

§Arguments

  • frame - the frame bytes the checksum covers: everything after the start marker up to but not including the two checksum bytes (and not the signature).
  • crc_extra - the CRC_EXTRA seed for the frame’s message id.

§Returns

The 16-bit checksum to append, low byte first.