mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-01 18:29:56 +00:00
Update retransmission timer based on client offset (#2583)
This commit is contained in:
parent
4ef61f0f15
commit
b9ad274104
@ -196,8 +196,9 @@ uint32_t RadioInterface::getRetransmissionMsec(const meshtastic_MeshPacket *p)
|
|||||||
// LOG_DEBUG("Waiting for flooding message with airtime %d and slotTime is %d\n", packetAirtime, slotTimeMsec);
|
// LOG_DEBUG("Waiting for flooding message with airtime %d and slotTime is %d\n", packetAirtime, slotTimeMsec);
|
||||||
float channelUtil = airTime->channelUtilizationPercent();
|
float channelUtil = airTime->channelUtilizationPercent();
|
||||||
uint8_t CWsize = map(channelUtil, 0, 100, CWmin, CWmax);
|
uint8_t CWsize = map(channelUtil, 0, 100, CWmin, CWmax);
|
||||||
// Assuming we pick max. of CWsize and there will be a receiver with SNR at half the range
|
// Assuming we pick max. of CWsize and there will be a client with SNR at half the range
|
||||||
return 2 * packetAirtime + (pow(2, CWsize) + pow(2, int((CWmax + CWmin) / 2))) * slotTimeMsec + PROCESSING_TIME_MSEC;
|
return 2 * packetAirtime + (pow(2, CWsize) + 2 * CWmax + pow(2, int((CWmax + CWmin) / 2))) * slotTimeMsec +
|
||||||
|
PROCESSING_TIME_MSEC;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The delay to use when we want to send something */
|
/** The delay to use when we want to send something */
|
||||||
|
Loading…
Reference in New Issue
Block a user