Open QuentinFarizon opened 2 years ago
Hi @QuentinFarizon , sorry for late reply.
App needs to wait for device connection event after calling espDevice.connectBLEDevice
function.
It will connect to the given BLE peripheral device. After BLE GATT connection success callback, lib will discover services and do some other setup which will be require for further device communication. Once it is completed, lib will send EVENT_DEVICE_CONNECTED event to app.
After device connection app can call espDevice.scanNetworks
API. It has a listener in which the app will receive list of scanned networks.
Hello, @khushbushah2302, yes, that's what I did in the end.
But it could be provided as a synchronous utility method, or as a parameter to connectBLEDevice
It would be nice if ESPDevice.connectBLEDevice would wait for service discovered.
When calling
espDevice.scanNetworks
just afterespDevice.connectBLEDevice
, service discovery is not complete and no wifi networks are returned.