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

Should CCCD value be reset to 0 on connection?

Hi Do the latest sample apps (for example, Heart Rate) which do not required bonding behave as follows:-

  1. make connection from iphone
  2. enable notification
  3. check value of cccd is 1
  4. drop connection
  5. immediately make connection from iphone (no reseting of nrf51 end)
  6. check value of cccd and it should be 0

I am seeing that at step (6) it is 1. This seems to be contrary to what it says in the gatt spec at section 3.3.3.3

"The client characteristic configuration descriptor value shall be set to the default value at each connection with non-bonded devices"

Would appreciate your feedback as I forked from the lib files a few SDKs back.

Thanks Ard Roliat

Parents
  • Have you tested this with the Master Control Panel as well? I'm not able to see this problem when using MCP 3.5.0 with ble_app_hrs from SDK 4.4.2, and I'm also not quite sure I see how this would happen.

    When the CCCD values are needed by the softdevice, it is expected to give the application a BLE_GATTS_EVT_SYS_ATTR_MISSING event, to which the application should reply by doing a sd_ble_gatts_sys_attr_set() function call, potentially giving back a set of previously set values. However, when not being bonded, it is expected to just pass NULL for the pointer, to reset the values.

    This should be handled as needed by the bond manager in the SDK.

Reply
  • Have you tested this with the Master Control Panel as well? I'm not able to see this problem when using MCP 3.5.0 with ble_app_hrs from SDK 4.4.2, and I'm also not quite sure I see how this would happen.

    When the CCCD values are needed by the softdevice, it is expected to give the application a BLE_GATTS_EVT_SYS_ATTR_MISSING event, to which the application should reply by doing a sd_ble_gatts_sys_attr_set() function call, potentially giving back a set of previously set values. However, when not being bonded, it is expected to just pass NULL for the pointer, to reset the values.

    This should be handled as needed by the bond manager in the SDK.

Children
No Data
Related