diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index 0a732d6..ef02ccd 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/jsonparse/web_cmd_parse3.cpp b/jsonparse/web_cmd_parse3.cpp index 7984e00..e457672 100644 --- a/jsonparse/web_cmd_parse3.cpp +++ b/jsonparse/web_cmd_parse3.cpp @@ -156,13 +156,13 @@ std::string JsonData::JsonCmd_Cgi_52(Param_52 ¶m) { jsonVal["enable"] = false; return show_value_.write(jsonVal); #endif - jsonVal["enable"] = true; if (0 == param.mMode) { // 扫描 wifi::WPAClient wpa; std::string netssid = wpa.GetNetSsid(); std::vector vecSsid; boost::split(vecSsid, netssid, boost::is_any_of("\n"), boost::token_compress_off); jsBody["type"] = "SCAN"; + jsBody["enable"] = true; zlog_info(zct,"netssid : %s %d", netssid.c_str(), vecSsid.size()); for (unsigned int i = 1; i < vecSsid.size() - 1; i++) { std::vector data; diff --git a/main.cpp b/main.cpp index a15b784..918d9cc 100644 --- a/main.cpp +++ b/main.cpp @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) { #endif #ifdef WIFI_MODULE - print_info("WiFi_MODULE \n"); + zlog_info(zbt,"WiFi_MODULE"); #endif //通过UDP接收数据 diff --git a/threadfunc/check_thread.cpp b/threadfunc/check_thread.cpp index 42d27f8..8e23c62 100644 --- a/threadfunc/check_thread.cpp +++ b/threadfunc/check_thread.cpp @@ -33,6 +33,7 @@ void CheckThread() { int loose_check = 0; int mqttresend = 0; int checkNet0 = 0; + int wifi_reconnect_count = 0; while (GlobalConfig::QuitFlag_G) { GlobalConfig::threadStatus = 1; sleep(1); @@ -102,20 +103,18 @@ void CheckThread() { zlog_warn(zct, "WiFi reset!"); system("/etc/init.d/wpa_restart"); sleep(5); - string strip = GetGwIp_("wlan0"); - print_info("strip = %s\n", strip.c_str()); - if (strip.compare("0.0.0.0") != 0) { - } else { - gpio_set(GlobalConfig::GPIO_G.wifiReset, 1); - sleep(5); - gpio_set(GlobalConfig::GPIO_G.wifiReset, 0); - sleep(30); - wifi::WPAClient wpa; - wpa.ReconnectWiFi(); - system("/etc/init.d/wpa_restart"); - sleep(5); - system("udhcpc -b -i wlan0 &"); - } + std::string strip = GetGwIp_("wlan0"); + zlog_warn(zct,"strip = %s", strip.c_str()); + + gpio_set(GlobalConfig::GPIO_G.wifiReset, 1); + sleep(5); + gpio_set(GlobalConfig::GPIO_G.wifiReset, 0); + sleep(30); + wifi::WPAClient wpa; + wpa.ReconnectWiFi(); + system("/etc/init.d/wpa_restart"); + sleep(5); + system("udhcpc -b -i wlan0 &"); #endif } diff --git a/wifi_5g/wpa_client.cpp b/wifi_5g/wpa_client.cpp index b2eae24..913c92e 100644 --- a/wifi_5g/wpa_client.cpp +++ b/wifi_5g/wpa_client.cpp @@ -431,7 +431,7 @@ bool WPAClient::CheckCommandWithOk(const std::string cmd) { zlog_error(zct, "send cmd falied"); return false; } - zlog_error(zct, "recv cmd %s", recv.data()); + zlog_info(zct, "recv cmd %s", recv.data()); if (strstr(recv.data(), "OK") == NULL) { return false; }