Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_Crc16.h File Reference
#include <cstdint>
Include dependency graph for cs_Crc16.h:

Go to the source code of this file.

Functions

uint16_t crc16 (const uint8_t *data, uint16_t size, uint16_t *prevCrc=nullptr)
 Calculates or updates the CRC-16-CCITT based on given data. More...
 

Function Documentation

◆ crc16()

uint16_t crc16 ( const uint8_t *  data,
uint16_t  size,
uint16_t *  prevCrc = nullptr 
)

Calculates or updates the CRC-16-CCITT based on given data.

Parameters
[in]dataPointer to data.
[in]sizeSize of data.
[in]prevCrcPrevious CRC, or null pointer for first call.
Returns
Updated CRC of given data.