refactored MsgSink and MsgSource

This commit is contained in:
2026-03-25 05:29:59 +01:00
parent 83e5867983
commit 3a85765347
8 changed files with 33 additions and 33 deletions
+6 -6
View File
@@ -1,12 +1,12 @@
from msg_container import MsgContainer
from msg_sink import MsgSink
from msg_source import MsgSource
from msg_listener import MsgListener
from msg_talker import MsgTalker
from struct import pack
class NmeaPacketizer(MsgSink, MsgSource):
class NmeaPacketizer(MsgListener, MsgTalker):
def __init__(self):
MsgSink.__init__(self)
MsgSource.__init__(self)
MsgListener.__init__(self)
MsgTalker.__init__(self)
self.packet = b''
self.wait_sync = True
@@ -19,7 +19,7 @@ class NmeaPacketizer(MsgSink, MsgSource):
timestamp = msg.timestamp
self.wait_sync = False
if len(self.packet) > 0:
self.call_sinks(MsgContainer(name, timestamp, self.packet))
self.call_listener(MsgContainer(name, timestamp, self.packet))
self.wait_sync = True
self.packet = b''
elif not self.wait_sync: