diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-02-26 16:43:45 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-02-26 16:43:45 -0500 |
commit | 41a911788fee388d4df527d1751ba9def19f9413 (patch) | |
tree | 5cbd4270d6d9802d47a15051c8a47c02e66ca245 | |
parent | ac5c1d2843922db85dd56ec51fce6794dac025bb (diff) | |
download | gpsd-41a911788fee388d4df527d1751ba9def19f9413.tar.gz |
Make the length of ISGPS packets accessible.
-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; } |