From f37abe8f0f46fe129b5c92b3b2e4cdaefeecdf45 Mon Sep 17 00:00:00 2001 From: GUVWAF Date: Fri, 8 Nov 2024 21:42:54 +0100 Subject: [PATCH] Also when want_ack is set, we should try to retransmit --- src/mesh/NextHopRouter.cpp | 6 +++--- src/mesh/PacketHistory.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mesh/NextHopRouter.cpp b/src/mesh/NextHopRouter.cpp index 1ce998720..df86866e9 100644 --- a/src/mesh/NextHopRouter.cpp +++ b/src/mesh/NextHopRouter.cpp @@ -20,9 +20,9 @@ ErrorCode NextHopRouter::send(meshtastic_MeshPacket *p) p->next_hop = getNextHop(p->to, p->relay_node); // set the next hop LOG_DEBUG("Setting next hop for packet with dest %x to %x", p->to, p->next_hop); - // If it's from us, ReliableRouter already handles retransmissions. If a next hop is set and hop limit is not 0, start - // retransmissions - if (!isFromUs(p) && p->next_hop != NO_NEXT_HOP_PREFERENCE && p->hop_limit > 0) + // If it's from us, ReliableRouter already handles retransmissions. If a next hop is set and hop limit is not 0 or want_ack is + // set, start retransmissions + if (!isFromUs(p) && p->next_hop != NO_NEXT_HOP_PREFERENCE && (p->hop_limit > 0 || p->want_ack)) startRetransmission(packetPool.allocCopy(*p)); // start retransmission for relayed packet return Router::send(p); diff --git a/src/mesh/PacketHistory.cpp b/src/mesh/PacketHistory.cpp index 5af528999..589d3b74f 100644 --- a/src/mesh/PacketHistory.cpp +++ b/src/mesh/PacketHistory.cpp @@ -29,7 +29,7 @@ bool PacketHistory::wasSeenRecently(const meshtastic_MeshPacket *p, bool withUpd r.rxTimeMsec = millis(); r.next_hop = p->next_hop; r.relayed_by[0] = p->relay_node; - LOG_INFO("Add relayed_by 0x%x for id=0x%x", p->relay_node, r.id); + // LOG_INFO("Add relayed_by 0x%x for id=0x%x", p->relay_node, r.id); auto found = recentPackets.find(r); bool seenRecently = (found != recentPackets.end()); // found not equal to .end() means packet was seen recently @@ -56,7 +56,7 @@ bool PacketHistory::wasSeenRecently(const meshtastic_MeshPacket *p, bool withUpd if (found->sender != nodeDB->getNodeNum() && found->next_hop != NO_NEXT_HOP_PREFERENCE && p->next_hop == NO_NEXT_HOP_PREFERENCE && found->next_hop != ourRelayID && p->relay_node != 0 && wasRelayer(p->relay_node, found) && !wasRelayer(ourRelayID, found) && !wasRelayer(found->next_hop, found)) { - LOG_WARN("Fallback to flooding, consider unseen relay_node=0x%x", p->relay_node); + LOG_INFO("Fallback to flooding, consider unseen relay_node=0x%x", p->relay_node); seenRecently = false; } } @@ -159,4 +159,4 @@ void PacketHistory::removeRelayer(const uint8_t relayer, const uint32_t id, cons recentPackets.erase(found); recentPackets.insert(r); -} +} \ No newline at end of file