updated config file working
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Has been cancelled
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Has been cancelled

This commit is contained in:
wt committed 2025-02-19 14:23:55 +07:00
1 parent c86d4d77ba
commit d5f074acd6
15 files changed
+17

No files matched your search

+2
View File
@@ -35,6 +35,7 @@ namespace api
response.set_content(R"({"access":"reject"})", JSON_TYPE);
return;
}
config::config.setConfig(std::string("../config.json"));
int wifi_channel = config::config.getConfig()["settings"]["wifi"]["channel"];
std::stringstream responsedata;
responsedata << R"({"channel":")" << wifi_channel << R"("})";
@@ -84,6 +85,7 @@ namespace api
system("rc restart hostapd");
std::string syslogstring = "WIFI channel changed to " + new_channel;
syslog(LOG_INFO, "%s", syslogstring.c_str());
sleep(1);
config::config.setConfig(std::string("../config.json"));
nlohmann::json new_config = config::config.getConfig();
new_config["settings"]["wifi"]["channel"] = std::stoi(new_channel);