Improve ACK logic for responses and repeated packets (#5232)

* Don't send ACKs to responses over multiple hops

* Move repeated sending logic to `wasSeenRecently()`

* Add exception for simulator for duplicate packets from PhoneAPI

* Add short debug message
This commit is contained in:
GUVWAF
2024-11-03 13:21:45 +01:00
committed by GitHub
parent 1bec23b6bb
commit da7424a604
9 changed files with 34 additions and 34 deletions

View File

@@ -13,8 +13,7 @@ class RoutingModule : public ProtobufModule<meshtastic_Routing>
*/
RoutingModule();
void sendAckNak(meshtastic_Routing_Error err, NodeNum to, PacketId idFrom, ChannelIndex chIndex, uint8_t hopStart = 0,
uint8_t hopLimit = 0);
void sendAckNak(meshtastic_Routing_Error err, NodeNum to, PacketId idFrom, ChannelIndex chIndex, uint8_t hopLimit = 0);
// Given the hopStart and hopLimit upon reception of a request, return the hop limit to use for the response
uint8_t getHopLimitForResponse(uint8_t hopStart, uint8_t hopLimit);
@@ -36,4 +35,4 @@ class RoutingModule : public ProtobufModule<meshtastic_Routing>
virtual bool wantPacket(const meshtastic_MeshPacket *p) override { return true; }
};
extern RoutingModule *routingModule;
extern RoutingModule *routingModule;