summaryrefslogtreecommitdiff
path: root/ubxtool
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2019-04-16 15:38:10 -0700
committerGary E. Miller <gem@rellim.com>2019-04-16 15:38:10 -0700
commit323554c68ac3ff7afec76f50f6dcfeb32ccb2746 (patch)
treec7f6878d7dc20b2975f6ba0a438ab01415272c05 /ubxtool
parent633d52deb459e1c82b56585ad7276dee8cda71e8 (diff)
downloadgpsd-323554c68ac3ff7afec76f50f6dcfeb32ccb2746.tar.gz
ubxtool: Add poll and decode of UBX-TIM-TP2
Diffstat (limited to 'ubxtool')
-rwxr-xr-xubxtool24
1 files changed, 23 insertions, 1 deletions
diff --git a/ubxtool b/ubxtool
index 71462481..318239e2 100755
--- a/ubxtool
+++ b/ubxtool
@@ -2990,6 +2990,20 @@ class ubx(object):
' obs %u valid %u active %u' % u)
return s
+ def tim_tm2(self, buf):
+ """UBX-TIM-TP decode"""
+ m_len = len(buf)
+ if 0 == m_len:
+ return " Poll request"
+
+ if 28 > m_len:
+ return " Bad Length %s" % m_len
+
+ u = struct.unpack_from('<BBHHHLLLLL', buf, 0)
+ s = (' ch %u flags %#x count %u wnR %u wnF %u\n'
+ ' towMsR %u towSubMsR %u towMsF %u towSubMsF %u accEst %u\n' % u)
+ return s
+
def tim_tp(self, buf):
"""UBX-TIM-TP decode"""
m_len = len(buf)
@@ -3024,7 +3038,7 @@ class ubx(object):
return s
tim_ids = {1: {'str': 'TP', 'dec': tim_tp, 'name': 'UBX-TIM-TP'},
- 3: {'str': 'TM2', 'name': 'UBX-TIM-TM2'},
+ 3: {'str': 'TM2', 'dec': tim_tm2, 'name': 'UBX-TIM-TM2'},
4: {'str': 'SVIN', 'dec': tim_svin, 'name': 'UBX-TIM-SVIN'},
6: {'str': 'VRFY', 'name': 'UBX-TIM-VRFY'},
0x11: {'str': 'DOSC', 'name': 'UBX-TIM-DOSC'},
@@ -3833,6 +3847,11 @@ class ubx(object):
m_data = bytearray(0)
gps_model.gps_send(0x0d, 0x04, m_data)
+ def send_tim_tm2(self):
+ """UBX-TIM-TM2, get time mark data"""
+ m_data = bytearray(0)
+ gps_model.gps_send(0x0d, 0x03, m_data)
+
def send_tim_tp(self):
"""UBX-TIM-TP, get time pulse timedata"""
m_data = bytearray(0)
@@ -3938,6 +3957,9 @@ class ubx(object):
# UBX-TIM-SVIN, get survey in data
"SVIN": {"command": send_tim_svin,
"help": "UBX-TIM-SVIN get survey in data"},
+ # UBX-TIM-TM2, get time mark data
+ "TIM-TM2": {"command": send_tim_tm2,
+ "help": "UBX-TIM-TM2 get time mark data"},
# UBX-TIM-TP, get time pulse timedata
"TIM-TP": {"command": send_tim_tp,
"help": "UBX-TIM-TP get time pulse timedata"},