Page 1 of 1

GATT Server, retrieving UUID from handle

Posted: Mon Jan 07, 2019 7:36 am
by richardl
I am trying to match handles with UUID's post the esp_ble_gatts_create_attr_tab() call. Is there a function like esp_ble_gatts_get_attr_value() which rather than pulling the value using a handle allows me to get the original UUID I submitted when creating the characteristic?

If not whats the best way to dynamically (not via a static table) match my user supplied UUID's with the handles BLE creates please?

Regards

Richard

Re: GATT Server, retrieving UUID from handle

Posted: Wed Nov 27, 2024 2:42 am
by Sang_Huynh
Hi Richard,

I'm curious about this case also, do you have any solutions yet.

Thanks.

Re: GATT Server, retrieving UUID from handle

Posted: Fri Nov 29, 2024 8:33 am
by MicroController
In response to registering attributes with Bluedroid it sends ESP_GATTS_ADD_*_EVT events to your GATTS event handler, like ESP_GATTS_ADD_CHAR_EVT. The parameters coming with that event (e.g. struct gatts_add_char_evt_param) contain the handle and the UUID, which you can store and later use to look up the UUID for a given handle.

See also https://esp32.com/viewtopic.php?f=2&t=36973#p123872