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

Abhiram
Posts: 22
Joined: Mon Apr 24, 2017 5:09 pm

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

Postby Abhiram » Mon Aug 07, 2017 8:26 am

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

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

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

Postby kolban » Mon Aug 07, 2017 2:13 pm

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.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Abhiram
Posts: 22
Joined: Mon Apr 24, 2017 5:09 pm

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

Postby Abhiram » Tue Aug 08, 2017 3:37 am

Thanks Kolban,
Yes ..even I was coming to same conclusion.

Who is online

Users browsing this forum: Bing [Bot] and 103 guests