提交 c62df916 authored 作者: blu's avatar blu

new feature: evwifi

上级 ed664d37
...@@ -63,6 +63,7 @@ class WifiMgr { ...@@ -63,6 +63,7 @@ class WifiMgr {
// stop all // stop all
spdlog::info("prepare to enter AP mode"); spdlog::info("prepare to enter AP mode");
exec("systemctl stop wpa_supplicant@wlan1"); exec("systemctl stop wpa_supplicant@wlan1");
exec("ifconfig wlan1 192.168.0.1");
// exec("systemctl dsiable wpa_supplicant@wlan1 ") // exec("systemctl dsiable wpa_supplicant@wlan1 ")
string apdContent = fmt::format("interface=wlan1\ndriver=nl80211\nssid=EVB-{}\nhw_mode=g\n" string apdContent = fmt::format("interface=wlan1\ndriver=nl80211\nssid=EVB-{}\nhw_mode=g\n"
"channel=6\nmacaddr_acl=0\nignore_broadcast_ssid=0\nwpa=0\n", this->info["sn"].get<string>()); "channel=6\nmacaddr_acl=0\nignore_broadcast_ssid=0\nwpa=0\n", this->info["sn"].get<string>());
...@@ -105,7 +106,7 @@ class WifiMgr { ...@@ -105,7 +106,7 @@ class WifiMgr {
// TODO: verify // TODO: verify
spdlog::info(exec("systemctl enable wpa_supplicant@wlan1")); spdlog::info(exec("systemctl enable wpa_supplicant@wlan1"));
spdlog::info(exec("systemctl restart wpa_supplicant@wlan1")); spdlog::info(exec("systemctl restart wpa_supplicant@wlan1"));
spdlog::info(exec("dhclient wlan1")); spdlog::info(exec("dhclient -r wlan1"));
}else{ }else{
string msg = fmt::format("failed write wpa config to {}", wpaCfgPath); string msg = fmt::format("failed write wpa config to {}", wpaCfgPath);
ret["code"] = 2; ret["code"] = 2;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论