UH Robotics / PololuQik2

Dependents:   theRobot3

Fork of PololuQik2 by Thomas Ashworth

Embed: (wiki syntax)

« Back to documentation index

CRC7 Class Reference

CRC7 Class Reference

This is a CRC7 implementation for checking validity of messages. More...

#include <CRC7.h>

Public Member Functions

 CRC7 ()
 Default constructor.
unsigned char CRC (unsigned char message[], unsigned int length)
 this method will generate the CRC7 checksum for the supplied message.

Detailed Description

This is a CRC7 implementation for checking validity of messages.

It will compute a checksum which can be used to determine if a message has been recieved unaltered. This is used particularly over wireless tranmission or noisy serial lines.

This implements a stored CRC table. This will taken up 256 bytes of RAM when the object is instantiated. The reason for using a stored CRC table is speed. This is a compromise between speed and storage spaces.

This could possibly be static object.

Definition at line 27 of file CRC7.h.


Constructor & Destructor Documentation

CRC7 (  )

Default constructor.

This method sets up the CRC table with pre-hashed values.

Definition at line 12 of file CRC7.cpp.


Member Function Documentation

unsigned char CRC ( unsigned char  message[],
unsigned int  length 
)

this method will generate the CRC7 checksum for the supplied message.

It will be returned from this method.

Parameters:
message[]the message to be hashed.
lengththe length of the message to be hashed in characters.
Returns:
the checksum computed.

Definition at line 29 of file CRC7.cpp.