GATT Server, retrieving UUID from handle

richardl
Posts: 12
Joined: Sun Nov 18, 2018 5:02 pm

GATT Server, retrieving UUID from handle

Postby richardl » Mon Jan 07, 2019 7:36 am

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

Sang_Huynh
Posts: 1
Joined: Thu Nov 21, 2024 9:51 am

Re: GATT Server, retrieving UUID from handle

Postby Sang_Huynh » Wed Nov 27, 2024 2:42 am

Hi Richard,

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

Thanks.

MicroController
Posts: 2661
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: GATT Server, retrieving UUID from handle

Postby MicroController » Fri Nov 29, 2024 8:33 am

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

Who is online

Users browsing this forum: ChatGPT-User, Semrush [Bot] and 15 guests