Add relaying node and RSSI/SNR to the implicit-ack routing packet (#10767)

When we overhear another node rebroadcast one of our own packets, we
generate an implicit-ack ROUTING packet for the local sending process.
That ack is delivered locally to the phone, so pass the overheard
rebroadcast as a relay source and copy its relay_node and the rx_rssi /
rx_snr we heard it at onto the ack. This lets the connected client see
which node relayed our packet and the link quality, instead of only
learning that the packet was repeated.

allocAckNak / sendAckNak gain an optional relaySource parameter. The
ack is sent to ourselves (to == us), so Router::send() is bypassed and
does not overwrite these fields with our own.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
authored and GitHub committed 2026-08-26 22:01:57 +00:00
1 parent d2eb6b0a2c
commit 9461670f49
7 files changed
+22 -12

No files matched your search

+4 -4
View File
@@ -48,9 +48,9 @@ meshtastic_MeshPacket *RoutingModule::allocReply()
}
void RoutingModule::sendAckNak(meshtastic_Routing_Error err, NodeNum to, PacketId idFrom, ChannelIndex chIndex, uint8_t hopLimit,
bool ackWantsAck)
bool ackWantsAck, const meshtastic_MeshPacket *relaySource)
{
auto p = allocAckNak(err, to, idFrom, chIndex, hopLimit);
auto p = allocAckNak(err, to, idFrom, chIndex, hopLimit, relaySource);
if (!p)
return;
@@ -81,9 +81,9 @@ uint8_t RoutingModule::getHopLimitForResponse(const meshtastic_MeshPacket &mp)
}
meshtastic_MeshPacket *RoutingModule::allocAckNak(meshtastic_Routing_Error err, NodeNum to, PacketId idFrom, ChannelIndex chIndex,
uint8_t hopLimit)
uint8_t hopLimit, const meshtastic_MeshPacket *relaySource)
{
return MeshModule::allocAckNak(err, to, idFrom, chIndex, hopLimit);
return MeshModule::allocAckNak(err, to, idFrom, chIndex, hopLimit, relaySource);
}
RoutingModule::RoutingModule() : ProtobufModule("routing", meshtastic_PortNum_ROUTING_APP, &meshtastic_Routing_msg)