This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

[S132] CCCD value not being initialized

Hi, I wrote a custom service with a characteristics with notifications support. After a client connects I start the sensors and I start updating the values. On the service I'm using the sd_ble_gatts_hvx function to update the value and send a notification in case it is enabled.

In theory the function should return NRF_ERROR_STATE_INVALID when the notifications are not enabled, but instead I'm getting a BLE_ERROR_GATTS_SYS_ATTR_MISSING. But if I write a 0 to the CCCD it starts reporting NRF_ERROR_STATE_INVALID which is the expected error.

I assume this is issue is due to the SD not initializing the CCCD to 0. I am right?

Thanks

Related