summaryrefslogtreecommitdiff
path: root/driver_ubx.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver_ubx.c')
-rw-r--r--driver_ubx.c6
1 files changed, 4 insertions, 2 deletions
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 */