summaryrefslogtreecommitdiff
path: root/ubxtool
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2019-05-27 16:41:57 -0700
committerGary E. Miller <gem@rellim.com>2019-05-27 16:41:57 -0700
commit29e1934faf8eceb16bf337e879f6bed017d47ee9 (patch)
tree31c12e19ddbe0068047a4c3e45b5cad6b43efdc4 /ubxtool
parent8db83b355998f6aeeec98434ecd71399feaeadf0 (diff)
downloadgpsd-29e1934faf8eceb16bf337e879f6bed017d47ee9.tar.gz
ubxtool: Add polld and decode for UBX-MON-RXBUF
Diffstat (limited to 'ubxtool')
-rwxr-xr-xubxtool34
1 files changed, 29 insertions, 5 deletions
diff --git a/ubxtool b/ubxtool
index 804ca57b..9ea8d1d0 100755
--- a/ubxtool
+++ b/ubxtool
@@ -2600,7 +2600,7 @@ class ubx(object):
return " Bad Length %s" % m_len
s = ''
- for i in range(1, 6):
+ for i in range(1, 7):
u = struct.unpack_from('<HHHHHHHH', buf, 0)
s += "msg%u %u %u %u %u %u %u %u %u\n" % ((i,) + u)
@@ -2608,6 +2608,27 @@ class ubx(object):
s += "skipped %u %u %u %u %u %u" % u
return s
+ def mon_rxbuf(self, buf):
+ """UBX-MON-RXBUF decode"""
+ m_len = len(buf)
+ if 0 == m_len:
+ return " Poll request"
+
+ if 24 > m_len:
+ return " Bad Length %s" % m_len
+
+ rxbuf_name = {
+ 1: "pending",
+ 2: "usage",
+ 3: "peakUsage",
+ }
+
+ s = ''
+ for i in range(1, 4):
+ u = struct.unpack_from('<HHHHHH', buf, 0)
+ s += rxbuf_name[i] + " %u %u %u %u %u %u\n" % u
+ return s
+
def mon_ver(self, buf):
"""UBX-MON-VER decode"""
m_len = len(buf)
@@ -2636,7 +2657,7 @@ class ubx(object):
mon_ids = {2: {'str': 'IO', 'dec': mon_io, 'name': 'UBX-MON-IO'},
4: {'str': 'VER', 'dec': mon_ver, 'name': 'UBX-MON-VER'},
6: {'str': 'MSGPP', 'dec': mon_msgpp, 'name': 'UBX-MON-MSGPP'},
- 7: {'str': 'RXBUF', 'name': 'UBX-MON-RXBUF'},
+ 7: {'str': 'RXBUF', 'dec': mon_rxbuf, 'name': 'UBX-MON-RXBUF'},
8: {'str': 'TXBUF', 'name': 'UBX-MON-TXBUF'},
9: {'str': 'HW', 'dec': mon_hw, 'name': 'UBX-MON-HW'},
0x0b: {'str': 'HW2', 'dec': mon_hw2, 'name': 'UBX-MON-HW2'},
@@ -4688,7 +4709,7 @@ class ubx(object):
"help": "SBAS"},
# en/dis able SFRB/SFRBX
"SFRBX": {"command": send_able_sfrbx,
- "help": "SFRB/SFRBX subframes"},
+ "help": "SFRB/SFRBX subframes"},
# en/dis able TP time pulse message
"TP": {"command": send_able_tp,
"help": "TP Time Pulse message"},
@@ -4759,8 +4780,11 @@ class ubx(object):
"help": "poll UBX-MON-IO I/O Subsystem Status"},
# UBX-MON-MSGPP
"MON-MSGPP": {"command": send_poll, "opt": [0x0a, 0x06],
- "help": "poll UBX-MON-MSGPP Message Parese and "
- "Process Status"},
+ "help": "poll UBX-MON-MSGPP Message Parese and "
+ "Process Status"},
+ # UBX-MON-RXBUF
+ "MON-RXBUF": {"command": send_poll, "opt": [0x0a, 0x07],
+ "help": "poll UBX-MON-RXBUF Receiver Buffer Status"},
# UBX-MON-VER
"MON-VER": {"command": send_poll, "opt": [0x0a, 0x04],
"help": "poll UBX-MON-VER GPS version"},