summaryrefslogtreecommitdiff
path: root/ubxtool
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2019-04-16 11:34:04 -0700
committerGary E. Miller <gem@rellim.com>2019-04-16 11:34:04 -0700
commit632090e27f1f8601518e10b09141b74665f28166 (patch)
tree355469e77d2e873ca08c1e3723074ef3dd7d2348 /ubxtool
parentbc24e94b1142101c75eab8a0a18da17ead16f5f7 (diff)
downloadgpsd-632090e27f1f8601518e10b09141b74665f28166.tar.gz
ubxtool: Adjust UBX-NAV-COMMS port names
Looks like the documentation does not match the part.
Diffstat (limited to 'ubxtool')
-rwxr-xr-xubxtool20
1 files changed, 15 insertions, 5 deletions
diff --git a/ubxtool b/ubxtool
index b7c66ada..3cb98ba3 100755
--- a/ubxtool
+++ b/ubxtool
@@ -157,6 +157,16 @@ class ubx(object):
port_id_map['UART'] = port_id_map['UART1'] # Accept synonym
port_ids[5] = 'Reserved' # Don't include this in port_id_map
+ # Names for portID values in UBX-CFG-COMMS
+ # the doc is byteswapped from here
+ port_ids1 = {0: 'DDC',
+ 0x100: 'UART1',
+ 0x101: 'UNKa', # seen on ZED-M9T, undocumented
+ 0x200: 'UNKb', # seen on ZED-M9T, undocumented
+ 0x201: 'UART2',
+ 0x300: 'USB',
+ 0x400: 'SPI',
+ }
# u-blox 9 cfg items as a 5-tuple
# 1 - Name
# 2 - key id
@@ -2175,11 +2185,11 @@ class ubx(object):
i = 0
while m_len > (8 + (i * 40)):
- u = struct.unpack_from('<BBHLBBHLBBHHHHHLLL', buf, (8 + (i * 40)))
- if u[1] in self.port_ids:
- name = self.port_ids[u[1]]
+ u = struct.unpack_from('<HHLBBHLBBHHHHHLLL', buf, (8 + (i * 40)))
+ if u[0] in self.port_ids1:
+ name = "%#x (%s)" % (u[0], self.port_ids1[u[0]])
else:
- name = "Unk"
+ name = "%#x (UNK)" % u[0]
if 0 < i:
s += "\n"
s += (' Port: %u (%s)\n' % (u[1], name))
@@ -2187,7 +2197,7 @@ class ubx(object):
' rxPending %u rxBytes %u rxUsage %u rxPeakUsage %u\n'
' overrunErrs %u msgs %u/%u/%u/%u reserved %x %x '
'skipped %u'
- % u[2:])
+ % u[1:])
i += 1
return s