SRD Standelone programmation box: checksum.h File Reference

| SRD Standelone programmation box 2.0 (16/11/15 10:00:00) Documentation of the SRD standelone programmation box

- Main Page
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Enumerations Enumerator Macros Pages
checksum.h File Reference

Headerfile for checksum computation. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions

unsigned char | ChecksumByteCompute (unsigned char *data, unsigned long dataLength)
| Compute and return a checksum on the right data type. More...
unsigned short | ChecksumShortCompute (unsigned short *data, unsigned long dataLength)
| Compute and return a checksum on the right data type. More...
unsigned long | ChecksumLongCompute (unsigned long *data, unsigned long dataLength)
| Compute and return a checksum on the right data type. More...
unsigned short | ChecksumByteOnShortCompute (unsigned char *data, unsigned long dataLength)
| Compute and return a checksum on the right data type. More...

## Detailed Description

Headerfile for checksum computation.

Author
  Thibaut LALUQUE 3D-Ouest

Date
  24/11/2014

Version
  1.0

All Right Reserved.

Definition in file checksum.h.

## Function Documentation

unsigned char ChecksumByteCompute | ( | unsigned char * | data,
|  | unsigned long | dataLength
| ) |  |

Compute and return a checksum on the right data type.

Definition at line 78 of file checksum.c.

Referenced by MemoryManagerCheckDiving(), MemoryManagerCheckSerial(), MemoryManagerWriteDiving(), and MemoryManagerWriteSerial().

78 {
79 unsigned long i;
80 unsigned long acc = 0;
81
82 for(i=0 ; i<dataLength ; i++) {
83 acc += data[i];
84 }
85
86 return (unsigned char)(acc & 0x000000FF);
87 }

Here is the caller graph for this function:

unsigned short ChecksumByteOnShortCompute | ( | unsigned char * | data,
|  | unsigned long | dataLength
| ) |  |

Compute and return a checksum on the right data type.

Definition at line 111 of file checksum.c.

Referenced by MemoryManagerReadLog(), MemoryManagerWriteLog(), and RFIDWriteStateMachine().

111 {
112 unsigned long i;
113 unsigned long acc = 0;
114
115 for(i=0 ; i<dataLength ; i++) {
116 acc += data[i];
117 }
118
119 return (unsigned short)(acc & 0x0000FFFF);
120 }

Here is the caller graph for this function:

unsigned long ChecksumLongCompute | ( | unsigned long * | data,
|  | unsigned long | dataLength
| ) |  |

Compute and return a checksum on the right data type.

Definition at line 100 of file checksum.c.

100 {
101 unsigned long i;
102 unsigned long acc = 0;
103
104 for(i=0 ; i<dataLength ; i++) {
105 acc += data[i];
106 }
107
108 return (unsigned long)(acc);
109 }

unsigned short ChecksumShortCompute | ( | unsigned short * | data,
|  | unsigned long | dataLength
| ) |  |

Compute and return a checksum on the right data type.

Definition at line 89 of file checksum.c.

89 {
90 unsigned long i;
91 unsigned long acc = 0;
92
93 for(i=0 ; i<dataLength ; i++) {
94 acc += data[i];
95 }
96
97 return (unsigned short)(acc & 0x0000FFFF);
98 }