Skip to content

Commit 542f99b

Browse files
committed
handle the new LogRecord protobufs
(backwards/forwards compatible) with old firmware
1 parent dabb4ea commit 542f99b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

meshtastic/mesh_interface.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ def _handleLogLine(self, line: str) -> None:
150150
"""Handle a line of log output from the device."""
151151
pub.sendMessage("meshtastic.log.line", line=line, interface=self)
152152

153+
def _handleLogRecord(self, record: mesh_pb2.LogRecord) -> None:
154+
"""Handle a log record which was received encapsulated in a protobuf."""
155+
# For now we just try to format the line as if it had come in over the serial port
156+
self._handleLogLine(record.message)
157+
153158
def showInfo(self, file=sys.stdout) -> str: # pylint: disable=W0613
154159
"""Show human readable summary about this object"""
155160
owner = f"Owner: {self.getLongName()} ({self.getShortName()})"
@@ -927,7 +932,8 @@ def _handleFromRadio(self, fromRadioBytes):
927932
self._handleChannel(fromRadio.channel)
928933
elif fromRadio.HasField("packet"):
929934
self._handlePacketFromRadio(fromRadio.packet)
930-
935+
elif fromRadio.HasField("log_record"):
936+
self._handleLogRecord(fromRadio.log_record)
931937
elif fromRadio.HasField("queueStatus"):
932938
self._handleQueueStatusFromRadio(fromRadio.queueStatus)
933939

0 commit comments

Comments
 (0)