Skip to content

Commit 86fc605

Browse files
committed
Add sempNmeaHashPreamble to support the UM980
1 parent 6c250c4 commit 86fc605

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/Parse_NMEA.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,17 @@ bool sempNmeaPreamble(SEMP_PARSE_STATE *parse, uint8_t data)
203203
return true;
204204
}
205205

206+
// Alternate NMEA parser with hash (#) as the preamble
207+
bool sempNmeaHashPreamble(SEMP_PARSE_STATE *parse, uint8_t data)
208+
{
209+
SEMP_SCRATCH_PAD *scratchPad = (SEMP_SCRATCH_PAD *)parse->scratchPad;
210+
if (data != '#')
211+
return false;
212+
scratchPad->nmea.messageNameLength = 0;
213+
parse->state = sempNmeaFindFirstComma;
214+
return true;
215+
}
216+
206217
// Translates state value into an string, returns nullptr if not found
207218
const char * sempNmeaGetStateName(const SEMP_PARSE_STATE *parse)
208219
{

src/SparkFun_Extensible_Message_Parser.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ void sempDisableErrorOutput(SEMP_PARSE_STATE *parse);
229229

230230
// NMEA parse routines
231231
bool sempNmeaPreamble(SEMP_PARSE_STATE *parse, uint8_t data);
232+
bool sempNmeaHashPreamble(SEMP_PARSE_STATE *parse, uint8_t data);
232233
bool sempNmeaFindFirstComma(SEMP_PARSE_STATE *parse, uint8_t data);
233234
const char * sempNmeaGetStateName(const SEMP_PARSE_STATE *parse);
234235

0 commit comments

Comments
 (0)