Use packet radio settings for forwarding delays

This commit is contained in:
mikecarper committed 2026-10-16 04:43:12 -07:00
1 parent fc91b6e75c
commit 21ab0b9d40
6 files changed
+224 -11

No files matched your search

+6 -4
View File
@@ -1543,8 +1543,8 @@ int MyMesh::calcRxDelayForPacket(const mesh::Packet* packet, float score,
uint32_t MyMesh::getSlowFloodRuleRetransmitDelay(
const mesh::Packet* packet) {
uint32_t airtime = _radio->getEstAirtimeFor(
packet->getPathByteLen() + packet->payload_len + 2);
uint32_t airtime = _radio->getProfileAirtime(
packet->radio_profile, packet->getRawLength(), packet->tx_cr);
uint32_t max_delay = FloodFilterPolicy::slowScopeMaxDelay(airtime);
return getRNG()->nextInt(0, max_delay + 1);
}
@@ -1560,11 +1560,13 @@ const char *MyMesh::getLogDateTime() {
}
uint32_t MyMesh::getRetransmitDelay(const mesh::Packet *packet) {
uint32_t t = (_radio->getEstAirtimeFor(packet->getPathByteLen() + packet->payload_len + 2) * _prefs.tx_delay_factor);
uint32_t t = (_radio->getProfileAirtime(packet->radio_profile,
packet->getRawLength(), packet->tx_cr) * _prefs.tx_delay_factor);
return getRNG()->nextInt(0, 5*t + 1);
}
uint32_t MyMesh::getDirectRetransmitDelay(const mesh::Packet *packet) {
uint32_t t = (_radio->getEstAirtimeFor(packet->getPathByteLen() + packet->payload_len + 2) * _prefs.direct_tx_delay_factor);
uint32_t t = (_radio->getProfileAirtime(packet->radio_profile,
packet->getRawLength(), packet->tx_cr) * _prefs.direct_tx_delay_factor);
return getRNG()->nextInt(0, 5*t + 1);
}