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,

    That is expected. It is set by default, but when you set CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION=n nothing gets defined, so the only related thing you will see in your build folder then is a line with

    # CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION is not set

    in build/zephyr/.config

    In what way does it not work now? Perhaps you check the CCCD earlier and don't try to send a notification if it is not set? The mentioned config only removes the restriction that prevents it in zephyr/subsys/bluetooth/host/gatt.c. Also, which SDK version are you using?

    Einar

Children
Related