Don't send NodeInfo and DeviceTelemetry at high Tx air util

Also move airtime checking to airtime class
This commit is contained in:
GUVWAF
2023-01-11 21:52:19 +01:00
parent d7a71e46aa
commit fc775012ea
9 changed files with 43 additions and 21 deletions

View File

@@ -17,7 +17,7 @@ int32_t DeviceTelemetryModule::runOnce()
uint32_t now = millis();
if ((lastSentToMesh == 0 ||
(now - lastSentToMesh) >= getConfiguredOrDefaultMs(moduleConfig.telemetry.device_update_interval)) &&
airTime->channelUtilizationPercent() < max_channel_util_percent) {
airTime->isTxAllowedChannelUtil() && airTime->isTxAllowedAirUtil()) {
sendTelemetry();
lastSentToMesh = now;
} else if (service.isToPhoneQueueEmpty()) {