UBX always wait for sync
This commit is contained in:
@@ -28,12 +28,14 @@ class UbxPacketizer(MsgSink, MsgSource):
|
||||
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")
|
||||
if len(self.packet) > 0:
|
||||
print(f"{msg.name}:Remaining packet: {self.packet}")
|
||||
self.sync_count = 0
|
||||
self.d_save = b''
|
||||
self.packet = b''
|
||||
self.wait_sync = False
|
||||
self.timestamp = msg.timestamp
|
||||
print("UBX-sync")
|
||||
else:
|
||||
self.sync_count = 0
|
||||
self.packet += self.d_save
|
||||
@@ -45,7 +47,7 @@ class UbxPacketizer(MsgSink, MsgSource):
|
||||
if hdr.length == len(data):
|
||||
self.call_sinks(MsgContainer(msg.name, self.timestamp, self.packet))
|
||||
self.packet = b''
|
||||
|
||||
self.wait_sync = True
|
||||
|
||||
def is_msg(self, msg: MsgContainer):
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user