Page 1 of 1

problem in the esp_ble_gatts_create_attr_tab() function

Posted: Fri May 01, 2020 5:59 am
by abansal22
I am following the code of gatts service table from example code
https://github.com/espressif/esp-idf/bl ... eat_demo.c

In the example there is the function which create the attribute table, esp_ble_gatts_create_attr_tab(constesp_gatts_attr_db_t *gatts_attr_db, esp_gatt_if_tgatts_if, uint8_t max_nb_attr, uint8_t srvc_inst_id).

the last parameter is the service instance id. I want to know the significance of this variable. what does it do? there is no explanation on that anywhere.

Image

Re: problem in the esp_ble_gatts_create_attr_tab() function

Posted: Fri May 01, 2020 12:19 pm
by chegewara
You can have few services with the same UUID and for that you need instance id. When you create 2 services with the same UUID and the same instance id you will endup with this error:
https://github.com/espressif/esp-idf/issues/2005