source: pacpussensors/trunk/NMEA0183/src/CHECKSUM.cpp@ 80

Last change on this file since 80 was 59, checked in by DHERBOMEZ Gérald, 10 years ago

Integration of new modules:

  • GPS NMEA0183 decoder
  • Span CPT Decoder

Update of:

File size: 442 bytes
Line 
1#include "nmea0183.h"
2
3unsigned 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.