This repository was archived by the owner on Jan 5, 2024. It is now read-only.
forked from mayeranalytics/pyUBX
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplay.py
More file actions
executable file
·32 lines (20 loc) · 1.72 KB
/
play.py
File metadata and controls
executable file
·32 lines (20 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python3
"""A space to play around with messages."""
import UBX
from UBXMessage import parseUBXPayload
if __name__ == '__main__':
print("UBX.ACK.ACK.Get: ", UBX.ACK.ACK.Get().serialize())
print("UBX.CFG.PMS.Get: ", UBX.CFG.PMS.Get().serialize())
print("UBX.CFG.PMS.Set: ", UBX.CFG.PMS.Set(powerSetupValue=2).serialize())
print("UBX.MON.VER.Get: ", UBX.MON.VER.Get().serialize())
print("UBX.TEST.TEST.Get: ", UBX.TEST.TEST.Get().serialize())
print(parseUBXPayload(0x05, 0x01, b'12'))
print(parseUBXPayload(0x05, 0x00, b'gh'))
print(parseUBXPayload(UBX.TEST._class, UBX.TEST.TEST._id,
b'\x80\xff\x01\x00\x02\x00'))
# CFG-GNSS
msg = b'\x00\x20\x20\x07\x00\x08\x10\x00\x01\x00\x01\x01\x01\x01\x03\x00\x01\x00\x01\x01\x02\x04\x08\x00\x00\x00\x01\x01\x03\x08\x10\x00\x00\x00\x01\x01\x04\x00\x08\x00\x00\x00\x01\x03\x05\x00\x03\x00\x01\x00\x01\x05\x06\x08\x0e\x00\x01\x00\x01\x01'
print(parseUBXPayload(UBX.CFG._class, UBX.CFG.GNSS._id, msg))
# MON-VER
msg = b'\x52\x4f\x4d\x20\x43\x4f\x52\x45\x20\x33\x2e\x30\x31\x20\x28\x31\x30\x37\x38\x38\x38\x29\x00\x00\x00\x00\x00\x00\x00\x00\x30\x30\x30\x38\x30\x30\x30\x30\x00\x00\x46\x57\x56\x45\x52\x3d\x53\x50\x47\x20\x33\x2e\x30\x31\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x50\x52\x4f\x54\x56\x45\x52\x3d\x31\x38\x2e\x30\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x47\x50\x53\x3b\x47\x4c\x4f\x3b\x47\x41\x4c\x3b\x42\x44\x53\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x53\x42\x41\x53\x3b\x49\x4d\x45\x53\x3b\x51\x5a\x53\x53\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
print(parseUBXPayload(UBX.MON._class, UBX.MON.VER._id, msg))