Added more event types

This commit is contained in:
Dionysus 2024-05-06 22:34:03 -04:00
parent 04c71061da
commit 337c701835
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE

View File

@ -65,6 +65,12 @@ def decode_encrypted(message_packet):
logging.info('Received text message:')
logging.info(text)
elif message_packet.decoded.portnum == portnums_pb2.MAP_REPORT_APP:
pos = mesh_pb2.Position()
pos.ParseFromString(message_packet.decoded.payload)
logging.info('Received map report:')
logging.info(pos)
elif message_packet.decoded.portnum == portnums_pb2.NODEINFO_APP:
info = mesh_pb2.User()
info.ParseFromString(message_packet.decoded.payload)
@ -117,7 +123,7 @@ def on_message(client, userdata, msg):
service_envelope = mqtt_pb2.ServiceEnvelope()
try:
# Parse the message payload
# Parse the message payload
service_envelope.ParseFromString(msg.payload)
logging.info('Received a packet:')
@ -126,7 +132,7 @@ def on_message(client, userdata, msg):
# Extract the message packet from the service envelope
message_packet = service_envelope.packet
except Exception as e:
except Exception as e:
#logging.error(f'Failed to parse message: {str(e)}')
return