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 Reply
  • Hi Stars,

    It turns out there are more to this than what I wrote before. It is in fact possible to send notifications or indications to clients that have not enabled it in the CCCD by adding CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION=n to your configuration (this is enabled by default). By disabling this, the check for if notifications are enabled or not in the CCCD is skipped, and it is sent regardless.

    Einar

Children
Related