summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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