Revert "Add Routing_Error_NONE"

This reverts commit e1985fa0f9.
This commit is contained in:
Jonathan Bennett
2024-08-13 09:15:20 -05:00
parent bcd77c4523
commit f3fa8daedf
5 changed files with 19 additions and 20 deletions

View File

@@ -117,17 +117,20 @@ void ReliableRouter::sniffReceived(const meshtastic_MeshPacket *p, const meshtas
}
// We consider an ack to be either a !routing packet with a request ID or a routing packet with !error
if ((c && (c->error_reason == meshtastic_Routing_Error_NONE || c->error_reason == meshtastic_Routing_Error_NONE_PKI)) ||
!c) {
LOG_DEBUG("Received an ack for 0x%x, stopping retransmissions\n", p->decoded.request_id);
stopRetransmission(p->to, p->decoded.request_id);
// } else if (c && (c->error_reason == meshtastic_Routing_Error_NO_CHANNEL)) {
// noop?
} else if (c &&
(c->error_reason != meshtastic_Routing_Error_NONE && c->error_reason != meshtastic_Routing_Error_NONE_PKI)) {
PacketId ackId = ((c && c->error_reason == meshtastic_Routing_Error_NONE) || !c) ? p->decoded.request_id : 0;
LOG_DEBUG("Received a nak for 0x%x, stopping retransmissions\n", p->decoded.request_id);
stopRetransmission(p->to, p->decoded.request_id);
// A nak is a routing packt that has an error code
PacketId nakId = (c && c->error_reason != meshtastic_Routing_Error_NONE) ? p->decoded.request_id : 0;
// We intentionally don't check wasSeenRecently, because it is harmless to delete non existent retransmission records
if (ackId || nakId) {
if (ackId) {
LOG_DEBUG("Received an ack for 0x%x, stopping retransmissions\n", ackId);
stopRetransmission(p->to, ackId);
} else {
LOG_DEBUG("Received a nak for 0x%x, stopping retransmissions\n", nakId);
stopRetransmission(p->to, nakId);
}
}
}