summaryrefslogtreecommitdiff
path: root/driver_proto.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-10-02 15:56:08 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-10-02 15:56:08 +0000
commita0023da1ea2b268830d981de3b3b5b2cf6058612 (patch)
tree6a3334a9b6f72643f6d60facd416d7dd17196b16 /driver_proto.c
parent34574031fb921a546325b5339c917d64ae6c58f8 (diff)
downloadgpsd-a0023da1ea2b268830d981de3b3b5b2cf6058612.tar.gz
The new instrumentation pays off.
On NMEA devices, mode could sometimes be held across cycles when it shouldn't have been. Fix this, simplifying how cycles are tracked in the process. Some regression tests needed rebuilding. Code splints clean.
Diffstat (limited to 'driver_proto.c')
-rw-r--r--driver_proto.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/driver_proto.c b/driver_proto.c
index f82683e7..14fd40af 100644
--- a/driver_proto.c
+++ b/driver_proto.c
@@ -113,12 +113,11 @@ _proto__msg_navsol(struct gps_device_t *session, unsigned char *buf, size_t data
session->gpsdata.status = GET_FIX_STATUS();
/*
- * Set cycle_state to the value cycle_start to clue the daemon
- * in about when to clear fix information. Set it to cycle_end
- * when the sentence is reliably the last in a reporting cycle.
+ * Mix in CLEAE_SET to clue the daemon in about when to clear fix
+ * information. Mix in REPORT_SET when the sentence is reliably
+ * the last in a reporting cycle.
*/
- session->cycle_state = STATE;
- mask |= MODE_SET | STATUS_SET;
+ mask |= MODE_SET | STATUS_SET | REPORT_SET;
/*
* At the end of each packet-cracking function, report at LOG_DATA level
@@ -225,7 +224,7 @@ _proto__msg_svinfo(struct gps_device_t *session, unsigned char *buf, size_t data
gps_mask_t _proto__dispatch(struct gps_device_t *session, unsigned char *buf, size_t len)
{
size_t i;
- int type, used, visible;
+ int type, used, visible, retmask = 0;
if (len == 0)
return 0;
@@ -237,9 +236,9 @@ gps_mask_t _proto__dispatch(struct gps_device_t *session, unsigned char *buf, si
*/
session->cycle_end_reliable = true;
if (msgid == MY_START_OF_CYCLE)
- session->cycle_state |= CYCLE_START;
+ retmask |= CLEAR_SET;
else if (msgid == MY_END_OF_CYCLE)
- session->cycle_state |= CYCLE_END;
+ retmask |= REPORT_SET;
type = GET_MESSAGE_TYPE();