GS3 Integrator Guide R34
For support contact us via email at support@decagon.com
or call us at 1.509.332.5600 between 7AM to 5PM PST
DDI-SERIAL CHECKSUM
Here is an example of how to calculate the checksum (crc) in C. In this case, the string passed to the
function would be: "<09>22.0 21.2 1302<0D>w" and the returning value would be the character ‘8’.
char CalculateChecksum(char * Response){
int length, sum = 0, i, crc;
// Finding the length of the response string
length = strlen(Response);
// Adding characters in the response together
for( i = 0; i < length; i++ )
sum += Response[i];
// Converting checksum to a printable character
crc = sum % 64 + 32;
return crc;
}