Include SNR and RSSI in logline
This commit is contained in:
parent
75f92bf24d
commit
0141f9853d
1 changed files with 20 additions and 0 deletions
20
modjam.py
20
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'],
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue