Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

crc_8_16.h File Reference


Detailed Description

CRC calculation.

functions for CRC calculation

Id:
crc_8_16.h,v 1.3 2004/03/03 13:50:15 rbr Exp

Author: Monica Redon Segrera and Nuria Llombart Juan

Copyright: (C) 2003-2004 by Fraunhofer IIS-A, IT-Services, Erlangen

Created: 2001-01-02

Version: 2004-03-02

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <malloc.h>

Go to the source code of this file.

Functions

unsigned short CRC_Build_16 (const unsigned char *cDataPointer, const unsigned long iLength)
 calculate CRC-16

unsigned char CRC_Build_8 (const unsigned char *cDataPointer, const unsigned long iLength)
 calculate 8 bit CRC

char CRC_Check_16 (const unsigned char *cDataPointer, const unsigned long iLength, const unsigned short iCRC_16)
 check whether data matches CRC-16

char CRC_Check_8 (const unsigned char *cDataPointer, const unsigned long iLength, const unsigned char iCRC_8)
 check whether data matches CRC-8


Function Documentation

unsigned short CRC_Build_16 const unsigned char *    cDataPointer,
const unsigned long    iLength
 

calculate CRC-16

calculates the 16 bit CRC value of the provided data and returns it

CreationDate: 2001-02-02

Version: 2004-03-02

Parameters:
cDataPointer  pointer to the first data byte.
iLength  size of the data in bytes
Returns :
CRC-16 value

unsigned char CRC_Build_8 const unsigned char *    cDataPointer,
const unsigned long    iLength
 

calculate 8 bit CRC

calculates the 8 bit CRC value of the provided data and returns it

CreationDate: 2001-02-02

Version: 2004-03-02

Parameters:
cDataPointer  pointer to the first data byte.
iLength  size of the data in bytes
Returns :
unsigned char with the CRC-8 value

char CRC_Check_16 const unsigned char *    cDataPointer,
const unsigned long    iLength,
const unsigned short    iCRC_16
 

check whether data matches CRC-16

compares the 16 bit CRC value of the provided data to the provided 16 bit value

CreationDate: 2001-02-02

Version: 2004-03-02

Parameters:
cDataPointer  pointer to the first data byte.
iLength  size of the data in bytes
iCRC_16  received CRC-16 value
Return values:
1  There are no errors
0  The received CRC-16 is different to the CRC-16 calculated in the receiver.

char CRC_Check_8 const unsigned char *    cDataPointer,
const unsigned long    iLength,
const unsigned char    iCRC_8
 

check whether data matches CRC-8

compares the 8 bit CRC value of the provided data to the provided 8 bit value

CreationDate: 2001-02-02

Version: 2004-03-02

Parameters:
cDataPointer  pointer to the first data byte.
iLength  size of the data in bytes
iCRC_8  received CRC-8 value
Return values:
1  There are no errors
0  The received CRC-8 is different to the CRC-8 calculated in the receiver.


Generated on Thu Mar 18 13:10:33 2004 for journaline_demo by doxygen1.2.17