summaryrefslogtreecommitdiff
path: root/gpsmon.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-03-08 07:32:37 -0400
committerEric S. Raymond <esr@thyrsus.com>2015-03-08 07:32:37 -0400
commit8b6c5dc9b114b18f2af6ec8865ed77b55b48269e (patch)
tree244ad8d3b0c8f8333f912098ddb8d0883843f33f /gpsmon.c
parent4157fc2c007f962d0e898e88b0fd3a89cea348ee (diff)
downloadgpsd-8b6c5dc9b114b18f2af6ec8865ed77b55b48269e.tar.gz
Decouple (mostly) the PPS thread-monitor from the session structure.
This is the big step towards ntplib. A couple of minor issues remain to be ironed out, the most significant of which is what to do about the timestamp_t type. This changes some field offsets of private fields in struct gps_device_t. Probably does not require a version bump as access to them is all through the libgpsd API. All regression tests pass. PPS observed live in gpsmon direct mode.
Diffstat (limited to 'gpsmon.c')
-rw-r--r--gpsmon.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gpsmon.c b/gpsmon.c
index fc8b733a..f27db3a6 100644
--- a/gpsmon.c
+++ b/gpsmon.c
@@ -249,7 +249,7 @@ void pps_update(WINDOW *win, int y, int x)
/*@-type -noeffect@*/ /* splint is confused about struct timespec */
struct timedelta_t ppstimes;
- if (pps_thread_lastpps(&session, &ppstimes) > 0) {
+ if (pps_thread_lastpps(&session.pps_thread, &ppstimes) > 0) {
/* NOTE: can not use double here due to precision requirements */
struct timespec timedelta;
(void)wmove(win, y, x);
@@ -1133,7 +1133,7 @@ static bool do_command(const char *line)
/*@+globstate +usedef +compdef@*/
#ifdef PPS_ENABLE
-static /*@observer@*/ char *pps_report(struct gps_device_t *session UNUSED,
+static /*@observer@*/ char *pps_report(volatile struct pps_thread_t *pps_thread UNUSED,
struct timedelta_t *td UNUSED) {
packet_log(PPSBAR);
return "gpsmon";
@@ -1319,7 +1319,7 @@ int main(int argc, char **argv)
/* this guard suppresses a warning on Bluetooth devices */
if (session.sourcetype == source_rs232 || session.sourcetype == source_usb) {
session.pps_thread.report_hook = pps_report;
- pps_thread_activate(&session);
+ pps_thread_activate(&session.pps_thread);
}
#endif /* PPS_ENABLE */
}
@@ -1450,7 +1450,7 @@ int main(int argc, char **argv)
#ifdef PPS_ENABLE
/* Shut down PPS monitoring. */
if (serial)
- (void)pps_thread_deactivate(&session);
+ (void)pps_thread_deactivate(&session.pps_thread);
#endif /* PPS_ENABLE*/
gpsd_close(&session);