mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-09 23:24:43 +00:00
Uplink to MQTT after potentially altering content (#3646)
Mainly for traceroute module now Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
parent
e4b5f2ce14
commit
64edfb76e0
@ -465,21 +465,22 @@ void Router::handleReceived(meshtastic_MeshPacket *p, RxSource src)
|
|||||||
cancelSending(p->from, p->id);
|
cancelSending(p->from, p->id);
|
||||||
skipHandle = true;
|
skipHandle = true;
|
||||||
}
|
}
|
||||||
#if !MESHTASTIC_EXCLUDE_MQTT
|
|
||||||
// Publish received message to MQTT if we're not the original transmitter of the packet
|
|
||||||
if (!skipHandle && moduleConfig.mqtt.enabled && getFrom(p) != nodeDB->getNodeNum() && mqtt)
|
|
||||||
mqtt->onSend(*p_encrypted, *p, p->channel);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
printPacket("packet decoding failed or skipped (no PSK?)", p);
|
printPacket("packet decoding failed or skipped (no PSK?)", p);
|
||||||
}
|
}
|
||||||
|
|
||||||
packetPool.release(p_encrypted); // Release the encrypted packet
|
|
||||||
|
|
||||||
// call modules here
|
// call modules here
|
||||||
if (!skipHandle)
|
if (!skipHandle) {
|
||||||
MeshModule::callModules(*p, src);
|
MeshModule::callModules(*p, src);
|
||||||
|
|
||||||
|
#if !MESHTASTIC_EXCLUDE_MQTT
|
||||||
|
// After potentially altering it, publish received message to MQTT if we're not the original transmitter of the packet
|
||||||
|
if (decoded && moduleConfig.mqtt.enabled && getFrom(p) != nodeDB->getNodeNum() && mqtt)
|
||||||
|
mqtt->onSend(*p_encrypted, *p, p->channel);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
packetPool.release(p_encrypted); // Release the encrypted packet
|
||||||
}
|
}
|
||||||
|
|
||||||
void Router::perhapsHandleReceived(meshtastic_MeshPacket *p)
|
void Router::perhapsHandleReceived(meshtastic_MeshPacket *p)
|
||||||
|
Loading…
Reference in New Issue
Block a user