MCRF4XX

fun MCRF4XX(data: ByteArray, offset: Int, length: Int): Int

Calculates CRC MCRF4XX over given range of bytes from the block of data. It is using the 0x1021 polynomial and 0xFFFF initial value.

This method is used in Bluetooth LE CGMS service E2E-CRC calculation.

See: http://reveng.sourceforge.net/crc-catalogue/16.htm#crc.cat.crc-16-mcrf4xx

See: http://ww1.microchip.com/downloads/en/AppNotes/00752a.pdf

See: https://www.bluetooth.com/specifications/gatt -> CGMS (1.0.1)

Return

the CRC-16 MCRF4XX.

Parameters

data

The input data block for computation.

offset

Offset from where the range starts.

length

Length of the range in bytes.