Page 1 of 1

API to know if my BLE is currently connected / paired or not

Posted: Mon Aug 07, 2017 8:26 am
by Abhiram
Hi All

I would request Forums help in letting me know if there is an ESP32 API to know if BLE is CONNECTED or Paired to other device or not.
Thanks for help!

Regards
Abhiram

Re: API to know if my BLE is currently connected / paired or not

Posted: Mon Aug 07, 2017 2:13 pm
by kolban
The underlying BLE APIs found in ESP-IDF provide event handling capabilities. This means you get an event which is received in a registered callback when something interesting related to BLE happens. One such event is a connected event which is received when a connection is established. A second event is an indication that the a connection has been lost or disconnected. In the majority of cases, it is your logic that is responsible for maintaining the BLE state and, as such, you are responsible for tracking how many partner connections exist at any given time.

Re: API to know if my BLE is currently connected / paired or not

Posted: Tue Aug 08, 2017 3:37 am
by Abhiram
Thanks Kolban,
Yes ..even I was coming to same conclusion.