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
30 lines
750 B
C++
30 lines
750 B
C++
#include <settings/wifi/wifi.hpp>
|
|
#include <syslog.h>
|
|
|
|
#define WIFI_REQUIRED_STRING R"({"required":"[token,status]"})"
|
|
|
|
namespace api
|
|
{
|
|
namespace settings
|
|
{
|
|
namespace wifi
|
|
{
|
|
void Wifi::set_wifi_status(bool new_wifi_status)
|
|
{
|
|
if (!new_wifi_status)
|
|
{
|
|
system("rc stop hostapd");
|
|
system("rc del hostapd");
|
|
syslog(LOG_INFO, "%s", "WIFI is disabled");
|
|
}
|
|
else
|
|
{
|
|
system("rc start hostapd");
|
|
system("rc add hostapd");
|
|
syslog(LOG_INFO, "%s", "WIFI is enabled");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|