summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-11-17 07:35:45 -0500
committerEric S. Raymond <esr@thyrsus.com>2013-11-17 07:35:45 -0500
commit881be972b47712a69a8b433652fe407717c09331 (patch)
treeb8b75c5fceb5790952260953ef2764f44cb67087
parentcc4406a8a545e5adce0561feaa9cce63bfdb0cea (diff)
downloadgpsd-881be972b47712a69a8b433652fe407717c09331.tar.gz
PPS JSON messages are now visible in client-mode JSON.
-rw-r--r--packet.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/packet.c b/packet.c
index 13694965..363b8e55 100644
--- a/packet.c
+++ b/packet.c
@@ -504,6 +504,7 @@ static void nextstate(struct gps_packet_t *lexer, unsigned char c)
lexer->state = GROUND_STATE;
break;
case NMEA_RECOGNIZED:
+ /* FIXME: shouldn't all end-of-NMEA cases collapse into a pushback? */
if (c == '#')
lexer->state = COMMENT_BODY;
else if (c == '$')
@@ -1053,13 +1054,17 @@ static void nextstate(struct gps_packet_t *lexer, unsigned char c)
lexer->state = UBX_RECOGNIZED;
break;
case UBX_RECOGNIZED:
+ /* FIXME: shouldn't all end-of-UBX cases collapse into a pushback? */
if (c == 0xb5)
lexer->state = UBX_LEADER_1;
#ifdef NMEA_ENABLE
else if (c == '$') /* LEA-5H can and will output NMEA and UBX back to back */
lexer->state = NMEA_DOLLAR;
#endif /* NMEA_ENABLE */
- else
+ else if (c == '{') {
+ lexer->state = JSON_LEADER;
+ character_pushback(lexer);
+ } else
lexer->state = GROUND_STATE;
break;
#endif /* UBLOX_ENABLE */