mirror of
https://github.com/agessaman/MeshCore.git
synced 2026-07-10 20:21:38 +00:00
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:
@@ -799,7 +799,7 @@ void SensorMesh::sendSelfAdvertisement(int delay_millis) {
|
||||
|
||||
void SensorMesh::updateAdvertTimer() {
|
||||
if (_prefs.advert_interval > 0) { // schedule local advert timer
|
||||
next_local_advert = futureMillis( ((uint32_t)_prefs.advert_interval) * 2 * 60 * 1000);
|
||||
next_local_advert = futureMillis((int)((uint32_t)_prefs.advert_interval * 2 * 60 * 1000));
|
||||
} else {
|
||||
next_local_advert = 0; // stop the timer
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user