This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Notification CCCD Status

Other Parts Discussed in Thread: CC2640, BLE-STACK

Hi there,

We have a project running on CC2640 with 4.1 Stack (ble_cc26xx_2_01_01_44627).

I have a question about notification status (being enabled or disabled) after disconnect event.

Does BLE Stack keep the state of the notification after disconnected? I mean, if I re-connect to the central device, does central device needs to re-enable to notifications by setting CCCD value to 01:00 or since the device keep its state central device does not need to re-enable the notifications on the peripheral device?

Thank you,

  • Hi,

    In our BLE stack, the CCCD are all reset to 00:00 by the function called below upon losing connection.

    // Reset all Client Char Config when connection drops
    gattServApp_ResetCharCfg( connHandle );

    However, if the device is bonded, the upon re-connection, our stack will re-enable the notification/indication right way, otherwise you will have to enable it yourself.
  • Hi there again,

    Thank you so much for your answer. I have a very quick question, sorry if the answer is so easy but I would like to do it right. Can you please tell me how to re-enable the notifications from my peripheral device in the right way?

    Thank you again,
  • You will have to reenable it from your central side.
  • Hi Christin,

    It looks like BLE stack does not re-enable the notification if it was enabled before. How can I handle this issue?

    Here what is happening:

    0) Peripheral device advertises and central device (Windows 10) connects to peripheral device
    1) Central device enable the notification of "Characteristic 1"
    2) Central device write some information to "Characteristic 2"
    3) Peripheral device response with the notification with "Characteristic 1"
    4) Disconnection
    5) Peripheral device start to advertise again
    6) Central device re-connect
    7) Central device assumes that notifications ("Characteristic 1") are already enabled therefore, it try to write information to "Characteristic 2"
    8) Peripheral device reject write messages to ("Characteristic 2") (according to our algorithm since notifications of "Characteristic 1" are not enabled)

    We think that peripheral device keeps the state of the notification, however it resets its state and disables the notifications.

    Thank you for your help!
    Have a great day!

  • Hello,

    The GAP Bond Manager in the BLE-Stack will maintain the status of the CCCD for bonded devices only. As per the BT core specification, non-bonded devices will need to enable Notifications/Indications on each connection. The GAP Bond Manager will store up to GAP_CHAR_CFG_MAX (4) CCCD config items per bonded device.

    Best wishes