From 0141f9853deae6bc65dd4f7851e03a9403f87574 Mon Sep 17 00:00:00 2001 From: Alec Perkins Date: Wed, 7 Jan 2026 12:45:28 -0500 Subject: [PATCH] Include SNR and RSSI in logline --- modjam.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/modjam.py b/modjam.py index a708eb9..a9dbe18 100644 --- a/modjam.py +++ b/modjam.py @@ -21,6 +21,24 @@ type SpreadFactor = Literal[5,6,7,8,9,10,11,12] type CodingRate = Literal[5,6,7,8] type Station = Literal['A','B','C','D'] +class TextMessageApp(TypedDict): + portnum: Literal['TEXT_MESSAGE_APP'] + payload: bytes + bitfield: Literal[0,1] + text: str + +Packet = TypedDict('Packet', { + 'from': int, + 'to': int, + 'decoded': TextMessageApp, + 'id': int, + 'rxSnr': float, + 'rxRssi': int, + 'raw': object, + 'fromId': str | None, + 'toId': str, +}) + class Config(TypedDict): test_case_duration : int test_case_padding : int @@ -238,6 +256,8 @@ def onReceiveText (packet, interface): event = 'received', packet_id = packet['id'], text = packet['decoded']['payload'].decode('utf-8'), + rx_snr = packet['rxSnr'], + rx_rssi = packet['rxRssi'], )