7.6.5.6 CHECKSUM

The CHECKSUM step reads a checksum and compares it to the checksum calculated from the message contents. If the values differ, the reception of this message is aborted and a communication fault is reported.

checksum-rx.gif

The parameters of this step specifier are:

SUM8 Expects a one byte checksum done by adding all bytes and truncating the sum to the lowest 8 bits.
SUM8H Like SUM8, but expects the checksum coded as a 2 digit hex number.
NSUM8 Expects a one byte checksum done by adding all bytes, taking the negative value of the sum and then truncating the sum to the lowest 8 bits.
NSUM8H Like NSUM8, but expects the checksum coded as a 2 digit hex number.
XOR8 Expects a one byte checksum, done by XOR-ing all specified bytes.
XOR8H Like XOR8, but expects the checksum coded as a 2 digit hex number.
MOD95 Expects the one character 'modulo 95' checksum, known from the protocol used by Miteq devices (see below).
CRC8 Expects a one byte CRC8 checksum.
CRC16L Expects a two byte CRC16 checksum, calculated with the ARC/LHA CRC algorithm. Expects the least significant byte first (little endian).
CRC16B Expects a two byte CRC16 checksum, calculated with the ARC/LHA CRC algorithm. Expects the most significant byte first (big endian).
start The buffer position of the first character to be included in the checksum computation (0 means the first character).
end The buffer position of the last character to be included in the checksum computation, relative to the actual position (-1 means the last character read).
offs The buffer position where the checksum starts, relative to the actual position (-1 means the last character read).

The MOD95 type checksum is computed following the formula:

mod95.gif