summaryrefslogtreecommitdiff
path: root/driver_proto.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-01-17 16:32:25 -0500
committerEric S. Raymond <esr@thyrsus.com>2011-01-17 16:32:25 -0500
commitc32db7e0c77353ad1e27e2c2e1c3af01cbdf90b3 (patch)
tree62c109cbd8506564a36f8f9e4eadd5732c5d4b46 /driver_proto.c
parentd9548e92a23d00e6de35be3e10a4f29058005e88 (diff)
downloadgpsd-c32db7e0c77353ad1e27e2c2e1c3af01cbdf90b3.tar.gz
Refactor time resolution. All regression tests pass.
Diffstat (limited to 'driver_proto.c')
-rw-r--r--driver_proto.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/driver_proto.c b/driver_proto.c
index f7cbec86..716294e2 100644
--- a/driver_proto.c
+++ b/driver_proto.c
@@ -151,15 +151,8 @@ _proto__msg_utctime(struct gps_device_t *session, unsigned char *buf, size_t dat
tow = GET_MS_TIMEOFWEEK();
gps_week = GET_WEEKNUMBER();
- session->context->gps_week = gps_week;
session->context->leap_seconds = GET_GPS_LEAPSECONDS();
- session->context->gps_tow = tow / 1000.0;
- session->context->valid |= GPS_TIME_VALID
-
- t = gpstime_to_unix(gps_week, session->context->gps_tow)
- - session->context->leap_seconds;
- session->newdata.time = t;
- gpsd_rollover_check(session, session->newdata.time);
+ session->newdata.time = gpsd_resolve_time(session, gps_week, tow / 1000.0);
return TIME_IS | ONLINE_IS;
}