Page 1 of 1

Bluetooth LE APIs

Posted: Thu Jan 05, 2017 4:09 pm
by michaelwgnr
Looking at all the Bluetooth LE examples, I realised that these all outline three possible approaches to work with Bluetooth LE in the current version of the SDK:
  • examples/05_ble_adv: Manually shove bytes through the HCI.
  • examples/12_blufi: Apart from the parts that are handled by the "blufi"-profile, this example directly works with the BTA API.
  • examples/14_gatt_server and examples/15_gatt_client: Work with the ESP provided APIs
VHCI (bt/include)
Well... of course I would like to avoid having to manually write bytes to the VHCI, as it is rather low level, tedious and error prone to implement a completely functional Bluetooth peripheral with multiple services, etc. (at least if it's me doing this... :lol:)

BTA API (bt/bluedroid/bta/include)
Bluedroid application layer. This seems like a fairly consistent API and looks understandable to me.

ESP API (bt/bluedroid/api/include)
My understanding is that the ESP API provides an interface that would be a bit more consistent with the rest of the system, but is essentially just placed on top of the BTA API, decoupling direct calls to the BTA API from the user application by implementing the intermediate BTC task.

Is this assessment correct?

Now, I understand that the ESP BLE stack is still under development, so it is obvious that it looks like the ESP API is not yet completed. There are a few things missing, e.g. advertising more than one UUID128 is not yet workable, there is still lots of error checking missing, the documentation is rather minimalistic etc.

So, my questions are:
  • Does anything speak against using the BTA API directly? It seems to be documented rather thoroughly and seems to be well usable.
  • Are there any large updates planned for the BLE API in the near future? Is there some sort of roadmap or some more info about where Espressif are headed with it?
Thank you in advance for any information.

Re: Bluetooth LE APIs

Posted: Fri Jan 06, 2017 6:12 am
by ESP_Tianhao
Hi, for your questions:
1. We make ESP_api provide to users. BTA_api is for bluedroid internal. So users should call ESP_api, rather than BTA_api.
2. When newer version of ESP_IDF release, we will update some ESP_api.

Re: Bluetooth LE APIs

Posted: Fri Jan 06, 2017 8:09 am
by michaelwgnr
ESP_Tianhao wrote:Hi, for your questions:
1. We make ESP_api provide to users. BTA_api is for bluedroid internal. So users should call ESP_api, rather than BTA_api.
2. When newer version of ESP_IDF release, we will update some ESP_api.
Thanks for your response!

1. Okay, I understand that, so I can't really assume that this BTA API will stay as ist is? It would probably be helpful if the examples would not use the BTA API in that case.
2. Is there a roadmap lining out what the future plans are with BLE / Bluetooth in the ESP32 SDK?