fix: allow MQTT encryption_enabled with json_enabled (#3126)

* fix: allow MQTT `encryption_enabled` with `json_enabled`

* fix: copy decoded MeshPacket and release memory after use

* fix: use `packetPool` allocCopy and release methods

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
Andre K
2024-01-25 11:42:34 -03:00
committed by GitHub
parent f2c04c5504
commit d6fa190025
3 changed files with 17 additions and 18 deletions

View File

@@ -48,14 +48,14 @@ class MQTT : private concurrency::OSThread
MQTT();
/**
* Publish a packet on the glboal MQTT server.
* Publish a packet on the global MQTT server.
* This hook must be called **after** the packet is encrypted (including the channel being changed to a hash).
* @param chIndex the index of the channel for this message
*
* Note: for messages we are forwarding on the mesh that we can't find the channel for (because we don't have the keys), we
* can not forward those messages to the cloud - because no way to find a global channel ID.
*/
void onSend(const meshtastic_MeshPacket &mp, ChannelIndex chIndex);
void onSend(const meshtastic_MeshPacket &mp, const meshtastic_MeshPacket &mp_decoded, ChannelIndex chIndex);
/** Attempt to connect to server if necessary
*/