Bluetooth supports descriptors for characteristics.
In bluetooth.c for nrf is this:
char_md.p_char_pf = NULL;
char_md.p_user_desc_md = NULL;
char_md.p_cccd_md = NULL;
char_md.p_sccd_md = NULL;
I can't find a way where they are used.
If yes,is this the right place to search for descriptors ?
As I understand it (I could be wrong!):
A characteristic on a device has a handle - it's basically a number (a byte value?) which is the index of the characteristic in that device.
Then there's the cccd - it's another handle that is used for setting flags to do with that characteristic. Specifically Espruino uses that handle to write to a device and ask for notifications - it's done here: jswrap_nrf_BluetoothRemoteGATTCharacteristic_startNotifications
So Espruino stores those two as handle_cccd and handle_value (the actual characteristic) on BluetoothRemoteGATTCharacteristic. I think that should work for ESP32 as well.
I'm not sure about the others if I'm honest, but I think you could probably ignore them safely for now.
Well, the only thing I know is, in a sample there is this:
Client Characteristic Configuration would be the cccd I was talking about. I'm not 100% sure about the others - as you say, I'd ignore them until you think you need them :)
Client Characteristic Configuration
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem