Checksum Class Reference

#include <RobotAPI/drivers/WeissHapticSensor/Checksum.h>

Static Public Member Functions

static unsigned short Crc16 (unsigned char *data, unsigned int size)
 Calculates the CRC16 checksum of an array by using a table. More...
 
static unsigned short Update_crc16 (unsigned char *data, unsigned int size, unsigned short crc)
 Calculates the CRC16 checksum of an array by using a table. More...
 

Detailed Description

Definition at line 26 of file Checksum.h.

Member Function Documentation

◆ Crc16()

unsigned short Crc16 ( unsigned char *  data,
unsigned int  size 
)
static

Calculates the CRC16 checksum of an array by using a table.

The crc16 polynomial is 0x1021 ( x^16 + x^12 + x^5 + 1 ). This function takes 0xffff as initial value.

Note: The checksum generated by this function is NOT according to CCITT standard!

Parameters
*dataPoints to the byte array from which checksum should be calculated
sizeSize of the byte array
Returns
CRC16 checksum

Definition at line 115 of file Checksum.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Update_crc16()

unsigned short Update_crc16 ( unsigned char *  data,
unsigned int  size,
unsigned short  crc 
)
static

Calculates the CRC16 checksum of an array by using a table.

The crc16 polynomial is 0x1021 ( x^16 + x^12 + x^5 + 1 ).

Note: The checksum generated by this function is NOT according to CCITT standard!

Parameters
*dataPoints to the byte array from which checksum should be calculated
sizeSize of the byte array
crcValue calculated over another array and start value of the crc16 calculation
Returns
CRC16 checksum

Definition at line 86 of file Checksum.cpp.

+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: