- UbxReceiver: added catch all

This commit is contained in:
2026-03-17 20:01:39 +01:00
parent 39f3e688b0
commit ce0fa22c58
2 changed files with 11 additions and 5 deletions
+5 -2
View File
@@ -3,7 +3,7 @@ from msg_sink import MsgSink
from ubx.ubx import frame_parse, frame_parse_hdr
class UbxReceiver(MsgSink):
def __init__(self, name: str, mclass: int, mid: int):
def __init__(self, name: str, mclass: int|None = None, mid: int|None = None):
MsgSink.__init__(self)
self.name = name
self.mclass = mclass
@@ -16,5 +16,8 @@ class UbxReceiver(MsgSink):
def is_msg(self, msg: MsgContainer):
hdr = frame_parse_hdr(msg.data)
if hdr is not None:
return self.mclass == hdr.mclass and self.mid == hdr.mid
if self.mclass is not None and self.mid is not None:
return self.mclass == hdr.mclass and self.mid == hdr.mid
else:
return True
return False