diff --git a/config_allfeatures.cmake b/config_allfeatures.cmake index ed6ee9a..c622fd7 100644 --- a/config_allfeatures.cmake +++ b/config_allfeatures.cmake @@ -73,7 +73,6 @@ set(BOBBYCAR_BUILDFLAGS -DPINS_LEDSTRIP=33 -DHEAP_LRGST_CRASH_TEXT_FIX -DLEDSTRIP_WRONG_DIRECTION - -DOLD_NVS -DFEATURE_DNS_NS -DFEATURE_ESPNOW ) diff --git a/config_comred.cmake b/config_comred.cmake index 1b21ee5..128c2ef 100644 --- a/config_comred.cmake +++ b/config_comred.cmake @@ -66,7 +66,6 @@ set(BOBBYCAR_BUILDFLAGS -DPINS_LEDSTRIP=33 -DHEAP_LRGST_CRASH_TEXT_FIX # -DLEDSTRIP_WRONG_DIRECTION - -DOLD_NVS -DFEATURE_DNS_NS -DFEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET -DFEATURE_ESPNOW diff --git a/config_feedc0de.cmake b/config_feedc0de.cmake index 34a086c..6432c8e 100644 --- a/config_feedc0de.cmake +++ b/config_feedc0de.cmake @@ -64,7 +64,6 @@ set(BOBBYCAR_BUILDFLAGS -DPINS_LEDSTRIP=26 # -DHEAP_LRGST_CRASH_TEXT_FIX # -DLEDSTRIP_WRONG_DIRECTION - -DOLD_NVS -DFEATURE_DNS_NS # -DSWITCH_BLINK # -DFEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET diff --git a/config_mick.cmake b/config_mick.cmake index d4353b6..8944f99 100644 --- a/config_mick.cmake +++ b/config_mick.cmake @@ -63,7 +63,6 @@ set(BOBBYCAR_BUILDFLAGS -DFEATURE_WIRELESS_CONFIG -DPINS_LEDSTRIP=33 # -DLEDSTRIP_WRONG_DIRECTION - -DOLD_NVS -DFEATURE_DNS_NS -DFEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET ) diff --git a/config_nofeatures.cmake b/config_nofeatures.cmake index 46b334c..dec3949 100644 --- a/config_nofeatures.cmake +++ b/config_nofeatures.cmake @@ -73,7 +73,6 @@ set(BOBBYCAR_BUILDFLAGS -DPINS_LEDSTRIP=33 # -DHEAP_LRGST_CRASH_TEXT_FIX # -DLEDSTRIP_WRONG_DIRECTION - -DOLD_NVS # -DFEATURE_DNS_NS # -DSWITCH_BLINK -DFEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET diff --git a/config_peter.cmake b/config_peter.cmake index 9c98d37..903838d 100644 --- a/config_peter.cmake +++ b/config_peter.cmake @@ -64,7 +64,6 @@ set(BOBBYCAR_BUILDFLAGS -DPINS_LEDSTRIP=33 # -DHEAP_LRGST_CRASH_TEXT_FIX # -DLEDSTRIP_WRONG_DIRECTION - -DOLD_NVS -DFEATURE_DNS_NS # -DSWITCH_BLINK -DFEATURE_IS_MIR_EGAL_OB_DER_WEBSERVER_KORREKT_ARBEITET diff --git a/main/webserver.cpp b/main/webserver.cpp index a20f60b..9c60b98 100644 --- a/main/webserver.cpp +++ b/main/webserver.cpp @@ -25,9 +25,7 @@ #endif #include "webserver_settings.h" #include "webserver_newsettings.h" -#ifdef OLD_NVS #include "webserver_dumpnvs.h" -#endif #include "globals.h" #include "newsettings.h" @@ -86,9 +84,7 @@ void initWebserver() httpd_uri_t { .uri = "/newSettings", .method = HTTP_GET, .handler = webserver_newSettings_handler, .user_ctx = NULL }, httpd_uri_t { .uri = "/saveNewSettings", .method = HTTP_GET, .handler = webserver_saveNewSettings_handler, .user_ctx = NULL }, httpd_uri_t { .uri = "/resetNewSettings", .method = HTTP_GET, .handler = webserver_resetNewSettings_handler, .user_ctx = NULL }, -#ifdef OLD_NVS httpd_uri_t { .uri = "/dumpnvs", .method = HTTP_GET, .handler = webserver_dump_nvs_handler, .user_ctx = NULL }, -#endif httpd_uri_t { .uri = "/check", .method = HTTP_GET, .handler = webserver_status_handler, .user_ctx = NULL }, }) { diff --git a/main/webserver_dumpnvs.cpp b/main/webserver_dumpnvs.cpp index f716ac8..de26b90 100644 --- a/main/webserver_dumpnvs.cpp +++ b/main/webserver_dumpnvs.cpp @@ -146,6 +146,14 @@ esp_err_t webserver_dump_nvs_handler(httpd_req_t *req) } } DynamicJsonDocument doc(6144); + + JsonObject settings = doc.createNestedObject("settings"); + + configs.callForEveryConfig([&](auto &config){ + const std::string_view nvsName{config.nvsName()}; + showInputForSetting(nvsName, config.value, settings); + }); + const auto profile = settingsPersister.currentlyOpenProfileIndex(); const auto switchBackProfile = profile ? int(*profile) : 0; @@ -165,10 +173,9 @@ esp_err_t webserver_dump_nvs_handler(httpd_req_t *req) const auto profile_str = cur_profile ? std::to_string(*cur_profile) : "-"; JsonObject profile = profiles.createNestedObject(profile_str); - JsonObject profile_settings = profile.createNestedObject("settings"); profileSettings.executeForEveryProfileSetting([&](const char *key, auto &value){ - showInputForSetting(key, value, profile_settings); + showInputForSetting(key, value, profile); }); }