summaryrefslogtreecommitdiff
path: root/ubxtool
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2019-05-28 12:23:41 -0700
committerGary E. Miller <gem@rellim.com>2019-05-28 12:23:41 -0700
commitad3d51e51f6b7f3472c2007fb0557f02aefb7472 (patch)
tree7508b84ab087dcf81701c9a7f340c8aa35b0db0d /ubxtool
parentb4802c4b92bee21192bedddeeacd4fae5a07998f (diff)
downloadgpsd-ad3d51e51f6b7f3472c2007fb0557f02aefb7472.tar.gz
ubxtool: Improve UBX-CFG-PMS decode.
Diffstat (limited to 'ubxtool')
-rwxr-xr-xubxtool26
1 files changed, 14 insertions, 12 deletions
diff --git a/ubxtool b/ubxtool
index 75d734c4..c69f99b7 100755
--- a/ubxtool
+++ b/ubxtool
@@ -2166,6 +2166,15 @@ class ubx(object):
index_s(u[5], self.cfg_odo_profile)))
return s
+ cfg_pms_values = {0: "Full power",
+ 1: "Balanced",
+ 2: "Interval",
+ 3: "Aggresive with 1Hz",
+ 4: "Aggresive with 2Hz",
+ 5: "Aggresive with 4Hz",
+ 0xff: "Invalid"
+ }
+
def cfg_pms(self, buf):
"""UBX-CFG-PMS decode, Power Mode Setup"""
@@ -2176,19 +2185,12 @@ class ubx(object):
if 8 > m_len:
return "Bad Length %s" % m_len
- values = {0: "Full power",
- 1: "Balanced",
- 2: "Interval",
- 3: "Aggresive with 1Hz",
- 4: "Aggresive with 2Hz",
- 5: "Aggresive with 4Hz",
- 0xff: "Invalid"
- }
u = struct.unpack_from('<BBHHBB', buf, 0)
- s = (' version: %u powerSetupValue: %u'
- ' period: %u onTime: %#x reserved1: [%u %u]' % u)
- if u[0] in values:
- s += "\n powerSetupValue: %s" % values[u[0]]
+ s = (' version %u powerSetupValue %u'
+ ' period %u onTime %#x reserved1 %u %u' % u)
+ if VERB_DECODE <= opts['verbosity']:
+ s += ('\n powerSetupValue (%s)' %
+ index_s(u[0], self.cfg_pms_values))
return s