checksum.cpp
Go to the documentation of this file.
00001 
00025 #include "nmea_comms/checksum.h"
00026 #include <stdio.h>
00027 
00028 void compute_checksum(const char* sentence_body, char checksum_out[2])
00029 {
00030   char checksum = 0;
00031   while (*sentence_body)
00032   {
00033     checksum ^= *sentence_body;
00034     sentence_body++;
00035   }
00036   sprintf(checksum_out, "%2X", checksum);
00037 }


nmea_comms
Author(s): Mike Purvis
autogenerated on Thu Dec 22 2016 03:29:22