Extract default intervals and coalesce methods into their own file / static class methods (#3425)

* Extract default intervals and coalesce methods into their own file / static class methods

* Missed pax

* Still managed to miss one
This commit is contained in:
Ben Meadors
2024-03-17 08:18:30 -05:00
committed by GitHub
parent bb57ccfc9e
commit 0d1d79b6d1
20 changed files with 103 additions and 73 deletions

View File

@@ -1,8 +1,8 @@
#include "configuration.h"
#if defined(ARCH_ESP32)
#include "Default.h"
#include "MeshService.h"
#include "PaxcounterModule.h"
#include <assert.h>
PaxcounterModule *paxcounterModule;
@@ -82,9 +82,9 @@ int32_t PaxcounterModule::runOnce()
if (isActive()) {
if (firstTime) {
firstTime = false;
LOG_DEBUG(
"Paxcounter starting up with interval of %d seconds\n",
getConfiguredOrDefault(moduleConfig.paxcounter.paxcounter_update_interval, default_broadcast_interval_secs));
LOG_DEBUG("Paxcounter starting up with interval of %d seconds\n",
Default::getConfiguredOrDefault(moduleConfig.paxcounter.paxcounter_update_interval,
default_broadcast_interval_secs));
struct libpax_config_t configuration;
libpax_default_config(&configuration);
@@ -104,7 +104,8 @@ int32_t PaxcounterModule::runOnce()
} else {
sendInfo(NODENUM_BROADCAST);
}
return getConfiguredOrDefaultMs(moduleConfig.paxcounter.paxcounter_update_interval, default_broadcast_interval_secs);
return Default::getConfiguredOrDefaultMs(moduleConfig.paxcounter.paxcounter_update_interval,
default_broadcast_interval_secs);
} else {
return disable();
}