esp_ble_gatts_add_char_descr() is failing, not sure why

MrSurly
Posts: 4
Joined: Thu Apr 13, 2017 9:03 pm

esp_ble_gatts_add_char_descr() is failing, not sure why

Postby MrSurly » Thu May 18, 2017 9:17 pm

Hi there,

When I try to use esp_ble_gatts_add_char_descr() to add a descriptor to a service, I get an ESP_GATTS_ADD_CHAR_DESCR_EVT with a status of 0x85 ("ERROR")

I'm trying to perform what amounts to the same steps as the gatts_demo.c from the IDF examples, though that works ok.

Can anyone comment for what circumstances would lead to a failure to add a descriptor?

I'm even doing the calls (nearly) the same way as the demo:

CREATE service
START service after CREATE event
ADD_CHAR after START event (demo calls ADD_CHAR after calling START, in the CREATE event handler)
ADD_CHAR_DESCR after ADD_CHAR event

Code: Select all

network_bluetooth_gap_event_handler(event = 0E / LOCAL_IR, param = ()
network_bluetooth_gatts_event_handler(event = 00 / REG, if = 03, param = (status = 00 / OK, app_id = 0000)
network_bluetooth_gattc_event_handler(event = 00 / REG, if = 04, param = (status = 00 / OK, app_id = 0001)
network_bluetooth_gap_event_handler(event = 0F / LOCAL_ER, param = ()
network_bluetooth_gatts_event_handler(event = 07 / CREATE, if = 03, param = (status = 00 / OK, service_handle = 0028, service_id = (id = (uuid = 0000180D-0000-1000-8000-00805F9B34FB, inst_id = 00, is_primary = true))
network_bluetooth_gatts_event_handler(event = 0C / START, if = 03, param = (status = 00 / OK, service_handle = 0028)
network_bluetooth_gatts_event_handler(event = 09 / ADD_CHAR, if = 03, param = (status = 00 / OK, attr_handle = 002A, service_handle = 0028, uuid = 37 2A )
network_bluetooth_gatts_event_handler(event = 0A / ADD_CHAR_DESCR, if = 03, param = (status = 85 / ERROR, attr_handle = 0000, service_handle = 0028, uuid = 02 29 )

MrSurly
Posts: 4
Joined: Thu Apr 13, 2017 9:03 pm

Re: esp_ble_gatts_add_char_descr() is failing, not sure why

Postby MrSurly » Tue May 30, 2017 4:20 pm

Wasn't allocating enough handles in service create.

Who is online

Users browsing this forum: No registered users and 164 guests