mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-23 03:00:56 +00:00
* RoutingModule::sendAckNak takes ackWantsAck arg to set want_ack on the ACK itself * Use reliable delivery for traceroute requests (which will be copied to traceroute responses by setReplyTo) * Update ReliableRouter::sniffReceived to use ReliableRouter::shouldSuccessAckWithWantAck * Use isFromUs * Update MockRoutingModule::sendAckNak to include ackWantsAck argument (currently ignored) --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "NextHopRouter.h"
|
|
|
|
/**
|
|
* This is a mixin that extends Router with the ability to do (one hop only) reliable message sends.
|
|
*/
|
|
class ReliableRouter : public NextHopRouter
|
|
{
|
|
public:
|
|
/**
|
|
* Constructor
|
|
*
|
|
*/
|
|
// ReliableRouter();
|
|
|
|
/**
|
|
* Send a packet on a suitable interface. This routine will
|
|
* later free() the packet to pool. This routine is not allowed to stall.
|
|
* If the txmit queue is full it might return an error
|
|
*/
|
|
virtual ErrorCode send(meshtastic_MeshPacket *p) override;
|
|
|
|
protected:
|
|
/**
|
|
* Look for acks/naks or someone retransmitting us
|
|
*/
|
|
virtual void sniffReceived(const meshtastic_MeshPacket *p, const meshtastic_Routing *c) override;
|
|
|
|
/**
|
|
* We hook this method so we can see packets before FloodingRouter says they should be discarded
|
|
*/
|
|
virtual bool shouldFilterReceived(const meshtastic_MeshPacket *p) override;
|
|
|
|
private:
|
|
/**
|
|
* Should this packet be ACKed with a want_ack for reliable delivery?
|
|
*/
|
|
bool shouldSuccessAckWithWantAck(const meshtastic_MeshPacket *p);
|
|
}; |