sforkowany z mirror/meshtastic-firmware
Merge branch 'master' into master
commit
bbf3091889
|
@ -17,7 +17,7 @@ ErrorCode FloodingRouter::send(MeshPacket *p)
|
|||
return Router::send(p);
|
||||
}
|
||||
|
||||
bool FloodingRouter::shouldFilterReceived(const MeshPacket *p)
|
||||
bool FloodingRouter::shouldFilterReceived(MeshPacket *p)
|
||||
{
|
||||
if (wasSeenRecently(p)) { // Note: this will also add a recent packet record
|
||||
printPacket("Ignoring incoming msg, because we've already seen it", p);
|
||||
|
|
|
@ -50,7 +50,7 @@ class FloodingRouter : public Router, protected PacketHistory
|
|||
* Called immedately on receiption, before any further processing.
|
||||
* @return true to abandon the packet
|
||||
*/
|
||||
virtual bool shouldFilterReceived(const MeshPacket *p);
|
||||
virtual bool shouldFilterReceived(MeshPacket *p);
|
||||
|
||||
/**
|
||||
* Look for broadcasts we need to rebroadcast
|
||||
|
|
|
@ -26,7 +26,7 @@ ErrorCode ReliableRouter::send(MeshPacket *p)
|
|||
return FloodingRouter::send(p);
|
||||
}
|
||||
|
||||
bool ReliableRouter::shouldFilterReceived(const MeshPacket *p)
|
||||
bool ReliableRouter::shouldFilterReceived(MeshPacket *p)
|
||||
{
|
||||
// Note: do not use getFrom() here, because we want to ignore messages sent from phone
|
||||
if (p->to == NODENUM_BROADCAST && p->from == getNodeNum()) {
|
||||
|
@ -54,6 +54,17 @@ bool ReliableRouter::shouldFilterReceived(const MeshPacket *p)
|
|||
}
|
||||
}
|
||||
|
||||
/* send acks for repeated packets that want acks and are destined for us
|
||||
* this way if an ACK is dropped and a packet is resent we'll ACK the resent packet
|
||||
* make sure wasSeenRecently _doesn't_ update
|
||||
* finding the channel requires decoding the packet. */
|
||||
if (p->want_ack && (p->to == getNodeNum()) && wasSeenRecently(p, false)) {
|
||||
if (perhapsDecode(p)) {
|
||||
sendAckNak(Routing_Error_NONE, getFrom(p), p->id, p->channel);
|
||||
DEBUG_MSG("acking a repeated want_ack packet\n");
|
||||
}
|
||||
}
|
||||
|
||||
return FloodingRouter::shouldFilterReceived(p);
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ class ReliableRouter : public FloodingRouter
|
|||
/**
|
||||
* We hook this method so we can see packets before FloodingRouter says they should be discarded
|
||||
*/
|
||||
virtual bool shouldFilterReceived(const MeshPacket *p);
|
||||
virtual bool shouldFilterReceived(MeshPacket *p);
|
||||
|
||||
/**
|
||||
* Add p to the list of packets to retransmit occasionally. We will free it once we stop retransmitting.
|
||||
|
|
|
@ -90,7 +90,7 @@ class Router : protected concurrency::OSThread
|
|||
* Called immedately on receiption, before any further processing.
|
||||
* @return true to abandon the packet
|
||||
*/
|
||||
virtual bool shouldFilterReceived(const MeshPacket *p) { return false; }
|
||||
virtual bool shouldFilterReceived(MeshPacket *p) { return false; }
|
||||
|
||||
/**
|
||||
* Every (non duplicate) packet this node receives will be passed through this method. This allows subclasses to
|
||||
|
|
Ładowanie…
Reference in New Issue