Bluetooth LE API questions: esp_ble_gatts_app_register

michaelwgnr
Posts: 26
Joined: Wed Dec 21, 2016 3:41 pm

Bluetooth LE API questions: esp_ble_gatts_app_register

Postby michaelwgnr » Fri Jan 06, 2017 8:43 am

I took out these questions from my other BLE thread since they are not directly related to the issue outlined therein.

What is the esp_ble_gatts_app_register call exactly for? I tried digging deeper into the stack, but don't really understand what exactly happens after I call the function. It seems to register a "GATT server Interface" and eventually the call back defined via esp_ble_gatts_register_callback is called with a GATT Server Interface identifier as a result. What is this GATT Server interface identifier exactly for? It seems to me that it allows to define multiple GATT servers on one device with different services?

What UUID do I have to submit to esp_ble_gatts_app_register? What relevance does it have? Is it the service UUID? If so, why is it an uint16_t?

aschweiz
Posts: 22
Joined: Wed Nov 30, 2016 1:57 pm

Re: Bluetooth LE API questions: esp_ble_gatts_app_register

Postby aschweiz » Fri Jan 06, 2017 9:37 am

I also wonder about these points.

About your last question, I noticed a few things:

The "GATT server" example uses the same UUID for the service and the call to esp_ble_gatts_app_register. However, there's a restriction on the UUID you can send to the esp_ble_gatts_app_register. It can only be in the range 0x0000 to 0x7fff. In my application, I needed to create a service with a higher UUID and spent some time analyzing why changing the service UUID in the "GATT server" example didn't work before I found this limitation in esp_ble_gatts_app_register. By keeping the "app" UUID in the range 0x0000 to 0x7ffff and only changing the service UUID to a value higher than 0x7fff, the issue was resolved.

cheers,
Andreas

michaelwgnr
Posts: 26
Joined: Wed Dec 21, 2016 3:41 pm

Re: Bluetooth LE API questions: esp_ble_gatts_app_register

Postby michaelwgnr » Fri Jan 06, 2017 12:52 pm

aschweiz wrote:there's a restriction on the UUID you can send to the esp_ble_gatts_app_register. It can only be in the range 0x0000 to 0x7fff.
Thanks, that's good to know. I noticed, that in the last updates, there were a few changes in the BLE API and that the GATT server example was changed to accommodate two services. esp_ble_gatts_app_register is called once for each service but the IDs used are now different from the service UUIDs.

I have to investigate a bit further...

Who is online

Users browsing this forum: Baidu [Spider] and 317 guests