summaryrefslogtreecommitdiff
path: root/ubxtool
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2019-05-27 18:44:16 -0700
committerGary E. Miller <gem@rellim.com>2019-05-27 18:44:16 -0700
commit2eb907ff6b1d5b18717f18b35e625f7fb70b39dd (patch)
tree0479e820cfdb346ddaaee0201cfb464949918094 /ubxtool
parentcabba5e1408433cad19b0551653629790d39d088 (diff)
downloadgpsd-2eb907ff6b1d5b18717f18b35e625f7fb70b39dd.tar.gz
ubxtool: Add poll and decode UBX-CFG-RATE
Diffstat (limited to 'ubxtool')
-rwxr-xr-xubxtool29
1 files changed, 28 insertions, 1 deletions
diff --git a/ubxtool b/ubxtool
index 737d44de..e9a33ffb 100755
--- a/ubxtool
+++ b/ubxtool
@@ -2119,6 +2119,29 @@ class ubx(object):
return '\n'.join(s)
+ cfg_rate_system = {
+ 0: "UTC",
+ 1: "GPS",
+ 2: "GLONASS",
+ 3: "BeiDou",
+ 4: "Galileo",
+ }
+
+ def cfg_rate(self, buf):
+ """UBX-CFG-RATE decode, Navigation/Measurement Rate Settings"""
+
+ m_len = len(buf)
+ if 0 == m_len:
+ return " Poll request"
+
+ if 6 > m_len:
+ return "Bad Length %s" % m_len
+
+ u = struct.unpack_from('<HHH', buf, 0)
+ s = (" measRate %u navRate %u timeRef %u (%s)" %
+ (u + (index_s(u[2], self.cfg_rate_system),)))
+ return s
+
def cfg_rst(self, buf):
""""UBX-CFG-RST decode, Reset Receiver"""
@@ -2386,7 +2409,7 @@ class ubx(object):
2: {'str': 'INF', 'dec': cfg_inf, 'name': 'UBX-CFG-INF'},
4: {'str': 'RST', 'dec': cfg_rst, 'name': 'UBX-CFG-RST'},
6: {'str': 'DAT', 'name': 'UBX-CFG-DAT'},
- 8: {'str': 'RATE', 'name': 'UBX-CFG-RATE'},
+ 8: {'str': 'RATE', 'dec': cfg_rate, 'name': 'UBX-CFG-RATE'},
9: {'str': 'CFG', 'dec': cfg_cfg, 'name': 'UBX-CFG-CFG'},
0x11: {'str': 'RXM', 'name': 'UBX-CFG-RXM'},
0x13: {'str': 'ANT', 'dec': cfg_ant, 'name': 'UBX-CFG-ANT'},
@@ -4896,6 +4919,10 @@ class ubx(object):
# UBX-CFG-PRT
"CFG-PRT": {"command": send_cfg_prt,
"help": "poll UBX-CFG-PRT I/O port settings"},
+ # UBX-CFG-RATE
+ "CFG-RATE": {"command": send_poll, "opt": [0x06, 0x08],
+ "help": "poll UBX-CFG-RATE Navigation/Measurement "
+ "Rate Settings"},
# UBX-CFG-TMODE2
"CFG-TMODE2": {"command": send_poll, "opt": [0x06, 0x3d],
"help": "poll UBX-CFG-TMODE2 time mode 2 config"},