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

Is there any to set CCCD's default value to be 1(i.e. enabling the notification of an attribute)?

Hi, I am trying to enabling a notification of an attribute(once the attribute changed, the server will push the new value to the client) and I learned I have to first configure the CCCD correctly to do this. In the bluetooth spec it says the CCCD has to be 1 to support notification, and I have successfully added the CCCD of my attribute by setting the char_props.notify to be 1, but the default value of CCCD is 0. I am just wondering if I can make this default value to be 1 or it is up to the client to configure it?

Thanks

Parents
  • There isn't any way to set the default value to 1, but for bonded devices, the spec requires CCCD values to be stored. This means that once the Central device bonds with your Peripheral, the Peripheral will store the CCCD values used and restore them when this particular device reconnects. The CCCD values are what is called system attributes in S110 terms.

    If you mean setting the default for newly connected (not bonded) devices, this is not possible.

Reply
  • There isn't any way to set the default value to 1, but for bonded devices, the spec requires CCCD values to be stored. This means that once the Central device bonds with your Peripheral, the Peripheral will store the CCCD values used and restore them when this particular device reconnects. The CCCD values are what is called system attributes in S110 terms.

    If you mean setting the default for newly connected (not bonded) devices, this is not possible.

Children
Related