- 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()
This commit is contained in:
2026-03-08 17:46:25 +01:00
parent 1b9d07db7f
commit c6c1f26f32
7 changed files with 134 additions and 18 deletions
+20
View File
@@ -0,0 +1,20 @@
from urllib.parse import to_bytes
from msg_montainer import MsgContainer
from msg_sink import MsgSink
import re
class NmeaReceiver(MsgSink):
def __init__(self):
MsgSink.__init__(self)
self.filters_msg_type = []
def filter_by_msg_type(self, msg_type: str):
self.filters_msg_type.append(msg_type)
def on_recv(self, msg: MsgContainer):
data = msg.data.decode(encoding="utf-8")
for pattern in self.filters_msg_type:
if re.match(pattern, data):
print(f"{self}: on_receive: {msg}")