Demo HCI Implementation for WiMOD-LR Devices  V1.3.1
CRC16.h File Reference

CRC16 Declarations. More...

#include <inttypes.h>
Include dependency graph for CRC16.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CRC16_INIT_VALUE   0xFFFF
 initial value for CRC algorithem
 
#define CRC16_GOOD_VALUE   0x0F47
 constant compare value for check
 
#define CRC16_POLYNOM   0x8408
 16-BIT CRC CCITT POLYNOM
 

Functions

UINT16 CRC16_Calc (UINT8 *data, UINT16 length, UINT16 initVal)
 Calc CRC16. More...
 
bool CRC16_Check (UINT8 *data, UINT16 length, UINT16 initVal)
 Calc & Check CRC16. More...
 

Detailed Description

CRC16 Declarations.

Version
0.2

Declarations for 16-BIT CRC CCITT calculation

Author
(KvW), IMST

Function Documentation

UINT16 CRC16_Calc ( UINT8 *  data,
UINT16  length,
UINT16  initVal 
)

Calc 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

Parameters
[in]datapointer to data block
[in]lengthnumber of bytes
[in]initValCRC16 initial value
Return values
crc16crc

Here is the call graph for this function:

bool CRC16_Check ( UINT8 *  data,
UINT16  length,
UINT16  initVal 
)

Calc & Check CRC16.

Calc & Check CRC16.

This function checks a data block with attached CRC16

Parameters
[in]datapointer to data block
[in]lengthnumber of bytes (including CRC16)
[in]initValCRC16 initial value
Return values
trueCRC16 ok -> data block ok
falseCRC16 failed -> data block corrupt

Here is the call graph for this function: