Page 1 of 1

Unable to add more than 1 characteristic to a service

Posted: Wed Dec 21, 2016 3:29 pm
by aschweiz
I'm adding two characteristics to a service in the ESP_GATTS_CREATE_EVT event:

gl_test.char_uuid[0].len = ESP_UUID_LEN_16;
gl_test.char_uuid[0].uuid.uuid16 = ...;
esp_ble_gatts_add_char(gl_test.service_handle, &gl_test.char_uuid[0], ESP_GATT_PERM_READ, ESP_GATT_CHAR_PROP_BIT_READ);

gl_test.char_uuid[1].len = ESP_UUID_LEN_16;
gl_test.char_uuid[1].uuid.uuid16 = ...;
esp_ble_gatts_add_char(gl_test.service_handle, &gl_test.char_uuid[1], ESP_GATT_PERM_READ, ESP_GATT_CHAR_PROP_BIT_READ);

For each of them, I get an ESP_GATTS_ADD_CHAR_EVT event. For the second characteristic, the status is 133.

Am I doing something wrong or is there a bug in the implementation?

cheers
Andreas

(Solved) Re: Unable to add more than 1 characteristic to a service

Posted: Wed Jan 04, 2017 3:34 pm
by aschweiz
Fyi, it's working fine after I've increased the number of handles in esp_ble_gatts_create_service :-)

Re: Unable to add more than 1 characteristic to a service

Posted: Tue Feb 28, 2017 1:41 am
by MarkIngle
How did you increase the number of handles for the service? I am trying to added Body Sensor to the Heart Rate Service. Heart Rate Measurement is the only Characteristic I can get to show on the client....status 133 is being generated as well

Re: Unable to add more than 1 characteristic to a service

Posted: Tue Feb 28, 2017 7:59 am
by aschweiz
It was the last parameter in esp_ble_gatts_create_service:

Code: Select all

esp_ble_gatts_create_service(gl_test.gatt_if, &gl_test.service_id, 1 + (nofCharacteristics() * 3));
But I've since switched to the new "database"-based API where you don't have the number of characteristics any more.

Re: Unable to add more than 1 characteristic to a service

Posted: Fri Apr 21, 2017 9:03 am
by johnnorbury
Any updates on this issue?

I can't see any relevant commits on the git repo...