NimBLE-Arduino
NimBLE-Arduino copied to clipboard
Good strategy for multiple BLE devices connected, without disconnect in between?
Thanks for this great Lib. It works wonderful for my MQTT Bridge.
I'm creating a BLE reader for Renogy LiFePo Batteries (https://github.com/distancerunner/Renogy-Battery-ESP32-Bluetooth-MQTT-Bridge). Actual I have 2 of them in my VAN. I will poll every one of them in cycle, one after each other.
My actual code makes it like that:
- Scan
- Device found
- Connect to device with adress xx:xx:xx:xx
- write data
- get notification (voltage, current etc)
- close connection with client->disconnect()
- start again from 1.
I was wondering, if there is a better way to stay connected to multiple devices (how should I handle the amount dynamical, the amount should be flexible). I will call data without reconnect every time. Is there a strategy I can make?
You can simply create multiple client instances and maintain the connection with up to 9 devices.