mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-31 15:10:40 +00:00
Fix sending duplicate packets to PhoneAPI/MQTT (#5315)
* Fix potential duplicate packets to PhoneAPI/MQTT * Fix include error for STM32 * Fix cppcheck error
This commit is contained in:
@@ -28,8 +28,14 @@ bool RoutingModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mesh
|
||||
// FIXME - move this to a non promsicious PhoneAPI module?
|
||||
// Note: we are careful not to send back packets that started with the phone back to the phone
|
||||
if ((isBroadcast(mp.to) || isToUs(&mp)) && (mp.from != 0)) {
|
||||
printPacket("Delivering rx packet", &mp);
|
||||
service->handleFromRadio(&mp);
|
||||
// Check if it wasn't already seen, then we don't need to handle it again
|
||||
bool isRepeated = false;
|
||||
bool *rptr = &isRepeated;
|
||||
router->wasSeenRecently(&mp, false, rptr);
|
||||
if (!isRepeated) {
|
||||
printPacket("Delivering rx packet", &mp);
|
||||
service->handleFromRadio(&mp);
|
||||
}
|
||||
}
|
||||
|
||||
return false; // Let others look at this message also if they want
|
||||
|
||||
Reference in New Issue
Block a user