Refactor advert timer calculation in MyMesh and SensorMesh for type consistency
- Updated the advert timer calculation to explicitly cast the advert interval to an integer type, ensuring consistent behavior across different mesh implementations. - Enhanced the savePrefs function in CommonCLI to trigger advert timer updates when the advert interval changes, improving responsiveness to user configuration changes. - Removed the aggressive 4-hour health check in MQTTBridge to prevent connection instability, allowing the MQTT client library to manage connection health internally.
This commit is contained in:
1 parent
2bd61c1324
commit
ffa2a1ecdd
5 files changed
+14
-30
No files matched your search
@@ -422,9 +422,14 @@ void CommonCLI::syncNodePrefsToMQTTPrefs() {
|
||||
#define MIN_LOCAL_ADVERT_INTERVAL 60
|
||||
|
||||
void CommonCLI::savePrefs() {
|
||||
uint8_t old_advert_interval = _prefs->advert_interval;
|
||||
if (_prefs->advert_interval * 2 < MIN_LOCAL_ADVERT_INTERVAL) {
|
||||
_prefs->advert_interval = 0; // turn it off, now that device has been manually configured
|
||||
}
|
||||
// If advert_interval was changed, update the timer to reflect the change
|
||||
if (old_advert_interval != _prefs->advert_interval) {
|
||||
_callbacks->updateAdvertTimer();
|
||||
}
|
||||
_callbacks->savePrefs();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user