diff options
-rw-r--r-- | gpsd.h-tail | 7 | ||||
-rw-r--r-- | isgps.c | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gpsd.h-tail b/gpsd.h-tail index 05a322a2..7431f109 100644 --- a/gpsd.h-tail +++ b/gpsd.h-tail @@ -129,8 +129,13 @@ struct gps_packet_t { bool locked; int curr_offset; isgps30bits_t curr_word; - isgps30bits_t buf[RTCM2_WORDS_MAX]; unsigned int bufindex; + /* + * Only these sgould be referenced from elsewhere, and only when + * RTCM_MESSAGE has just been returned. + */ + isgps30bits_t buf[RTCM2_WORDS_MAX]; /* packet data */ + unsigned int buflen; /* packet length in bytes */ } isgps; }; @@ -171,6 +171,7 @@ void isgps_init( /*@out@*/ struct gps_packet_t *session) session->isgps.curr_offset = 24; /* first word */ session->isgps.locked = false; session->isgps.bufindex = 0; + session->isgps.buflen = 0; } /*@ -usereleased -compdef @*/ @@ -278,6 +279,7 @@ enum isgpsstat_t isgps_decode(struct gps_packet_t *session, if (length_check(session)) { /* jackpot, we have a complete packet */ + session->isgps.buflen = session->isgps.bufindex * sizeof(isgps30bits_t); session->isgps.bufindex = 0; res = ISGPS_MESSAGE; } |