Programming Guide

CHUMP Reference Guide
74
Sample Checksum Generation Code
In order for an external device to communicate with a SAMSys
reader, a CHUMP command must be sent to the reader followed
by a checksum. The following code sample is a ā€œCā€ routine to
generate the checksum.
char compute_checksum(const char* pData, int nLen
{
char returnValue = 0;
for (int i=0; i<nLen; i++) {
returnValue += pData[i];
}
return returnValue;
}