Explorar o código

fix: 如果启动过softap, 每次启动模块都会启动softap, 修正之

Wendal Chen %!s(int64=2) %!d(string=hai) anos
pai
achega
64d89c2a9a
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      app/network/luat_wlan_air101.c

+ 8 - 0
app/network/luat_wlan_air101.c

@@ -136,6 +136,14 @@ static void scan_event_cb(void) {
 
 int luat_wlan_init(luat_wlan_config_t *conf) {
     if (wlan_init == 0) {
+        u8 wireless_protocol = 0;
+        tls_param_get(TLS_PARAM_ID_WPROTOCOL, (void *) &wireless_protocol, TRUE);
+        // LLOGD("wireless_protocol %d", wireless_protocol);
+        if (TLS_PARAM_IEEE80211_INFRA != wireless_protocol)
+        {
+            wireless_protocol = TLS_PARAM_IEEE80211_INFRA;
+            tls_param_set(TLS_PARAM_ID_WPROTOCOL, (void *) &wireless_protocol, FALSE);
+        }
         //tls_wifi_enable_log(1);
         luat_wlan_get_hostname(0); // 调用一下就行
         wlan_init = 1;