![]() |
Demo HCI Implementation for WiMOD-LR Devices
V1.3.1
|
CRC16 Implementation for WiMOD HCI interface. More...
#include "CRC16.h"
Functions | |
UINT16 | CRC16_Calc (UINT8 *data, UINT16 length, UINT16 initVal) |
calculate CRC16 More... | |
bool | CRC16_Check (UINT8 *data, UINT16 length, UINT16 initVal) |
calculate & test CRC16 More... | |
CRC16 Implementation for WiMOD HCI interface.
Implementation of 16-BIT CRC CCITT
UINT16 CRC16_Calc | ( | UINT8 * | data, |
UINT16 | length, | ||
UINT16 | initVal | ||
) |
calculate CRC16
Calc CRC16.
This function calculates the one's complement of the standard 16-BIT CRC CCITT polynomial G(x) = 1 + x^5 + x^12 + x^16
[in] | data | pointer to data block |
[in] | length | number of bytes |
[in] | initVal | CRC16 initial value |
crc16 | crc |
bool CRC16_Check | ( | UINT8 * | data, |
UINT16 | length, | ||
UINT16 | initVal | ||
) |
calculate & test CRC16
Calc & Check CRC16.
This function checks a data block with attached CRC16
[in] | data | pointer to data block |
[in] | length | number of bytes (including CRC16) |
[in] | initVal | CRC16 initial value |
true | CRC16 ok -> data block ok |
false | CRC16 failed -> data block corrupt |