Unable to add more than 1 characteristic to a service

aschweiz
Posts: 22
Joined: Wed Nov 30, 2016 1:57 pm

Unable to add more than 1 characteristic to a service

Postby aschweiz » Wed Dec 21, 2016 3:29 pm

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

aschweiz
Posts: 22
Joined: Wed Nov 30, 2016 1:57 pm

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

Postby aschweiz » Wed Jan 04, 2017 3:34 pm

Fyi, it's working fine after I've increased the number of handles in esp_ble_gatts_create_service :-)

MarkIngle
Posts: 30
Joined: Wed Jan 18, 2017 4:48 am

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

Postby MarkIngle » Tue Feb 28, 2017 1:41 am

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

aschweiz
Posts: 22
Joined: Wed Nov 30, 2016 1:57 pm

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

Postby aschweiz » Tue Feb 28, 2017 7:59 am

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.

johnnorbury
Posts: 1
Joined: Fri Apr 07, 2017 8:08 am

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

Postby johnnorbury » Fri Apr 21, 2017 9:03 am

Any updates on this issue?

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

Who is online

Users browsing this forum: No registered users and 43 guests