Decagon Devices GS3 Посібник - Сторінка 12
Переглянути онлайн або завантажити pdf Посібник для Аксесуари Decagon Devices GS3. Decagon Devices GS3 12 сторінок. Greenhouse sensor
GS3 Integrator Guide
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
char CalculateChecksum(char
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 %
return
crc;
}
21.2
1302<0D>w
* Response){
64
+ 32;
For support contact us via email at
or call us at 1.509.332.5600 between 7AM to 5PM PST
" and the returning value would be the character '
R34
'.
8
12