problem in the esp_ble_gatts_create_attr_tab() function

abansal22
Posts: 20
Joined: Wed Apr 22, 2020 8:24 am

problem in the esp_ble_gatts_create_attr_tab() function

Postby abansal22 » Fri May 01, 2020 5:59 am

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
Attachments
capture.JPG
capture.JPG (41.82 KiB) Viewed 447 times

chegewara
Posts: 1184
Joined: Wed Jun 14, 2017 9:00 pm

Re: problem in the esp_ble_gatts_create_attr_tab() function

Postby chegewara » Fri May 01, 2020 12:19 pm

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

Who is online

Users browsing this forum: No registered users and 30 guests