Only use router->send

This commit is contained in:
Ben Meadors 2025-01-11 06:26:10 -06:00
parent 473055d4e1
commit 1a91507fd8

View File

@ -275,8 +275,7 @@ ErrorCode Router::send(meshtastic_MeshPacket *p)
return encodeResult; // FIXME - this isn't a valid ErrorCode
}
#if HAS_UDP_MULTICAST
if (udpThread && isFromUs(p) &&
config.network.enabled_protocols & meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST) {
if (udpThread && config.network.enabled_protocols & meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST) {
udpThread->onSend(const_cast<meshtastic_MeshPacket *>(p));
}
#endif
@ -630,12 +629,6 @@ void Router::handleReceived(meshtastic_MeshPacket *p, RxSource src)
// After potentially altering it, publish received message to MQTT if we're not the original transmitter of the packet
if ((decoded || p_encrypted->pki_encrypted) && moduleConfig.mqtt.enabled && !isFromUs(p) && mqtt)
mqtt->onSend(*p_encrypted, *p, p->channel);
#endif
#if HAS_UDP_MULTICAST
if ((decoded || p_encrypted->pki_encrypted) && udpThread &&
config.network.enabled_protocols & meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST) {
udpThread->onSend(const_cast<meshtastic_MeshPacket *>(p_encrypted));
}
#endif
}