diff --git a/src/mesh/ProtobufModule.h b/src/mesh/ProtobufModule.h index d87bb47c34..13208a61ea 100644 --- a/src/mesh/ProtobufModule.h +++ b/src/mesh/ProtobufModule.h @@ -73,7 +73,12 @@ template class ProtobufModule : protected SinglePortModule // it would be better to update even if the message was destined to others. auto &p = mp.decoded; - LOG_INFO("Received %s from=0x%0x, id=0x%x, portnum=%d, payloadlen=%d\n", name, mp.from, mp.id, p.portnum, p.payload.size); + LOG_INFO("Received %s from=0x%0x, id=0x%x, portnum=%d, payloadlen=%d, bytes:", name, mp.from, mp.id, p.portnum, + p.payload.size); + for (int i = 0; i < p.payload.size; i++) { + LOG_INFO(" %02x", p.payload.bytes[i]); + } + LOG_INFO("\n"); T scratch; T *decoded = NULL; diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 7c739b8f28..a9f4397325 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -327,6 +327,12 @@ bool perhapsDecode(meshtastic_MeshPacket *p) } else if (p->decoded.portnum == meshtastic_PortNum_UNKNOWN_APP) { LOG_ERROR("Invalid portnum (bad psk?)!\n"); } else { + LOG_INFO("Decoded %d bytes:", rawSize); + for (int i = 0; i < rawSize; i++) { + LOG_INFO(" %02x", bytes[i]); + } + LOG_INFO("\n"); + // parsing was successful p->which_payload_variant = meshtastic_MeshPacket_decoded_tag; // change type to decoded p->channel = chIndex; // change to store the index instead of the hash @@ -369,6 +375,11 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p) // If the packet is not yet encrypted, do so now if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) { size_t numbytes = pb_encode_to_bytes(bytes, sizeof(bytes), &meshtastic_Data_msg, &p->decoded); + LOG_INFO("Encoded %d bytes:", numbytes); + for (int i = 0; i < numbytes; i++) { + LOG_INFO(" %02x", bytes[i]); + } + LOG_INFO("\n"); // Only allow encryption on the text message app. // TODO: Allow modules to opt into compression.