diff options
author | Ahti Heinla <ahti@ahti.bluemoon.ee> | 2015-01-08 14:34:54 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-01-08 14:34:54 -0500 |
commit | 2ab876371ec089b7529301beb0f424fe6196b81a (patch) | |
tree | 785df97859995145e112ac971d4cb59493c64a53 /packet.c | |
parent | f2cd74637bbe156a11acad627386154d67b89115 (diff) | |
download | gpsd-2ab876371ec089b7529301beb0f424fe6196b81a.tar.gz |
Fix RTCM2 detection in packet.c
Regression tests pass.
Author's notes:
RTCM2 support seems to be practically broken, if the stream
frequently includes the 0x40 byte. This byte causes packet.c to
temporarily think it is an AT1 stream, and stop calling rtcm2_decode()
while it thinks so.
I have an RTCM stream from station id 0, and this particular station ID
causes the 0x40 byte to appear in virtually every RTCM message, so for that
stream, I have to wait through hundreds of RTCM messages before it is
positively identified and RTCM decoding starts to work.
Patch attached, works for me.
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -224,6 +224,12 @@ static void nextstate(struct gps_lexer_t *lexer, unsigned char c) #endif /* NMEA_ENABLE */ #if defined(TNT_ENABLE) || defined(GARMINTXT_ENABLE) || defined(ONCORE_ENABLE) if (c == '@') { +#ifdef RTCM104V2_ENABLE + if (rtcm2_decode(lexer, c) == ISGPS_MESSAGE) { + lexer->state = RTCM2_RECOGNIZED; + break; + } +#endif /* RTCM104V2_ENABLE */ lexer->state = AT1_LEADER; break; } |