summaryrefslogtreecommitdiff
path: root/ubxtool
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2019-05-27 17:11:03 -0700
committerGary E. Miller <gem@rellim.com>2019-05-27 17:27:39 -0700
commit85f361e9aefd7ccd6a84fe26284eb104be5f2770 (patch)
tree7a0a6ef0d9f8041887dddd190dc036cd3cffc8aa /ubxtool
parentb561c3cbebf02180e80095d8ea287f5df94e1385 (diff)
downloadgpsd-85f361e9aefd7ccd6a84fe26284eb104be5f2770.tar.gz
ubxtool: Add poll and decode of MON-PATCH
Diffstat (limited to 'ubxtool')
-rwxr-xr-xubxtool42
1 files changed, 41 insertions, 1 deletions
diff --git a/ubxtool b/ubxtool
index 6e784f7d..5e7dd10b 100755
--- a/ubxtool
+++ b/ubxtool
@@ -2629,6 +2629,42 @@ class ubx(object):
s += rxbuf_name[i] + "%u %u %u %u %u %u\n" % u
return s
+ mon_patch_act = {
+ 1: "Active"
+ }
+ mon_patch_loc = {
+ 0: "eFuse",
+ 2: "ROM",
+ 4: "BBR",
+ 6: "File System",
+ }
+
+ def mon_patch(self, buf):
+ """UBX-MON-PATCH decode, Output information about installed patches."""
+
+ m_len = len(buf)
+
+ if 0 == m_len:
+ return " Poll request"
+
+ if 4 > m_len:
+ return " Bad Length %s" % m_len
+
+ # first seen in protver 15
+ u = struct.unpack_from('<HH', buf, 0)
+ s = " version %u nEntries %u" % u
+
+ for i in range(0, u[1]):
+ u = struct.unpack_from('<LLLL', buf, 0)
+ s = (" patchInfo x%x comparatorNumber %u patchAddress %u "
+ "patchData %u" % u)
+ if VERB_DECODE <= opts['verbosity']:
+ s += ('\n patchInfo (%s, %s)' %
+ (flag_s(u[0] & 0x01, self.mon_patch_act),
+ index_s(u[0] & 0x06, self.mon_patch_loc)))
+
+ return s
+
def mon_rxr(self, buf):
"""UBX-MON-RXBUF decode, Receiver Status Information"""
m_len = len(buf)
@@ -2696,7 +2732,8 @@ class ubx(object):
9: {'str': 'HW', 'dec': mon_hw, 'name': 'UBX-MON-HW'},
0x0b: {'str': 'HW2', 'dec': mon_hw2, 'name': 'UBX-MON-HW2'},
0x21: {'str': 'RXR', 'dec': mon_rxr, 'name': 'UBX-MON-RXR'},
- 0x27: {'str': 'PATCH', 'name': 'UBX-MON-PATCH'},
+ 0x27: {'str': 'PATCH', 'dec': mon_patch,
+ 'name': 'UBX-MON-PATCH'},
0x28: {'str': 'GNSS', 'dec': mon_gnss, 'name': 'UBX-MON-GNSS'},
0x2e: {'str': 'SMGR', 'name': 'UBX-MON-SMGR'},
0x36: {'str': 'COMMS', 'dec': mon_comms,
@@ -4816,6 +4853,9 @@ class ubx(object):
"MON-MSGPP": {"command": send_poll, "opt": [0x0a, 0x06],
"help": "poll UBX-MON-MSGPP Message Parese and "
"Process Status"},
+ # UBX-MON-PATCH
+ "MON-PATCH": {"command": send_poll, "opt": [0x0a, 0x27],
+ "help": "poll UBX-MON-PATCH Info on Installed Patches"},
# UBX-MON-RXBUF
"MON-RXBUF": {"command": send_poll, "opt": [0x0a, 0x07],
"help": "poll UBX-MON-RXBUF Receiver Buffer Status"},