Handle repeated packet after potentially canceling previous Tx (#5330)

* Revert "Fix sending duplicate packets to PhoneAPI/MQTT (#5315)"

This reverts commit 40bc04b521.

* Handle repeated packet after potentially canceling previous Tx
This commit is contained in:
GUVWAF
2024-11-12 22:23:32 +01:00
committed by GitHub
parent 2ec3958cd8
commit e866734a25
8 changed files with 47 additions and 48 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include "PacketHistory.h"
#include "Router.h"
/**
@@ -25,11 +26,15 @@
Any entries in recentBroadcasts that are older than X seconds (longer than the
max time a flood can take) will be discarded.
*/
class FloodingRouter : public Router
class FloodingRouter : public Router, protected PacketHistory
{
private:
bool isRebroadcaster();
/** Check if we should rebroadcast this packet, and do so if needed
* @return true if rebroadcasted */
bool perhapsRebroadcast(const meshtastic_MeshPacket *p);
public:
/**
* Constructor