quick fix so Telemetry/position works
This commit is contained in:
parent
9e06503869
commit
b9d09f2209
1 changed files with 15 additions and 2 deletions
17
main.py
17
main.py
|
@ -34,8 +34,21 @@ def onReceive(packet, interface):
|
||||||
if 'TEXT_MESSAGE_APP' in packet['decoded']:
|
if 'TEXT_MESSAGE_APP' in packet['decoded']:
|
||||||
print('TEXT_MESSAGE_APP')
|
print('TEXT_MESSAGE_APP')
|
||||||
|
|
||||||
if 'TELEMTRY_APP' in packet['decoded']:
|
if 'portnum' in decoded:
|
||||||
print('Telemetry found. Ignore')
|
app_name = decoded['portnum']
|
||||||
|
if app_name == 'TELEMETRY_APP':
|
||||||
|
with open(MESSAGE_FILE, 'w') as file:
|
||||||
|
file.write(f"TELEMETRY_APP: ")
|
||||||
|
file.write(str(packet))
|
||||||
|
print('Telemetry found')
|
||||||
|
elif app_name == 'POSITION_APP':
|
||||||
|
with open(MESSAGE_FILE, 'w') as file:
|
||||||
|
file.write(f"POSITION_APP: ")
|
||||||
|
file.write(str(packet))
|
||||||
|
print('Position found')
|
||||||
|
else:
|
||||||
|
print('Not a recodnized portnum message')
|
||||||
|
print(packet)
|
||||||
|
|
||||||
if 'decoded' in packet and 'text' in packet['decoded']:
|
if 'decoded' in packet and 'text' in packet['decoded']:
|
||||||
print(packet)
|
print(packet)
|
||||||
|
|
Loading…
Reference in a new issue