refactor(mqtt): migrate observer settings to MQTTPrefs structure

Refactored the handling of observer-related settings by moving them from
NodePrefs to a new MQTTPrefs structure. This change centralizes MQTT,
WiFi, timezone, SNMP, and alert configurations, improving code organization
and maintainability. The new structure allows for better separation of
concerns and prepares the codebase for future enhancements.
This commit is contained in:
agessaman committed 2026-06-26 08:59:48 -07:00
1 parent 9535f243af
commit 2eb41baeda
14 files changed
+372 -561

No files matched your search

+7
View File
@@ -93,6 +93,13 @@ static inline void applyMQTTDefaults(MQTTPrefs* prefs) {
prefs->timezone_string[sizeof(prefs->timezone_string) - 1] = '\0';
}
prefs->timezone_offset = MQTT_DEFAULT_TIMEZONE_OFFSET;
// Observer non-MQTT defaults (moved out of NodePrefs/MyMesh ctor in Phase 2).
strncpy(prefs->snmp_community, "public", sizeof(prefs->snmp_community) - 1);
prefs->radio_watchdog_minutes = 5;
prefs->alert_wifi_minutes = 30;
prefs->alert_mqtt_minutes = 240;
prefs->alert_min_interval_min = 60;
}
#endif // WITH_MQTT_BRIDGE