0

scan of CCCD entries gives 3 results
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

scan of CCCD entries gives 3 results

by PalB09 on Thu Sep 05, 2019 11:30 am

Hi Team, I'm working with Circuit Playground Express (CPX) in conjunction with Adafruit Bluefruit LE Friend. I'm trying to establish connection between the CPX and a Raspberry Pi. I followed the code on this website - https://learn.adafruit.com/introducing- ... friend/faq

On doing a char-desc, it gave me the following result (I'm mentioning only the important ones)-
handle: 0x000b, uuid: 00002902-0000-1000-8000-00805f9b34fb
handle: 0x0011, uuid: 00002902-0000-1000-8000-00805f9b34fb
handle: 0x0021, uuid: 6e400003-b5a3-f393-e0a9-e50e24dcca9e
handle: 0x0023, uuid: 00002902-0000-1000-8000-00805f9b34fb
handle: 0x0025, uuid: 6e400002-b5a3-f393-e0a9-e50e24dcca9e

From the uuid, it is clear that 0x0025 is the TX characteristic and 0x0021 is the RX characteristic.

On the Pi Terminal, a scan for CCCD entries is giving me 3 results-

[D0:5B:58:6F:AC:C6][LE]> char-read-uuid 2902
handle: 0x000b value: 00 00
handle: 0x0011 value: 00 00
handle: 0x0023 value: 00 00

However, out of the 3, only 0x0023 is actually enabling notifications on the RX characteristic. Why is it so? Why does the other 2 not work? What are they for? Please guide.

PalB09
 
Posts: 3
Joined: Thu Sep 05, 2019 10:57 am

Re: scan of CCCD entries gives 3 results

by hathach on Tue Sep 10, 2019 5:43 am

Any notifable/indicatable characteristics has its own cccd, in your particular case there are 3 cccds in the whole gatt server, e.g one for service changed characteristic, one for uart tx characteristic, one for something else. To enable Uart TX, you need to enable the right cccd. Hope this helps

hathach
 
Posts: 1020
Joined: Tue Apr 23, 2013 1:02 am

Re: scan of CCCD entries gives 3 results

by PalB09 on Tue Sep 10, 2019 7:53 am

hathach wrote:To enable Uart TX, you need to enable the right cccd. Hope this helps


Thank you so much for the reply. Is there a way of knowing the right handle without trial and error? I mean, just like TX and RX handle can be directly figured out from 6e400002 and 6e400003 respectively because they are unique, in the same way, is there any unique way of figuring out the exact handle for enabling RX characteristic, without checking each one of them and finding out which one works?

PalB09
 
Posts: 3
Joined: Thu Sep 05, 2019 10:57 am

Re: scan of CCCD entries gives 3 results

by hathach on Tue Sep 10, 2019 1:06 pm

the cccd appear (almost) after its characteristic on the GATT table as you can see after tx handle of 21, the cccd is handle of 23. In other case, there may be other descriptor (presentation, hid etc...) in between.

Code: Select all | TOGGLE FULL SIZE
handle: 0x000b, uuid: 00002902-0000-1000-8000-00805f9b34fb
handle: 0x0011, uuid: 00002902-0000-1000-8000-00805f9b34fb
[b]handle: 0x0021, uuid: 6e400003-b5a3-f393-e0a9-e50e24dcca9e
handle: 0x0023, uuid: 00002902-0000-1000-8000-00805f9b34fb[/b]
handle: 0x0025, uuid: 6e400002-b5a3-f393-e0a9-e50e24dcca9e

hathach
 
Posts: 1020
Joined: Tue Apr 23, 2013 1:02 am

Re: scan of CCCD entries gives 3 results

by PalB09 on Wed Sep 11, 2019 9:41 am

Thank you! :) That makes sense!

PalB09
 
Posts: 3
Joined: Thu Sep 05, 2019 10:57 am

Please be positive and constructive with your questions and comments.