diff options
author | Gary E. Miller <gem@rellim.com> | 2019-04-05 17:30:44 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2019-04-05 17:30:44 -0700 |
commit | 1047ab92040746ab9597ffcf57a2ced4aaffc07f (patch) | |
tree | cc742eef14a49cd8d86f5c3dc939fd56737ae810 | |
parent | 05f38c3d68c5b61efd78086e8fe0bc6dd15fe793 (diff) | |
download | gpsd-1047ab92040746ab9597ffcf57a2ced4aaffc07f.tar.gz |
gps.h: Add qErr to gps_fix_t.
qErr, aka "sawtooth" correction, is the error in the PPS time.
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | driver_ubx.c | 6 | ||||
-rw-r--r-- | gps.h | 4 | ||||
-rw-r--r-- | gpsutils.c | 3 |
4 files changed, 13 insertions, 1 deletions
@@ -9,6 +9,7 @@ Improve cycle detection, mostly for NMEA. Move epe from gps_data_t to be near its friends in gps_fix_t. Preliminary u-blox 9 support. + Add qErr in gps_data_t to store PPS quantization error. 3.18.1: 2018-10-19 (Gary E. Miller <gem@rellim.com>) Fix some installation issues. diff --git a/driver_ubx.c b/driver_ubx.c index 932d2680..4d396086 100644 --- a/driver_ubx.c +++ b/driver_ubx.c @@ -1135,6 +1135,12 @@ ubx_msg_tim_tp(struct gps_device_t *session, unsigned char *buf, flags = buf[14]; refInfo = buf[15]; + /* are we UTC, and no RAIM? */ + if ((3 == (flags & 0x03)) && + (8 != (flags & 0x0c))) { + /* good, get qErr */ + session->newdata.qErr = qErr; + } /* cast for 32 bit compatibility */ gpsd_log(&session->context->errout, LOG_DATA, "TIM_TP: towMS %lu, towSubMS %lu, qErr %ld week %u\n" @@ -47,7 +47,7 @@ extern "C" { * Remove epe from gps_data_t, it duplicates gps_fix_t eph * Added sep (estimated spherical error, 3D) * Note: Some GPS call eph as epe, others call sep as epe - * Add gps_fix_t datum string + * Add gps_fix_t datum string, and qErr */ #define GPSD_API_MAJOR_VERSION 8 /* bump on incompatible changes */ #define GPSD_API_MINOR_VERSION 0 /* bump on compatible changes */ @@ -128,6 +128,8 @@ struct gps_fix_t { double vAcc; /* Velocity Accuracy Estimate, probably SEP */ } ecef; char datum[40]; /* map datum */ + /* quantization error adjustment to PPS. aka "sawtooth" correction */ + long qErr; /* offset in picoseconds (ps) */ }; /* @@ -370,6 +370,9 @@ void gps_merge_fix(struct gps_fix_t *to, if ('\0' != from->datum[0]) { strlcpy(to->datum, from->datum, sizeof(to->datum)); } + if (0 != from->qErr) { + to->qErr = from->qErr; + } } /* NOTE: timestamp_t is a double, so this is only precise to |