Go to the documentation of this file.
98 crc_table = _crc_table;
99 initial_value = _initial_value;
100 current_crc = initial_value;
106 current_crc = ( (current_crc & 0xFF00) >> 8 ) ^ crc_table[ ( current_crc & 0x00FF ) ^ (
byte & 0x00FF)];
113 for (
int i=0; i<nb_bytes; i++ )
114 current_crc = ( (current_crc & 0xFF00) >> 8 ) ^ crc_table[ ( current_crc & 0x00FF ) ^ (bytes[i] & 0x00FF)];
127 return current_crc & 0x00ff;
133 return (current_crc >> 8) & 0x00ff;
139 current_crc = initial_value;
156 :
cCRC( crc_table_dsacon32m, 0xffff )
cCRC(tCRCValue const *_crc_table, tCRCValue _initial_value)
constructor: create a new cCRC object and initialize the current value of the CRC checksum....
tCRCValue const * crc_table
table with precalculated CRC values
tCRCValue AddByte(unsigned char byte)
insert byte into CRC calculation and return the new current CRC checksum
#define NAMESPACE_SDH_END
tCRCValue current_crc
current value of the CRC checksum
tCRCValue GetCRC()
return the current CRC value
cCRC_DSACON32m(void)
constructor to create a cCRC object suitable for checksumming the communication with a DSACON32m tact...
uint8_t UInt8
unsigned integer, size 1 Byte (8 Bit)
NAMESPACE_SDH_START typedef UInt16 tCRCValue
the data type used to calculate and exchange CRC values with DSACON32m (16 bit integer)
uint16_t UInt16
unsigned integer, size 2 Byte (16 Bit)
cCRC_SDH(void)
constructor to create a cCRC object suitable for checksumming the binary communication with SDH
Cyclic Redundancy Code checker class, used for protecting communication against transmission errors.
UInt8 GetCRC_LB()
return the low byte of the current CRC value
tCRCValue AddBytes(unsigned char *bytes, int nb_bytes)
insert nb_bytes from bytes into CRC calculation and return the new current CRC checksum
A derived CRC class that uses a CRC table and initial value suitable for protecing the binary communi...
#define NAMESPACE_SDH_START
tCRCValue initial_value
initial value of the CRC checksum
This file contains some basic definitions (defines, macros, datatypes)
This file contains settings to make the SDHLibrary compile on differen systems:
UInt8 GetCRC_HB()
return the high byte of the current CRC value
tCRCValue Reset()
reset the current CRC value to its initial value and return it;
A derived CRC class that uses a CRC table and initial value suitable for the Weiss Robotics DSACON32m...
sdhlibrary_cpp
Author(s): Dirk Osswald
autogenerated on Wed Mar 2 2022 01:00:58