65
For the calculation of the checksum, u-blox utilizes the low-overhead checksum
algorithm, which is the TCP standard (RFC 1145). The calculation of the checksum
covers the range from the CLASS ID byte (included) to DATA bytes (included). It can
be described as
CK_A=0;
CK_B=0;
for(i = 0;i < N;i ++)
{
CK_A += buffer[i];
CK_B += CK_A;
}
where
CK_A and CK_B: 8-bit unsigned integers;
buffer[
•
]: vector that contains the data in the calculating range (i.e. from CLASS
ID to DATA);
N: number of bytes that contains the desired data.
The two checksums have to be masked with 0xFF after the operations in the loop, if
large-sized integer values are executed.
7.2.1 Data Format
Table 7.1 describes the types of data that are used in the module. On the basis of
IEEE754 single/double precision, the floating-point values are defined.
Acronym Date
Type Size
(bytes)
Range Resolution
Note
U1
Unsigned Char
1
0 ~ 255
1
I1
Signed Char
1
-128 ~ 127
1
2’s
complement
U2
Unsigned Short
2
0 ~ 65535
1
I2
Signed Short
2
-32768 ~ 32767 1
2’s
complement
U4
Unsigned Long
4
0 ~ 4294967295 1
I4 Signed
Long
4
-2147483648
~
2147483647
1 2’s
complement
R4 IEEE754
Single
Precision
4 -1*2
127
~ 2
127
~Value*2
-24