Skip to content

Commit

Permalink
Create Nmea0183Msg.h
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrouch authored Nov 6, 2024
1 parent 93d31ac commit 84c86e8
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions bbn_m5atomS3_lite_env/Nmea0183Msg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#ifndef Nmea0183Msg_h
#define Nmea0183Msg_h

/*
NMEA 0183 Messages
Example:
TXT - Text Transmission
For the transmission of short text messages, longer text messages may be transmitted by using multiple
sentences. Nmea0183Msg_h
$--TXT,x1,x2,x3,c--c*hh<CR><LF>
x1 Total number of sentences 1, 01 to 99
x2 Sentence sequence number, 01 to 99
x3 Text identifier
c--c Text message
$GPTXT,01,01,25,DR MODE - ANTENNA FAULT^21*38<CR><LF>
*/
#include "NmeaChecksum.h"

void gen_nmea0183_msg(const char *nmea_fmt, const char *value) {
char nmea_part[82];
snprintf(nmea_part, 76, nmea_fmt, value);
int checksum = nmea0183_checksum(nmea_part);
Serial.printf("%s*%02X\r\n", nmea_part, checksum);
}

#endif

0 comments on commit 84c86e8

Please sign in to comment.