Public Member Functions | Protected Attributes | List of all members
cCRC Class Reference

Cyclic Redundancy Code checker class, used for protecting communication against transmission errors. More...

#include <crc.h>

Inheritance diagram for cCRC:
Inheritance graph
[legend]

Public Member Functions

tCRCValue AddByte (unsigned char byte)
 insert byte into CRC calculation and return the new current CRC checksum More...
 
tCRCValue AddBytes (unsigned char *bytes, int nb_bytes)
 insert nb_bytes from bytes into CRC calculation and return the new current CRC checksum More...
 
 cCRC (tCRCValue const *_crc_table, tCRCValue _initial_value)
 constructor: create a new cCRC object and initialize the current value of the CRC checksum. crc_table is the CRC table to use. More...
 
tCRCValue GetCRC ()
 return the current CRC value More...
 
UInt8 GetCRC_HB ()
 return the high byte of the current CRC value More...
 
UInt8 GetCRC_LB ()
 return the low byte of the current CRC value More...
 
tCRCValue Reset ()
 reset the current CRC value to its initial value and return it; More...
 

Protected Attributes

tCRCValue const * crc_table
 table with precalculated CRC values More...
 
tCRCValue current_crc
 current value of the CRC checksum More...
 
tCRCValue initial_value
 initial value of the CRC checksum More...
 

Detailed Description

Cyclic Redundancy Code checker class, used for protecting communication against transmission errors.

Generic class to calculate a CRC using a given, precalculated table.

Use derived classes like cCRC_DSACON32m with a specifically set CRC table.

Definition at line 82 of file crc.h.

Constructor & Destructor Documentation

◆ cCRC()

cCRC::cCRC ( tCRCValue const *  _crc_table,
tCRCValue  _initial_value 
)
inline

constructor: create a new cCRC object and initialize the current value of the CRC checksum. crc_table is the CRC table to use.

Definition at line 96 of file crc.h.

Member Function Documentation

◆ AddByte()

tCRCValue cCRC::AddByte ( unsigned char  byte)
inline

insert byte into CRC calculation and return the new current CRC checksum

Definition at line 104 of file crc.h.

◆ AddBytes()

tCRCValue cCRC::AddBytes ( unsigned char *  bytes,
int  nb_bytes 
)
inline

insert nb_bytes from bytes into CRC calculation and return the new current CRC checksum

Definition at line 111 of file crc.h.

◆ GetCRC()

tCRCValue cCRC::GetCRC ( )
inline

return the current CRC value

Definition at line 119 of file crc.h.

◆ GetCRC_HB()

UInt8 cCRC::GetCRC_HB ( )
inline

return the high byte of the current CRC value

Definition at line 131 of file crc.h.

◆ GetCRC_LB()

UInt8 cCRC::GetCRC_LB ( )
inline

return the low byte of the current CRC value

Definition at line 125 of file crc.h.

◆ Reset()

tCRCValue cCRC::Reset ( )
inline

reset the current CRC value to its initial value and return it;

Definition at line 137 of file crc.h.

Member Data Documentation

◆ crc_table

tCRCValue const* cCRC::crc_table
protected

table with precalculated CRC values

Definition at line 92 of file crc.h.

◆ current_crc

tCRCValue cCRC::current_crc
protected

current value of the CRC checksum

Definition at line 86 of file crc.h.

◆ initial_value

tCRCValue cCRC::initial_value
protected

initial value of the CRC checksum

Definition at line 89 of file crc.h.


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


sdhlibrary_cpp
Author(s): Dirk Osswald
autogenerated on Wed Mar 2 2022 01:00:59