diff --git a/main/ble.h b/main/ble.h index 36335d2..b592085 100644 --- a/main/ble.h +++ b/main/ble.h @@ -15,6 +15,7 @@ #include "globals.h" #include "futurecpp.h" #include "modes/remotecontrolmode.h" +#include "utils.h" namespace { #ifdef FEATURE_BLE @@ -270,6 +271,7 @@ void WirelessSettingsCallbacks::onWrite(NimBLECharacteristic* pCharacteristic) ESP_LOGI(TAG, "[ble_config]: Set wifi%i: WiFi-SSID: %s, WiFi-Password: ***", doc["wifi_index"].as(), doc["wifi_ssid"].as()); stringSettings.wifis[index].ssid = doc["wifi_ssid"].as(); stringSettings.wifis[index].key = doc["wifi_pass"].as(); + saveSettings(); } else { const auto deserialized = deserializeJson(doc, val); ESP_LOGW(TAG, "Unkown type %s -> json: %.*s %s", doc["type"].as(), val.size(), val.data(), deserialized.c_str());