linuxptp/linuxptp-nmeareset.patch
2024-08-19 14:08:42 +02:00

27 lines
886 B
Diff

commit 293ca74b9df22a75951eea72426869a7ee9eb023
Author: Miroslav Lichvar <mlichvar@redhat.com>
Date: Tue Jun 11 16:17:36 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>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.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;
}