ubx packetizer: permit sync bytes length > 2

This commit is contained in:
2026-03-17 12:39:28 +01:00
parent ff61c757fd
commit 58f7c32747
+3 -2
View File
@@ -25,7 +25,7 @@ class UbxPacketizer(MsgSink, MsgSource):
for n in range (0, len(msg.data)):
d = msg.data[n]
if d == self.sync_bytes[self.sync_count]:
self.d_save = struct.pack('B', d)
self.d_save += struct.pack('B', d)
self.sync_count += 1
if self.sync_count == len(self.sync_bytes):
print(f"{msg.name}:UBX-sync")
@@ -37,9 +37,10 @@ class UbxPacketizer(MsgSink, MsgSource):
self.wait_sync = False
self.timestamp = msg.timestamp
else:
self.sync_count = 0
if self.sync_count > 0:
self.packet += self.d_save
self.d_save = b''
self.sync_count = 0
if not self.wait_sync:
self.packet += struct.pack('B', d)
data, hdr = frame_parse(self.packet)