Pico W: Adding in additional descriptors to my custom characteritics

7 views
Skip to first unread message

Gerriko io

unread,
May 7, 2025, 1:32:42 PMMay 7
to btstack-dev
I'm using the Raspberry Pico W C SDK and trying to modify the standalone example (environmental service with temperature characteristic), but I am having problems getting this to work.

The first mod is to add in a user description (0x2901). I could not find anything in the BTstack user manuals for "descriptors". Seems this part of the characteristic has been ignored.

I had a search on the Github repository for 0x2901. This returns a couple of options. For example, inside the compile_gatt.py tool this is shown to be linked to "CHARACTERISTIC_USER_DESCRIPTION" which triggers the parseGenericDynamicDescriptor function. Inside this function it is looking to use the global variable current_characteristic_uuid_string.

What I cannot figure is how to define this string.





Matthias Ringwald

unread,
May 8, 2025, 12:30:48 PMMay 8
to btsta...@googlegroups.com
Hi Gerriko

You are right that the manual only explains how to setup services with characteristics. 
Your search got you rather close. To add a user description to a characteristics, please add CHARACTERISTIC_USER_DESCRIPTION with suitable attributes.

E.g. the gatt counter service with a user description would be

// Counter Service
PRIMARY_SERVICE, 0000FF10-0000-1000-8000-00805F9B34FB
// Counter Characteristic, with read, write and notify
CHARACTERISTIC,  0000FF11-0000-1000-8000-00805F9B34FB, READ | WRITE | NOTIFY | DYNAMIC,
CHARACTERISTIC_USER_DESCRIPTION, READ

The current version of compile_gatt.py assumes that the user description is dynamic, which means that you can provide the value to a read in the att_read_callback.
In the example above, compile_gatt.py provides the following define.

ATT_CHARACTERISTIC_0000FF11_0000_1000_8000_00805F9B34FB_01_USER_DESCRIPTION_HANDLE

Cheers
 Matthias



--
You received this message because you are subscribed to the Google Groups "btstack-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/btstack-dev/2154d0fe-7235-4c15-bfa7-e16e42f7d748n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages