added UBX reception

This commit is contained in:
2026-03-16 16:12:11 +01:00
parent 2e83aeeb62
commit e004b71f3e
4 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -2,7 +2,7 @@ import struct
from msg_container import MsgContainer
from msg_sink import MsgSink
from msg_source import MsgSource
from ubx.ubx import UBX_SYNC_WORD, frame_parse_hdr, frame_create
from ubx.ubx import UBX_SYNC_WORD, frame_parse, frame_create
from receiver.ubx_receiver import UbxReceiver
class UbxPacketizer(MsgSink, MsgSource):
@@ -34,9 +34,9 @@ class UbxPacketizer(MsgSink, MsgSource):
else:
if not self.wait_sync:
self.packet += struct.pack('B', d)
hdr = frame_parse_hdr(self.packet)
if hdr is not None:
if (6 + hdr.length) == len(self.packet):
data, hdr = frame_parse(self.packet)
if data is not None:
if hdr.length == len(data):
self.call_sinks(MsgContainer(name, timestamp, self.packet))
self.packet = b''