summaryrefslogtreecommitdiff
path: root/ubxtool
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2019-05-20 17:42:36 -0700
committerGary E. Miller <gem@rellim.com>2019-05-20 17:42:36 -0700
commitda31a9c9bac13b5c066922fded297f30753c5b18 (patch)
tree2f40f495e8410cffb6989fdcad0a40d7a8dcd072 /ubxtool
parent83be4775b69f7f662b87efd224aa3835df745e48 (diff)
downloadgpsd-da31a9c9bac13b5c066922fded297f30753c5b18.tar.gz
ubxtool: Decode CFG-ANT with flag_s().
Diffstat (limited to 'ubxtool')
-rwxr-xr-xubxtool25
1 files changed, 13 insertions, 12 deletions
diff --git a/ubxtool b/ubxtool
index 7519d8f7..d7c1ea1a 100755
--- a/ubxtool
+++ b/ubxtool
@@ -1655,6 +1655,14 @@ class ubx(object):
ack_ids = {0: {'str': 'NAK', 'dec': ack_ack, 'name': 'UBX-ACK-NAK'},
1: {'str': 'ACK', 'dec': ack_ack, 'name': 'UBX-ACK-ACK'}}
+ cfg_ant_pins = {
+ 1: 'svcs',
+ 2: 'scd',
+ 4: 'ocd',
+ 8: 'pdwnOnSCD',
+ 0x10: 'recovery',
+ }
+
def cfg_ant(self, buf):
"""UBX-CFG-ANT decode"""
m_len = len(buf)
@@ -1665,20 +1673,13 @@ class ubx(object):
return "Bad Length %s" % m_len
u = struct.unpack_from('<HH', buf, 0)
- s = ' flags: %#x pins: %#x (' % u
- if u[0] & 0x1:
- s += 'svcs '
- if u[0] & 0x2:
- s += 'scd '
- if u[0] & 0x4:
- s += 'ocd '
- if u[0] & 0x8:
- s += 'pdwnOnSCD '
- if u[0] & 0x10:
- s += 'recovery '
- s += (')\n pinSwitch: %d, pinSCD: %d, pinOCD: %d reconfig: %d' %
+ s = ' flags %#x pins %#x ' % u
+ s += ('pinSwitch %d pinSCD %d pinOCD %d reconfig %d' %
(u[1] & 0x1f, (u[1] >> 5) & 0x1f, (u[1] >> 10) & 0x1f,
u[1] >> 15))
+ if VERB_DECODE <= opts['verbosity']:
+ s += ('\n flags (%s)' % flag_s(u[0], self.cfg_ant_pins))
+
return s
def cfg_cfg_mask(self, mask):