Connecting to 3 BLE Devices to takes very long
I have to connect 3 devices and each need ~2.5 seconds for a full cycle (doConnect_Senso4s->connectToServer-Notification coming in)
I run this code for each BLE device sequential:
if(doConnect_Senso4s) // MAC+Service found {doConnect_Senso4s = false; // Für nächsten Durchlauf bereit machen if(connectToServer_Senso4s()) { debug_info("Success! we should now be getting Senso4s notifications!",1); } }
Adding the scan delay is on top. I know that the devices are slow to connect, but I can not change this devices.
I was wondering if I could start the connectToServer simultaneously or if there is any other way to speed this up.
Many thanks for pointing me into the right direction.
Not much you can do really. If the devices are known then you can save their addresses and try directly connecting without scanning but that won't save much.
True, the Scan lasts only 1 sec before all 3 MAC are detected and I end the scan. I have a few non BLE Sensors and they also need setup time. I have moved the request to power up in front of the scan and the doConnect's. That saved me 2s "useless" wait. So in total I am mostly back to 10s wait before displaying Sensor data of 3xBLE and 2x1Wire and 4xGPIO detects.
Tx for the Library and your super support!!!