Posts

Post not yet marked as solved
26 Replies
14k Views
Hi,We have an IoT with a Wi-Fi server that switch on on demand through BLE command. Process is the following :1. Device is connected to IoT with BLE2. Device send request to switch from BLE to WiFi mode3. IoT start a built in Wi-Fi hotspot configured with same SSID and WPA password4. Device try to connect using the NetworkExtension frameworkSometime it works but sometine no.In our use case we never got an error from the NEHotspotConfigurationManager.shared.apply completionHandler. But a system alert pop Impossible to connect network "xxxxxxxx" is shown.The IoT SSID is visible in check in settings > Wi-Fi network list. Then when selecting manually the IoT SSID network to connect it always connect with success using the exact same password used with NEHotspotConfiguration.Since we do not receive a proper error we cannot even request the user to maually connect to WiFi network unless we check the SSID network name beign connected on is equal to the IoT SSID network name.Any help would be very mush appreciated if someone has experienced the same.Thank you all.Here is the code we use :private func connectWifi() { guard let ssid = wifi.ssid, let pwd = wifi.pwd else { set(.error) return } DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(2), execute: { let hotSpot = NEHotspotConfiguration(ssid: ssid, passphrase: pwd, isWEP: false) hotSpot.joinOnce = false NEHotspotConfigurationManager.shared.apply(hotSpot, completionHandler: { [weak self] error in print("NEHotspotConfigurationManager error > \(String(describing: error))") guard error == nil else { self?.set(.error) return } self?.set(.sync) }) }) }
Posted Last updated
.
Post not yet marked as solved
1 Replies
1.2k Views
Hello,Doing a scanForPeripherals with a given custom UUID service give a different behavior between iOS and Mac OS program execution.It seemes that CBCentralManagerScanOptionAllowDuplicatesKey is not taken into account on Mac OS (Catalina) using Catalyst and we have multiple advertisement packet as per the log below.<CBPeripheral: 0x6000033061c0, identifier = 3702E8B8-FCD6-42E1-B79C-1B0202A15B42, name = (null), state = disconnected><CBPeripheral: 0x6000033061c0, identifier = 3702E8B8-FCD6-42E1-B79C-1B0202A15B42, name = TIBTOP 2D08, state = disconnected><CBPeripheral: 0x600003305d60, identifier = 420ED12B-2767-4DDE-AB4A-B1BA6159C4D3, name = (null), state = disconnected><CBPeripheral: 0x600003305d60, identifier = 420ED12B-2767-4DDE-AB4A-B1BA6159C4D3, name = TIBTOP 6890, state = disconnected>In iOS it works as expected<CBPeripheral: 0x2807312c0, identifier = 05D6357E-9374-1C5A-F03C-AA798C1A595A, name = TIBTOP, state = disconnected><CBPeripheral: 0x280736800, identifier = AF7828EC-E80A-06BA-6134-4F5C064C1BFB, name = TIBTOP, state = disconnected>Is it a known issue on Mac OS or a missundertanding of the Core Bluetooth behavior on Mac OS ?Best regards,
Posted Last updated
.