summaryrefslogtreecommitdiff
path: root/ubxtool
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2019-04-04 19:06:56 -0700
committerGary E. Miller <gem@rellim.com>2019-04-04 19:08:09 -0700
commit3f99c0992585f1111d4ac09a31e5311a23a508c6 (patch)
tree61a5d983112775e2f17963abe2dc86c3fb67a68c /ubxtool
parent4e8bf4c8aab6952b1e52e4fb0b10b4100bd80149 (diff)
downloadgpsd-3f99c0992585f1111d4ac09a31e5311a23a508c6.tar.gz
ubxtool: Tweak ubx.cfg_by_key()
Diffstat (limited to 'ubxtool')
-rwxr-xr-xubxtool17
1 files changed, 14 insertions, 3 deletions
diff --git a/ubxtool b/ubxtool
index 508e9d9e..61433df9 100755
--- a/ubxtool
+++ b/ubxtool
@@ -1404,7 +1404,20 @@ class ubx(object):
if item[1] == key:
return item
- return None
+ map = {0: "Z0",
+ 1: "L",
+ 2: "U1",
+ 3: "U2",
+ 4: "U4",
+ 5: "U8",
+ 6: "Z6",
+ 7: "Z7",
+ }
+ # build a fake item, guess on decode
+ size = (key >> 28) & 0x07
+ item = ("Unknown", key, map[size], 1, "Unk", "Unknown")
+
+ return item
def cfg_by_name(self, name):
"""Find a config item by name"""
@@ -1927,8 +1940,6 @@ class ubx(object):
while 0 < m_len:
u = struct.unpack_from('<L', buf, 4 + i * 4)
item = self.cfg_by_key(u[0])
- if not item:
- item = ("Unknown",0)
s += ('\n item: %s/%#x' % (item[0], u[0]))
m_len -= 4
i += 1