Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thebentern committed Jan 26, 2024
1 parent f8e95c8 commit 13b1f06
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/mt_protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,10 @@ bool handle_mesh_packet(meshtastic_MeshPacket *meshPacket) {
if (text_message_callback != NULL)
text_message_callback(meshPacket->from, (const char*)meshPacket->decoded.payload.bytes);
} else if (meshPacket->decoded.portnum == meshtastic_PortNum_TELEMETRY_APP) {
meshtastic_Telemetry *telemetry = {0};
if (telemetry_callback != NULL && pb_decode_from_bytes(meshPacket->decoded.payload.bytes, meshPacket->decoded.payload.size, &meshtastic_Telemetry_msg, &telemetry))
telemetry_callback(meshPacket->from, telemetry);
meshtastic_Telemetry telemetry = {0};
if (telemetry_callback != NULL && pb_decode_from_bytes(meshPacket->decoded.payload.bytes, meshPacket->decoded.payload.size, &meshtastic_Telemetry_msg, &telemetry)) {
telemetry_callback(meshPacket->from, &telemetry);
}
} else {
// TODO handle other portnums
return false;
Expand Down

0 comments on commit 13b1f06

Please sign in to comment.