Post

Replies

Boosts

Views

Activity

NEHotspotConfigurationManager.shared.apply some questions
Hello, we have encountered some issues related to calling WiFi connection APIs in our app. The code is as follows: let ssid = "some-wifi-ap" let password = "some-pw" let config: NEHotspotConfiguration = NEHotspotConfiguration(ssid: ssid, passphrase: password, isWEP: false) NEHotspotConfigurationManager.shared.apply(config, completionHandler: { (error) in // do something }) Question 1: After calling the NEHotspotConfigurationManager.shared.apply method, ignoring the time it takes for the user to authorize the WiFi connection, this method takes about 4 to 10 seconds to receive a callback. Sometimes it may take even longer! Why does this method take so long to get a result callback? Are there any ways to reduce the time taken by this method? For example, optimizing the API call or the target WiFi. Question 2: After calling the NEHotspotConfigurationManager.shared.apply method, there is about a 3% to 5% chance of an "Unable to join the network" popup. Then, by calling NEHotspotConfigurationManager.shared.apply again, in most cases, the WiFi connection is successful. Through some stress testing, we collected some device logs, and by examining the WiFi-related logs, we found two main types of errors that might cause this "Unable to join the network" popup. The errors are as follows: a. (Scan request failed (-528350142, Family Scan Busy)!) b. (Error: posting APPLE80211_M_SCAN_DONE with err -536870165)(__WiFiDeviceManagerForcedAssociationCallback: failed to association error 1) c、__WiFiDeviceManagerForcedAssociationCallback: failed to association error 2 Could you please explain in more detail the specific reasons for these two errors? We would also like to know what specific situations could cause the "Unable to join the network" popup and whether there are ways to avoid or reduce the frequency of this abnormal condition. Additionally, the WiFi we are connecting to is an AP hotspot provided by our company's product camera without DNS service
1
0
203
Oct ’24