eabdullin
2eb5cc6b3f
- ts2phc: Don't switch system clock to nanosecond mode. - nmea: Fix conversion of leap second. - ts2phc: Reset parser after RMC message.
26 lines
829 B
Diff
26 lines
829 B
Diff
commit b4ad9dccf23cef2d79621cd36987428a65f2bcc9
|
|
Author: Miroslav Lichvar <mlichvar@redhat.com>
|
|
Date: Tue Jun 11 12:35:10 2024 +0200
|
|
|
|
ts2phc: Reset parser after RMC message.
|
|
|
|
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>
|
|
|
|
diff --git a/nmea.c b/nmea.c
|
|
index 44c7c01..7f1d9a2 100644
|
|
--- a/nmea.c
|
|
+++ b/nmea.c
|
|
@@ -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;
|
|
}
|