Preserve MQTT settings across slot changes

This commit is contained in:
mikecarper
2026-09-08 18:55:00 -07:00
parent aa8caa4ed2
commit cb79dcd4e3
16 changed files with 2209 additions and 1999 deletions
+3 -3
View File
@@ -574,14 +574,14 @@ bool CommonCLI::handleObserverSetCmd(uint32_t sender_timestamp, const char* conf
_callbacks->restartBridgeSlot(slot);
strcpy(reply, "OK");
} else if (memcmp(subcmd, "port ", 5) == 0) {
int port = atoi(&subcmd[5]);
if (port > 0 && port <= 65535) {
uint16_t port;
if (mesh::cli::parseMqttPort(&subcmd[5], port)) {
_mqtt_prefs.mqtt_slot_port[slot] = port;
saveObserverPrefs();
_callbacks->restartBridgeSlot(slot);
strcpy(reply, "OK");
} else {
strcpy(reply, "Error: port must be between 1 and 65535");
strcpy(reply, "Error: port must be 0-65535 (0 uses the URI default)");
}
} else if (memcmp(subcmd, "username ", 9) == 0) {
if (valueTooLong(&subcmd[9], sizeof(_mqtt_prefs.mqtt_slot_username[slot]), reply, "username")) return true;