diff options
author | Gary E. Miller <gem@rellim.com> | 2019-04-23 20:16:43 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2019-04-23 20:16:43 -0700 |
commit | 3a50f86b58854476c074c1f4fd53afd7c9282394 (patch) | |
tree | e4b287970e15b07028566caa88e46efc91ecafac | |
parent | a815ab062d15fe33bd6dbc9a7f6347ed96ef5dc5 (diff) | |
download | gpsd-3a50f86b58854476c074c1f4fd53afd7c9282394.tar.gz |
driver_ubx: Enable UBX-NAV-EOE if protver >= 18 with gpsctl -b
UBX-NAV-EOE is a good cycle ender.
-rw-r--r-- | driver_ubx.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/driver_ubx.c b/driver_ubx.c index 5295f014..dbb631b7 100644 --- a/driver_ubx.c +++ b/driver_ubx.c @@ -737,6 +737,10 @@ ubx_msg_nav_eoe(struct gps_device_t *session, unsigned char *buf, return 0; } + if (18 > session->driver.ubx.protver) { + /* this GPS is at least protver 18 */ + session->driver.ubx.protver = 18; + } session->driver.ubx.iTOW = getles32(buf, 0); gpsd_log(&session->context->errout, LOG_DATA, "EOE: iTOW=%lld\n", (long long)session->driver.ubx.iTOW); @@ -852,7 +856,7 @@ ubx_msg_nav_sat(struct gps_device_t *session, unsigned char *buf, PRN = svId; break; case 1: - /* SBAS, 120-158 mapes to 120-158 */ + /* SBAS, 120-158 maps to 120-158 */ if (120 > svId || 158 < svId) { /* skip bad svId */ continue; @@ -1977,6 +1981,12 @@ static void ubx_cfg_prt(struct gps_device_t *session, msg[2] = 0x00; /* rate */ (void)ubx_write(session, 0x06u, 0x01, msg, 3); + /* UBX-NAV-EOE */ + msg[0] = 0x01; /* class */ + msg[1] = 0x61; /* msg id = NAV-EOE */ + 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 */ @@ -2104,14 +2114,26 @@ static void ubx_cfg_prt(struct gps_device_t *session, msg[1] = 0x01; /* msg id = UBX-NAV-POSECEF */ msg[2] = 0x01; /* rate */ (void)ubx_write(session, 0x06u, 0x01, msg, 3); + msg[0] = 0x01; /* class */ msg[1] = 0x11; /* msg id = UBX-NAV-VELECEF */ msg[2] = 0x01; /* rate */ (void)ubx_write(session, 0x06u, 0x01, msg, 3); + msg[0] = 0x01; /* class */ msg[1] = 0x26; /* msg id = UBX-NAV-TIMELS */ msg[2] = 0xff; /* about every 4 minutes if nav rate is 1Hz */ (void)ubx_write(session, 0x06, 0x01, msg, 3); + + if (18 <= session->driver.ubx.protver) { + /* first in u-blox 8 */ + /* UBX-NAV-EOE makes a good cycle ender */ + msg[0] = 0x01; /* class */ + msg[1] = 0x61; /* msg id = NAV-EOE */ + msg[2] = 0x00; /* rate */ + (void)ubx_write(session, 0x06u, 0x01, msg, 3); + } + } } |