Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Examples

Cyclic Redundancy Check 16 (CRC16) calculcation
[Libraries]


Detailed Description

The Cyclic Redundancy Check 16 is a hash function that produces a checksum that is used to detect errors in transmissions.

The CRC16 calculation module is an iterative CRC calculator that can be used to cummulatively update a CRC checksum for every incoming byte.


Files

file  crc16.h
 Header file for the CRC16 calculcation.
file  crc16.c
 Implementation of the CRC16 calculcation.

Functions

unsigned short crc16_add (unsigned char b, unsigned short crc)
 Update an accumulated CRC16 checksum with one byte.


Function Documentation

unsigned short crc16_add unsigned char  b,
unsigned short  crc
 

Update an accumulated CRC16 checksum with one byte.

Parameters:
b The byte to be added to the checksum
crc The accumulated CRC that is to be updated.
Returns:
The updated CRC checksum.
This function updates an accumulated CRC16 checksum with one byte. It can be used as a running checksum, or to checksum an entire data block.

Note:
The algorithm used in this implementation is tailored for a running checksum and does not perform as well as a table-driven algorithm when checksumming an entire data block.

Definition at line 48 of file crc16.c.

Referenced by PT_THREAD().


Generated on Thu Jun 22 17:45:43 2006 for Contiki 2.x by  doxygen 1.4.4