diff options
author | Gary E. Miller <gem@rellim.com> | 2018-11-05 20:43:04 -0800 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2018-11-05 20:43:04 -0800 |
commit | 45022c255525421efa6db34859fe4a6e70671c24 (patch) | |
tree | 482ed2c5473b35f7129868cfcf891b7ad721ac20 /driver_ubx.c | |
parent | e5fdf82ff4767d09d5b9472131c0426ac06c8674 (diff) | |
download | gpsd-45022c255525421efa6db34859fe4a6e70671c24.tar.gz |
rawdata: change mtime from UTC to GPS.
Oddly, gpsd clients to not know the current leap seconds.
Diffstat (limited to 'driver_ubx.c')
-rw-r--r-- | driver_ubx.c | 6 |
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 */ |