added the preamble update into get est airtime as a prevention for false airtime calcs. Left update in the startsendraw as a safety, but should not be used under normal circumstances
This commit is contained in:
@@ -139,6 +139,11 @@ int RadioLibWrapper::recvRaw(uint8_t* bytes, int sz) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t RadioLibWrapper::getEstAirtimeFor(int len_bytes) {
|
uint32_t RadioLibWrapper::getEstAirtimeFor(int len_bytes) {
|
||||||
|
uint8_t sf = getSpreadingFactor();
|
||||||
|
if (sf != _preamble_sf) {
|
||||||
|
_preamble_sf = sf;
|
||||||
|
_radio->setPreambleLength(preambleLengthForSF(sf)); // sync preamble before airtime estimate
|
||||||
|
}
|
||||||
return _radio->getTimeOnAir(len_bytes) / 1000;
|
return _radio->getTimeOnAir(len_bytes) / 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user