From 45022c255525421efa6db34859fe4a6e70671c24 Mon Sep 17 00:00:00 2001 From: "Gary E. Miller" Date: Mon, 5 Nov 2018 20:43:04 -0800 Subject: rawdata: change mtime from UTC to GPS. Oddly, gpsd clients to not know the current leap seconds. --- driver_ubx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'driver_ubx.c') diff --git a/driver_ubx.c b/driver_ubx.c index d1199455..ff63c981 100644 --- a/driver_ubx.c +++ b/driver_ubx.c @@ -838,11 +838,13 @@ static gps_mask_t ubx_rxm_rawx(struct gps_device_t *session, session->context->leap_seconds = -leapS; session->context->valid |= LEAP_SECOND_VALID; } - /* covert GPS weeks and TOW to UTC */ + /* convert GPS weeks and TOW to UTC */ session->newdata.time = gpsd_gpstime_resolve(session, week, rcvTow); + /* get mtime in GPS time, not UTC */ session->gpsdata.raw.mtime.tv_nsec = modf(session->newdata.time, &t_intp) * 10e8; - session->gpsdata.raw.mtime.tv_sec = (time_t)t_intp; + /* u-blox says to add in leapS, valid or not */ + session->gpsdata.raw.mtime.tv_sec = (time_t)t_intp + leapS; /* zero the measurement data */ /* so we can tell which meas never got set */ -- cgit v1.2.1