Last change
on this file since 89 was 89, checked in by morasjul, 11 years ago |
PACPUS 2.0 Beta deployed in new branch
Major changes:
-Add communication interface between components
-Add examples for communications interface (TestComponents)
-Move to Qt5 support
|
-
Property svn:executable
set to
*
|
File size:
442 bytes
|
Line | |
---|
1 | #include "nmea0183.h"
|
---|
2 |
|
---|
3 | unsigned char ComputeChecksum( const QString &line_to_parse )
|
---|
4 | {
|
---|
5 | unsigned char checksum_value = 0;
|
---|
6 |
|
---|
7 | int string_length = line_to_parse.length();
|
---|
8 | int index = 1; // Skip over the $ at the begining of the sentence
|
---|
9 |
|
---|
10 | while( index < string_length && line_to_parse[ index ] != '*' )
|
---|
11 | {
|
---|
12 | checksum_value ^= line_to_parse[ index ].toLatin1();
|
---|
13 | index++;
|
---|
14 | }
|
---|
15 |
|
---|
16 | return( checksum_value );
|
---|
17 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.