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

[nRF8001] CCCD has no Write permission

I added a local service with a characteristic with the Notify permission set. On the device I'm connecting from to the nRF8001, I can see my custom characteristic has a 0x2902 (CCCD) descriptor. However, it has no permissions enabled, and thus I cannot write to it to enable notifications. If I try anyway, I don't get a PipeStatusEvent on the nRF8001.

The devices are not paired (using Bond), but only connected (using Connect).

What is wrong with my setup?

Parents
  • Hi all,

    Thanks for thinking along with me.

    Turns out everything works fine, but two things threw me off:

    1. Android told me the permissions on the descriptor were 0, but I actually do have permission to write to it. I don't know why it says I don't. I said I tried writing to it anyway, but didn't work, but that is because:
    2. I was reading the Android documentation wrong. It isn't enough to enable notifications on the characteristic through the built-in API method, but you have to explicitly write the ENABLE_NOTIFICATIONS value to the descriptor to make it work.

    And all is well now!

    Android snippet describing the code needed to make it work: developer.android.com/.../bluetooth-le.html

Reply
  • Hi all,

    Thanks for thinking along with me.

    Turns out everything works fine, but two things threw me off:

    1. Android told me the permissions on the descriptor were 0, but I actually do have permission to write to it. I don't know why it says I don't. I said I tried writing to it anyway, but didn't work, but that is because:
    2. I was reading the Android documentation wrong. It isn't enough to enable notifications on the characteristic through the built-in API method, but you have to explicitly write the ENABLE_NOTIFICATIONS value to the descriptor to make it work.

    And all is well now!

    Android snippet describing the code needed to make it work: developer.android.com/.../bluetooth-le.html

Children
No Data
Related