From 11adfe05cea06ed21b781e53095cc498aaa5253e Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Fri, 12 Apr 2024 14:06:05 -0500 Subject: [PATCH] Drop unishox2 functions from Router (#3606) --- src/mesh/Router.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 266c4f78d..3fa933bb1 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -8,9 +8,6 @@ #include "main.h" #include "mesh-pb-constants.h" #include "modules/RoutingModule.h" -extern "C" { -#include "mesh/compression/unishox2.h" -} #if !MESHTASTIC_EXCLUDE_MQTT #include "mqtt/MQTT.h" #endif @@ -332,6 +329,7 @@ bool perhapsDecode(meshtastic_MeshPacket *p) p->which_payload_variant = meshtastic_MeshPacket_decoded_tag; // change type to decoded p->channel = chIndex; // change to store the index instead of the hash + /* Not actually ever used. // Decompress if needed. jm if (p->decoded.portnum == meshtastic_PortNum_TEXT_MESSAGE_COMPRESSED_APP) { // Decompress the payload @@ -349,7 +347,7 @@ bool perhapsDecode(meshtastic_MeshPacket *p) // Switch the port from PortNum_TEXT_MESSAGE_COMPRESSED_APP to PortNum_TEXT_MESSAGE_APP p->decoded.portnum = meshtastic_PortNum_TEXT_MESSAGE_APP; - } + } */ printPacket("decoded message", p); return true; @@ -371,6 +369,7 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p) if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) { size_t numbytes = pb_encode_to_bytes(bytes, sizeof(bytes), &meshtastic_Data_msg, &p->decoded); + /* Not actually used, so save the cycles // Only allow encryption on the text message app. // TODO: Allow modules to opt into compression. if (p->decoded.portnum == meshtastic_PortNum_TEXT_MESSAGE_APP) { @@ -404,7 +403,7 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p) p->decoded.portnum = meshtastic_PortNum_TEXT_MESSAGE_COMPRESSED_APP; } - } + } */ if (numbytes > MAX_RHPACKETLEN) return meshtastic_Routing_Error_TOO_LARGE; @@ -500,4 +499,4 @@ void Router::perhapsHandleReceived(meshtastic_MeshPacket *p) handleReceived(p); packetPool.release(p); -} \ No newline at end of file +}