mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-16 07:42:37 +00:00
Refactor MQTT: only publish on LoRa Tx if packet is from us and on Rx if not (#3245)
Such that direct message to MQTT node gets published and we get rid of always rebroadcasting when MQTT is enabled Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
@@ -485,14 +485,15 @@ void MQTT::onSend(const meshtastic_MeshPacket &mp, const meshtastic_MeshPacket &
|
||||
env->channel_id = (char *)channelId;
|
||||
env->gateway_id = owner.id;
|
||||
|
||||
LOG_DEBUG("MQTT onSend - Publishing ");
|
||||
if (moduleConfig.mqtt.encryption_enabled) {
|
||||
env->packet = (meshtastic_MeshPacket *)∓
|
||||
LOG_DEBUG("encrypted message\n");
|
||||
} else {
|
||||
env->packet = (meshtastic_MeshPacket *)&mp_decoded;
|
||||
LOG_DEBUG("portnum %i message\n", env->packet->decoded.portnum);
|
||||
}
|
||||
|
||||
LOG_DEBUG("MQTT onSend - Publishing portnum %i message\n", env->packet->decoded.portnum);
|
||||
|
||||
if (moduleConfig.mqtt.proxy_to_client_enabled || this->isConnectedDirectly()) {
|
||||
// FIXME - this size calculation is super sloppy, but it will go away once we dynamically alloc meshpackets
|
||||
static uint8_t bytes[meshtastic_MeshPacket_size + 64];
|
||||
|
||||
Reference in New Issue
Block a user