Improve ACKs for repeated packets and responses

This commit is contained in:
GUVWAF
2024-11-02 19:34:21 +01:00
parent 01344835af
commit e4c98185d2
9 changed files with 58 additions and 41 deletions

View File

@@ -49,10 +49,9 @@ meshtastic_MeshPacket *RoutingModule::allocReply()
return NULL;
}
void RoutingModule::sendAckNak(meshtastic_Routing_Error err, NodeNum to, PacketId idFrom, ChannelIndex chIndex, uint8_t hopStart,
uint8_t hopLimit)
void RoutingModule::sendAckNak(meshtastic_Routing_Error err, NodeNum to, PacketId idFrom, ChannelIndex chIndex, uint8_t hopLimit)
{
auto p = allocAckNak(err, to, idFrom, chIndex, hopStart, hopLimit);
auto p = allocAckNak(err, to, idFrom, chIndex, hopLimit);
router->sendLocal(p); // we sometimes send directly to the local node
}

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;