How to enable CCCD automatically in NCS(zephry)

Hi

Develop peripherals.nrf devices do slave machines.

Due to project requirements. The standard (notification) operation process needs to be changed (In the absence of binding).The following blogs have confirmed that the project needs can be achieved in the SDK:

https://devzone.nordicsemi.com/f/nordic-q-a/15571/automatically-start-notification-upon-connection-event-manually-write-cccd---short-tutorial-on-notifications#post-id-90507

https://devzone.nordicsemi.com/f/nordic-q-a/63606/enabling-notification-by-default/259329

SDK added as follows:

The SDK test meets the requirements.

But eventually I need to implement this functionality in NCS, so I want to know how to implement it in NCS. Currently, I can't find an API like sd_ble_gatts_sys_attr_set in the NCS list of GATT layer apis:

I need your help. Thank you very much!

Best regards

Stars

Parents
  • Hi,

    In the nRF5 SDK bonding was handled by the application, and for bonded devices, the CCCD value is kept across connections. So there was a need for support for this in the SoftDevice APIs. With Zephyr it is different, as bonds are handled in the Bluetooth stack, and therefor there was no need for such an API, and it is not present. Note it is not allowed in Bluetooth to send notifications to a GATT client that has not enabled that in the CCCD.

Reply
  • Hi,

    In the nRF5 SDK bonding was handled by the application, and for bonded devices, the CCCD value is kept across connections. So there was a need for support for this in the SoftDevice APIs. With Zephyr it is different, as bonds are handled in the Bluetooth stack, and therefor there was no need for such an API, and it is not present. Note it is not allowed in Bluetooth to send notifications to a GATT client that has not enabled that in the CCCD.

Children
Related