summaryrefslogtreecommitdiff
path: root/driver_ubx.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-11-08 15:27:26 -0500
committerEric S. Raymond <esr@thyrsus.com>2013-11-08 15:27:26 -0500
commitad9bb9dc0009826d934b2c9916c8ab8982d88fba (patch)
treeea69d7c4a6c7eee721a20aa70efaea8eadbd2727 /driver_ubx.c
parent006b42eb8a4a486b51ecaba16eb8c71399ca218f (diff)
downloadgpsd-ad9bb9dc0009826d934b2c9916c8ab8982d88fba.tar.gz
Improve the UBX sentence mix in NMEA mode.
Diffstat (limited to 'driver_ubx.c')
-rw-r--r--driver_ubx.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/driver_ubx.c b/driver_ubx.c
index b0f52654..e99a01e5 100644
--- a/driver_ubx.c
+++ b/driver_ubx.c
@@ -759,6 +759,40 @@ static void ubx_cfg_prt(struct gps_device_t *session,
msg[2] = 0x00; /* rate */
(void)ubx_write(session, 0x06u, 0x01, msg, 3);
+ /* try to improve the sentence mix. in particular by enabling ZDA */
+ msg[0] = 0xf0; /* class */
+ msg[1] = 0x09; /* msg id = GBS */
+ msg[2] = 0x01; /* rate */
+ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
+ msg[0] = 0xf0; /* class */
+ msg[1] = 0x00; /* msg id = GGA */
+ msg[2] = 0x01; /* rate */
+ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
+ msg[0] = 0xf0; /* class */
+ msg[1] = 0x02; /* msg id = GSA */
+ msg[2] = 0x01; /* rate */
+ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
+ msg[0] = 0xf0; /* class */
+ msg[1] = 0x07; /* msg id = GST */
+ msg[2] = 0x01; /* rate */
+ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
+ msg[0] = 0xf0; /* class */
+ msg[1] = 0x03; /* msg id = GSV */
+ msg[2] = 0x01; /* rate */
+ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
+ msg[0] = 0xf0; /* class */
+ msg[1] = 0x04; /* msg id = RMC */
+ msg[2] = 0x01; /* rate */
+ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
+ msg[0] = 0xf0; /* class */
+ msg[1] = 0x05; /* msg id = VTG */
+ msg[2] = 0x01; /* rate */
+ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
+ msg[0] = 0xf0; /* class */
+ msg[1] = 0x08; /* msg id = ZDA */
+ msg[2] = 0x01; /* rate */
+ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
+
buf[outProtoMask] &= ~UBX_PROTOCOL_MASK;
buf[outProtoMask] |= NMEA_PROTOCOL_MASK;
} else { /* MODE_BINARY */
@@ -789,6 +823,48 @@ static void ubx_cfg_prt(struct gps_device_t *session,
msg[2] = 0x0a; /* rate */
(void)ubx_write(session, 0x06u, 0x01, msg, 3);
+#ifdef __UNUSED__
+ /*
+ * In theory this should turn off NMEA reporting even if
+ * clearing the NMEA protocol mask does not. In practice it
+ * doesn't work on the GR601-W. If it did, we could get rid
+ * of the crocky code that detects unsuppressed NMEA and
+ * suppresses UBX.
+ */
+ msg[0] = 0xf0; /* class */
+ msg[1] = 0x09; /* msg id = GBS */
+ msg[2] = 0x00; /* rate */
+ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
+ msg[0] = 0xf0; /* class */
+ msg[1] = 0x00; /* msg id = GGA */
+ msg[2] = 0x00; /* rate */
+ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
+ msg[0] = 0xf0; /* class */
+ msg[1] = 0x02; /* msg id = GSA */
+ msg[2] = 0x00; /* rate */
+ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
+ msg[0] = 0xf0; /* class */
+ msg[1] = 0x07; /* msg id = GST */
+ msg[2] = 0x00; /* rate */
+ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
+ msg[0] = 0xf0; /* class */
+ msg[1] = 0x03; /* msg id = GSV */
+ msg[2] = 0x00; /* rate */
+ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
+ msg[0] = 0xf0; /* class */
+ msg[1] = 0x04; /* msg id = RMC */
+ msg[2] = 0x00; /* rate */
+ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
+ msg[0] = 0xf0; /* class */
+ msg[1] = 0x05; /* msg id = VTG */
+ msg[2] = 0x00; /* rate */
+ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
+ msg[0] = 0xf0; /* class */
+ msg[1] = 0x08; /* msg id = ZDA */
+ msg[2] = 0x00; /* rate */
+ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
+#endif /* __UNUSED __ */
+
buf[outProtoMask] &= ~NMEA_PROTOCOL_MASK;
buf[outProtoMask] |= UBX_PROTOCOL_MASK;
}