Files
NmeaClient/msg_source.py
T
jens c6c1f26f32 - added Msg frame work with Msg container , Msg sources, Msg sinks
- added filter by message type to nmea receiver
- show case new features in MultiClient.main()
2026-03-08 17:46:25 +01:00

16 lines
371 B
Python

from abc import ABC
from msg_montainer import MsgContainer
from msg_sink import MsgSink
class MsgSource(ABC):
def __init__(self):
self.sinks = {}
def register_recv(self, name: str, sink: MsgSink):
self.sinks[name] = {'sink': sink}
def call_sinks(self, msg: MsgContainer):
if msg.name in self.sinks:
sink = self.sinks[msg.name]['sink']
sink.on_recv(msg)