Skip to content

Commit

Permalink
ts2phc: Reset parser after RMC message.
Browse files Browse the repository at this point in the history
When the receiver was configured to generate only RMC messages, every
other message was skipped due to the parser not being in the right
state to process another message. Reset the parser to correctly parse
every valid message.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
  • Loading branch information
mlichvar authored and richardcochran committed Jul 30, 2024
1 parent d3f16da commit e110cd9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions nmea.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ int nmea_parse(struct nmea_parser *np, const char *ptr, int buflen,
while (buflen) {
if (!nmea_parse_symbol(np, *ptr)) {
if (!nmea_scan_rmc(np, result)) {
nmea_reset(np);
*parsed = count + 1;
return 0;
}
Expand Down

0 comments on commit e110cd9

Please sign in to comment.