added UBX reception
This commit is contained in:
@@ -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''
|
||||
|
||||
|
||||
Reference in New Issue
Block a user