Estimate Companion trace timeouts from planned radio transmissions
This commit is contained in:
1 parent
67a71d3a61
commit
f65a8269f3
7 files changed
+501
-16
No files matched your search
+5
-1
@@ -1449,11 +1449,15 @@ uint8_t Dispatcher::getTransmitProfileMask(const Packet* packet) const {
|
||||
}
|
||||
|
||||
uint32_t Dispatcher::getTransmitAirtime(const Packet* packet) const {
|
||||
return getTransmitAirtime(packet, packet->getRawLength());
|
||||
}
|
||||
|
||||
uint32_t Dispatcher::getTransmitAirtime(const Packet* packet, int wire_length) const {
|
||||
const uint8_t mask = getTransmitProfileMask(packet);
|
||||
uint32_t total = 0;
|
||||
for (uint8_t profile = 0; profile < 2; ++profile) {
|
||||
if (mask & (1U << profile))
|
||||
total += _radio->getProfileAirtime(profile, packet->getRawLength(), packet->tx_cr);
|
||||
total += _radio->getProfileAirtime(profile, wire_length, packet->tx_cr);
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
@@ -610,6 +610,9 @@ protected:
|
||||
// Planned fan-out before transport filters; also bounds OTA queue admission.
|
||||
uint8_t getTransmitProfileMask(const Packet* packet) const;
|
||||
uint32_t getTransmitAirtime(const Packet* packet) const;
|
||||
// TRACE callers supply final DIRECT length; createTrace()'s unset route
|
||||
// bits would otherwise add four transport-code bytes before sendDirect().
|
||||
uint32_t getTransmitAirtime(const Packet* packet, int wire_length) const;
|
||||
|
||||
public:
|
||||
void begin();
|
||||
|
||||
Reference in new issue
Block a user