summaryrefslogtreecommitdiff
path: root/libgpsd_core.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-09-22 01:32:07 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-09-22 01:32:07 -0400
commit8bc89f362ad7ce69f0960ebab60be52f3c53b5db (patch)
treec58740642200ee222bd6091858f0d0aef9c46b3e /libgpsd_core.c
parent631d6e6eddfe566b801e4440e5254cc4f80bab8d (diff)
downloadgpsd-8bc89f362ad7ce69f0960ebab60be52f3c53b5db.tar.gz
Prfile numbers now include a per-cycle chracter count.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r--libgpsd_core.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c
index a482ea75..210acb11 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -145,6 +145,7 @@ void gpsd_init(struct gps_device_t *session, struct gps_context_t *context,
session->gpsdata.dev.cycle = session->gpsdata.dev.mincycle = 1;
#ifdef TIMING_ENABLE
session->gpsdata.cycle_start = 0;
+ session->gpsdata.cycle_count = 0;
#endif /* TIMING_ENABLE */
/* tty-level initialization */
@@ -869,6 +870,7 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
}
}
session->packet.start_time = now;
+ session->packet.start_char = session->packet.char_counter;
}
#endif /* TIMING_ENABLE */
@@ -1000,6 +1002,13 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
&& session->device_type->parse_packet != NULL)
received |= session->device_type->parse_packet(session);
+#ifdef TIMING_ENABLE
+ /* are we going to generate a report? if so, count characters */
+ if ((received & REPORT_IS) != 0)
+ session->gpsdata.cycle_count = session->packet.char_counter - session->gpsdata.cycle_count;
+#endif /* TIMING_ENABLE */
+
+
session->gpsdata.set = ONLINE_SET | received;
#ifdef CHEAPFLOATS_ENABLE