mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-30 19:29:17 +00:00
Merge pull request #1147 from mc-hamster/master
rangeTestPlugin - only send if channelUtilization is less than 25%
This commit is contained in:
commit
d26549c7c2
@ -4,6 +4,7 @@
|
|||||||
#include "PowerFSM.h"
|
#include "PowerFSM.h"
|
||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
#include "Router.h"
|
#include "Router.h"
|
||||||
|
#include "airtime.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "gps/GeoCoord.h"
|
#include "gps/GeoCoord.h"
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
@ -73,7 +74,13 @@ int32_t RangeTestPlugin::runOnce()
|
|||||||
DEBUG_MSG("gpsStatus->getHasLock() %d\n", gpsStatus->getHasLock());
|
DEBUG_MSG("gpsStatus->getHasLock() %d\n", gpsStatus->getHasLock());
|
||||||
DEBUG_MSG("pref.fixed_position() %d\n", radioConfig.preferences.fixed_position);
|
DEBUG_MSG("pref.fixed_position() %d\n", radioConfig.preferences.fixed_position);
|
||||||
|
|
||||||
|
// Only send packets if the channel is less than 25% utilized.
|
||||||
|
if (airTime->channelUtilizationPercent() < 25) {
|
||||||
rangeTestPluginRadio->sendPayload();
|
rangeTestPluginRadio->sendPayload();
|
||||||
|
} else {
|
||||||
|
DEBUG_MSG("rangeTest - Channel utilization is too high. Skipping this opportunity to send and will retry later.\n");
|
||||||
|
}
|
||||||
|
|
||||||
return (senderHeartbeat);
|
return (senderHeartbeat);
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, we're a receiver.
|
// Otherwise, we're a receiver.
|
||||||
|
Loading…
Reference in New Issue
Block a user