Forráskód Böngészése

fix: 重连wifi的效率低

Wendal Chen 1 éve
szülő
commit
925e5cbab5
1 módosított fájl, 7 hozzáadás és 3 törlés
  1. 7 3
      app/network/luat_wlan_air101.c

+ 7 - 3
app/network/luat_wlan_air101.c

@@ -108,14 +108,18 @@ static void netif_event_cb(u8 status) {
     {
     case NETIF_WIFI_JOIN_FAILED:
         LLOGI("join failed");
-        tls_auto_reconnect(3);
+        #ifndef LUAT_USE_NETWORK
+        tls_auto_reconnect(0);
+        #endif
         break;
     case NETIF_WIFI_DISCONNECTED:
         wlan_state = 0;
-        tls_auto_reconnect(3);
         LLOGI("disconnected");
         msg.arg1 = status;
         luat_msgbus_put(&msg, 0);
+        #ifndef LUAT_USE_NETWORK
+        tls_auto_reconnect(0);
+        #endif
         break;
     case NETIF_WIFI_JOIN_SUCCESS :
         wlan_state = 1;
@@ -207,7 +211,7 @@ int luat_wlan_init(luat_wlan_config_t *conf) {
             wireless_protocol = TLS_PARAM_IEEE80211_INFRA;
             tls_param_set(TLS_PARAM_ID_WPROTOCOL, (void *) &wireless_protocol, FALSE);
         }
-        tls_wifi_enable_log(1);
+        // tls_wifi_enable_log(1);
         luat_wlan_get_hostname(0); // 调用一下就行
         wlan_init = 1;