summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2019-05-29 19:42:09 -0700
committerGary E. Miller <gem@rellim.com>2019-05-29 19:42:09 -0700
commit29d3373e87761b24b32f8874ad97db05386c6a80 (patch)
treee39262438695ee278af6eee37665b4bd7956e915
parent3286c9c4af0d5b7c7b9a9131352777e89b136358 (diff)
downloadgpsd-29d3373e87761b24b32f8874ad97db05386c6a80.tar.gz
ubxtool: Cleanup UBX-CFG-NAV5 decode.
-rwxr-xr-xubxtool65
1 files changed, 51 insertions, 14 deletions
diff --git a/ubxtool b/ubxtool
index 6ead1154..007b7c99 100755
--- a/ubxtool
+++ b/ubxtool
@@ -1977,6 +1977,47 @@ class ubx(object):
index_s(buf[0], self.cfg_inf_protid))
return s
+ utc_std = {
+ 0: "Default",
+ 1: "CRL",
+ 2: "NIST",
+ 3: "USNO",
+ 4: "BIPM",
+ 5: "tbd",
+ 6: "SU",
+ 7: "NTSC",
+ }
+
+ cfg_nav5_dyn = {
+ 0: "Portable",
+ 2: "Stationary",
+ 3: "Pedestrian",
+ 4: "Automotive",
+ 5: "Sea",
+ 6: "Airborne with <1g Acceleration",
+ 7: "Airborne with <2g Acceleration",
+ 8: "Airborne with <4g Acceleration",
+ }
+
+ cfg_nav5_fix = {
+ 1: "2D only",
+ 2: "3D only",
+ 3: "Auto 2D/3D",
+ }
+
+ cfg_nav5_mask = {
+ 1: "dyn",
+ 2: "minEl",
+ 4: "posFixMode",
+ 8: "drLim",
+ 0x10: "posMask",
+ 0x20: "timeMask",
+ 0x40: "staticHoldMask",
+ 0x80: "dgpsMask",
+ 0x100: "cnoThreshold",
+ 0x400: "utc",
+ }
+
def cfg_nav5(self, buf):
"""UBX-CFG-NAV5 nav Engine Settings"""
m_len = len(buf)
@@ -1986,12 +2027,19 @@ class ubx(object):
if 36 > m_len:
return "Bad Length %s" % m_len
- u = struct.unpack_from('<HBBlLbBHHHHbbbbHHbBBBBB', buf, 0)
+ u = struct.unpack_from('<HBBlLbBHHHHbbbbHHbBL', buf, 0)
s = (' mask %#x dynModel %u fixmode %d fixedAlt %d FixedAltVar %u\n'
' minElev %d drLimit %u pDop %u tDop %u pAcc %u tAcc %u\n'
' staticHoldThresh %u dgpsTimeOut %u cnoThreshNumSVs %u\n'
' cnoThresh %u res %u staticHoldMaxDist %u utcStandard %u\n'
- ' reserved %x %x %x %x %x' % u)
+ ' reserved x%x %x' % u)
+ if VERB_DECODE <= opts['verbosity']:
+ s += ("\n dynModel (%s) fixMode (%s) utcStandard (%s)"
+ "\n mask (%s)" %
+ (index_s(u[1], self.cfg_nav5_dyn),
+ index_s(u[2], self.cfg_nav5_fix),
+ index_s(u[17] >> 4, self.utc_std),
+ flag_s(u[0] >> 4, self.cfg_nav5_mask)))
return s
def cfg_navx5(self, buf):
@@ -3674,17 +3722,6 @@ class ubx(object):
4: "validUTC",
}
- nav_timeutc_std = {
- 0: "N/A",
- 1: "CRL",
- 2: "NIST",
- 3: "USNO",
- 4: "BIPM",
- 5: "tbd",
- 6: "SU",
- 7: "NTSC",
- }
-
def nav_timeutc(self, buf):
"""UBX-NAV-TIMEUTC decode"""
m_len = len(buf)
@@ -3701,7 +3738,7 @@ class ubx(object):
if VERB_DECODE <= opts['verbosity']:
s += ("\n valid (%s) utcStandard (%s)" %
(flag_s(u[9], self.nav_timeutc_valid),
- index_s(u[9] >> 4, self.nav_timeutc_std)))
+ index_s(u[9] >> 4, self.utc_std)))
return s
def nav_velecef(self, buf):