Page 1 of 1

ESP32 BLE Notify only working on Initial service

Posted: Wed Aug 22, 2018 7:42 pm
by mgsscorr1
Hello,

Im having issues with being able to use the notify property for all services. I have currently set up my code to produce 2 services. Both services are used to transmit sensor data. For some reason even when i send the data on the separate Service, all notify data is only being seen on the first service. I feel like its an issue with the conn_id of each profile but i cant seem to narrow down the issue.

Attached is my code, hopefully someone can catch this bug that i cant seem to find why it keeps attaching to the first service. I deactivated the Notify on the first service but still cant see the notify on the second service

Re: ESP32 BLE Notify only working on Initial service

Posted: Fri Aug 24, 2018 10:33 am
by chegewara
Hi, first of all notifications are sent for characteristics not services. Service is set of characteristic and each characteristic can have value, service cant have any value.

Now your issue. You have hardcoded attribute handle value and in both cases its the same value:

Code: Select all

uint16_t attr_handle = 0x002a;
When you are creating service, characteristic or descriptor you should store attribute handle returned in proper event like:

Code: Select all

ESP_GATTS_CREATE_EVT