mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-27 18:31:37 +00:00
Drop unishox2 functions from Router (#3606)
This commit is contained in:
parent
b4009f9f2f
commit
11adfe05ce
@ -8,9 +8,6 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "mesh-pb-constants.h"
|
#include "mesh-pb-constants.h"
|
||||||
#include "modules/RoutingModule.h"
|
#include "modules/RoutingModule.h"
|
||||||
extern "C" {
|
|
||||||
#include "mesh/compression/unishox2.h"
|
|
||||||
}
|
|
||||||
#if !MESHTASTIC_EXCLUDE_MQTT
|
#if !MESHTASTIC_EXCLUDE_MQTT
|
||||||
#include "mqtt/MQTT.h"
|
#include "mqtt/MQTT.h"
|
||||||
#endif
|
#endif
|
||||||
@ -332,6 +329,7 @@ bool perhapsDecode(meshtastic_MeshPacket *p)
|
|||||||
p->which_payload_variant = meshtastic_MeshPacket_decoded_tag; // change type to decoded
|
p->which_payload_variant = meshtastic_MeshPacket_decoded_tag; // change type to decoded
|
||||||
p->channel = chIndex; // change to store the index instead of the hash
|
p->channel = chIndex; // change to store the index instead of the hash
|
||||||
|
|
||||||
|
/* Not actually ever used.
|
||||||
// Decompress if needed. jm
|
// Decompress if needed. jm
|
||||||
if (p->decoded.portnum == meshtastic_PortNum_TEXT_MESSAGE_COMPRESSED_APP) {
|
if (p->decoded.portnum == meshtastic_PortNum_TEXT_MESSAGE_COMPRESSED_APP) {
|
||||||
// Decompress the payload
|
// 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
|
// Switch the port from PortNum_TEXT_MESSAGE_COMPRESSED_APP to PortNum_TEXT_MESSAGE_APP
|
||||||
p->decoded.portnum = meshtastic_PortNum_TEXT_MESSAGE_APP;
|
p->decoded.portnum = meshtastic_PortNum_TEXT_MESSAGE_APP;
|
||||||
}
|
} */
|
||||||
|
|
||||||
printPacket("decoded message", p);
|
printPacket("decoded message", p);
|
||||||
return true;
|
return true;
|
||||||
@ -371,6 +369,7 @@ meshtastic_Routing_Error perhapsEncode(meshtastic_MeshPacket *p)
|
|||||||
if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) {
|
if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) {
|
||||||
size_t numbytes = pb_encode_to_bytes(bytes, sizeof(bytes), &meshtastic_Data_msg, &p->decoded);
|
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.
|
// Only allow encryption on the text message app.
|
||||||
// TODO: Allow modules to opt into compression.
|
// TODO: Allow modules to opt into compression.
|
||||||
if (p->decoded.portnum == meshtastic_PortNum_TEXT_MESSAGE_APP) {
|
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;
|
p->decoded.portnum = meshtastic_PortNum_TEXT_MESSAGE_COMPRESSED_APP;
|
||||||
}
|
}
|
||||||
}
|
} */
|
||||||
|
|
||||||
if (numbytes > MAX_RHPACKETLEN)
|
if (numbytes > MAX_RHPACKETLEN)
|
||||||
return meshtastic_Routing_Error_TOO_LARGE;
|
return meshtastic_Routing_Error_TOO_LARGE;
|
||||||
|
Loading…
Reference in New Issue
Block a user