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

+4 -2
View File
@@ -442,11 +442,13 @@ int SensorMesh::calcRxDelay(float score, uint32_t air_time) const {
}
uint32_t SensorMesh::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, 6)*t;
}
uint32_t SensorMesh::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, 6)*t;
}