summaryrefslogtreecommitdiff
path: root/driver_ubx.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2015-03-19 10:06:53 -0700
committerGary E. Miller <gem@rellim.com>2015-03-19 10:06:53 -0700
commite42501774eb120d5b8c9f5bf97188c91b32383ad (patch)
treeece4933448be857ef422942370bfce9de26e5e34 /driver_ubx.c
parentf6f94c9fbd3f988e063409ba6a66c04d32cf95fc (diff)
downloadgpsd-e42501774eb120d5b8c9f5bf97188c91b32383ad.tar.gz
Remove some UBX-MON-PVT test code.
Eventually deprecated UBX-MON-SOL goes away and we must finish decoding UBX-MON-PVT. UBX-MON-PVT is not a superset of UBX-MON-SOL.
Diffstat (limited to 'driver_ubx.c')
-rw-r--r--driver_ubx.c83
1 files changed, 8 insertions, 75 deletions
diff --git a/driver_ubx.c b/driver_ubx.c
index 5922e48c..1815f1df 100644
--- a/driver_ubx.c
+++ b/driver_ubx.c
@@ -92,71 +92,9 @@ ubx_msg_nav_pvt(struct gps_device_t *session, unsigned char *buf,
flags = (unsigned int)getub(buf, 21);
-#if 0
- double epx, epy, epz, evx, evy, evz;
- unsigned char navmode;
-
- mask = 0;
- if ((flags & (UBX_SOL_VALID_WEEK | UBX_SOL_VALID_TIME)) != 0) {
- unsigned short gw;
- unsigned int tow;
- tow = (unsigned int)getleu32(buf, 0);
- gw = (unsigned short)getles16(buf, 8);
- session->newdata.time = gpsd_gpstime_resolve(session, gw, tow / 1000.0);
- mask |= TIME_SET | PPSTIME_IS;
- }
-
- epx = (double)(getles32(buf, 12) / 100.0);
- epy = (double)(getles32(buf, 16) / 100.0);
- epz = (double)(getles32(buf, 20) / 100.0);
- evx = (double)(getles32(buf, 28) / 100.0);
- evy = (double)(getles32(buf, 32) / 100.0);
- evz = (double)(getles32(buf, 36) / 100.0);
- ecef_to_wgs84fix(&session->newdata, &session->gpsdata.separation,
- epx, epy, epz, evx, evy, evz);
- mask |= LATLON_SET | ALTITUDE_SET | SPEED_SET | TRACK_SET | CLIMB_SET;
-
- if (session->driver.ubx.last_herr > 0.0) {
- session->newdata.epx = session->newdata.epy = session->driver.ubx.last_herr;
- mask |= HERR_SET;
- session->driver.ubx.last_herr = 0.0;
- }
-
- if (session->driver.ubx.last_verr > 0.0) {
- session->newdata.epv = session->driver.ubx.last_verr;
- mask |= VERR_SET;
- session->driver.ubx.last_verr = 0.0;
- }
-
- session->newdata.eps = (double)(getles32(buf, 40) / 100.0);
- mask |= SPEEDERR_SET;
-
- /* Better to have a single point of truth about DOPs */
- //session->gpsdata.dop.pdop = (double)(getleu16(buf, 44)/100.0);
- session->gpsdata.satellites_used = (int)getub(buf, 47);
-
- navmode = (unsigned char)getub(buf, 10);
- switch (navmode) {
- case UBX_MODE_TMONLY:
- case UBX_MODE_3D:
- session->newdata.mode = MODE_3D;
- break;
- case UBX_MODE_2D:
- case UBX_MODE_DR: /* consider this too as 2D */
- case UBX_MODE_GPSDR: /* FIX-ME: DR-aided GPS may be valid 3D */
- session->newdata.mode = MODE_2D;
- break;
- default:
- session->newdata.mode = MODE_NO_FIX;
- }
-
- if ((flags & UBX_SOL_FLAG_DGPS) != 0)
- session->gpsdata.status = STATUS_DGPS_FIX;
- else if (session->newdata.mode != MODE_NO_FIX)
- session->gpsdata.status = STATUS_FIX;
-
- mask |= MODE_SET | STATUS_SET;
-# endif
+ /* TODO: finish decoding UBX_MON_PVT
+ * no need until depreacaed UBX_MON_SOL is dead
+ */
gpsd_log(&session->context->errout, LOG_DATA,
"NAV-PVT: flags:%02x\n", flags);
return mask;
@@ -499,9 +437,7 @@ gps_mask_t ubx_parse(struct gps_device_t * session, unsigned char *buf,
break;
case UBX_NAV_PVT:
gpsd_log(&session->context->errout, LOG_PROG, "UBX_NAV_PVT\n");
- mask =
- ubx_msg_nav_pvt(session, &buf[UBX_PREFIX_LEN],
- data_len) | (CLEAR_IS | REPORT_IS);
+ mask = ubx_msg_nav_pvt(session, &buf[UBX_PREFIX_LEN], data_len);
break;
case UBX_NAV_POSUTM:
gpsd_log(&session->context->errout, LOG_DATA, "UBX_NAV_POSUTM\n");
@@ -893,13 +829,6 @@ static void ubx_cfg_prt(struct gps_device_t *session,
* mask, by itself, seems to be ineffective.
*/
- /* FIXME: the problem is possibley sending too many messages
- * without waiting for u-blox ACK, over running its input buffer.
- * Or maybe NMEA -> UBX move not done yet...
- *
- * for example, the UBX_MON_VER fails here, but works in other
- * contexts
- */
unsigned char msg[3];
msg[0] = 0x01; /* class */
@@ -989,10 +918,14 @@ static void ubx_cfg_prt(struct gps_device_t *session,
msg[2] = 0x01; /* rate */
(void)ubx_write(session, 0x06u, 0x01, msg, 3);
+#ifdef __UNUSED__
+ /* leave here for testing. No need to enable until gpsd
+ * can decode UBX-MON-VER */
msg[0] = 0x01; /* class */
msg[1] = 0x07; /* msg id = NAV-PVT */
msg[2] = 0x01; /* rate */
(void)ubx_write(session, 0x06u, 0x01, msg, 3);
+#endif /* __UNUSED __ */
msg[0] = 0x01; /* class */