UBX always wait for sync

This commit is contained in:
2026-03-17 08:29:14 +01:00
parent 63f21de1f5
commit ff61c757fd
+4 -2
View File
@@ -28,12 +28,14 @@ class UbxPacketizer(MsgSink, MsgSource):
self.d_save = struct.pack('B', d) self.d_save = struct.pack('B', d)
self.sync_count += 1 self.sync_count += 1
if self.sync_count == len(self.sync_bytes): if self.sync_count == len(self.sync_bytes):
print(f"{msg.name}:UBX-sync")
if len(self.packet) > 0:
print(f"{msg.name}:Remaining packet: {self.packet}")
self.sync_count = 0 self.sync_count = 0
self.d_save = b'' self.d_save = b''
self.packet = b'' self.packet = b''
self.wait_sync = False self.wait_sync = False
self.timestamp = msg.timestamp self.timestamp = msg.timestamp
print("UBX-sync")
else: else:
self.sync_count = 0 self.sync_count = 0
self.packet += self.d_save self.packet += self.d_save
@@ -45,7 +47,7 @@ class UbxPacketizer(MsgSink, MsgSource):
if hdr.length == len(data): if hdr.length == len(data):
self.call_sinks(MsgContainer(msg.name, self.timestamp, self.packet)) self.call_sinks(MsgContainer(msg.name, self.timestamp, self.packet))
self.packet = b'' self.packet = b''
self.wait_sync = True
def is_msg(self, msg: MsgContainer): def is_msg(self, msg: MsgContainer):
return True return True