checksum.cpp
Go to the documentation of this file.
1 
25 #include "nmea_comms/checksum.h"
26 #include <stdio.h>
27 
28 void compute_checksum(const char* sentence_body, char checksum_out[2])
29 {
30  char checksum = 0;
31  while (*sentence_body)
32  {
33  checksum ^= *sentence_body;
34  sentence_body++;
35  }
36  sprintf(checksum_out, "%2X", checksum);
37 }
void compute_checksum(const char *sentence_body, char checksum_out[2])
Definition: checksum.cpp:28


nmea_comms
Author(s): Mike Purvis
autogenerated on Mon Aug 5 2019 03:53:18