Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

User Description Descriptor Example

Hi guys,

Is there a recent example that shows how to add user description descriptors to characteristics on S132 V5.1 ? I have tried the various methods I could find in the Q&A, but have not had any luck. 

Thanks! 

  • To add a little bit more detail, I tried manually adding the description descriptor by editing the characteristic metadata as per below:

     memset(user_desc, 0, 10);
     strcpy(user_desc, "Test");
     char_md.p_char_user_desc = (uint8_t *) user_desc;
     char_md.char_user_desc_size = 4;//strlen(user_desc);
     char_md.char_user_desc_max_size = 4;//strlen(user_desc);

    and when that didn't work, I tried doing it through the sd_ble_gatts_descriptor_add() function

    In both cases, I tried doing it with the first characteristic in my service, and in both cases, the second characteristic was broken by the code. The second characteristic is a 20 byte read and notify with cccd characteristic. When I periodically update the characteristic from a timer in the firmware, the messages show up correctly at the central device. As soon as I try to add the description descriptor to the first characteristic, the second characteristic is broken and the messages no longer show up correctly at the central device. 

    I can post a full code listing it that would help, but it would be great if there is a known good example somewhere that I can have a look at.

  • Hello,

    Sorry for the late reply. May I ask what you intend to do? Are you trying to create a characteristic with notification?

    Sorry that this is not a thorough answer. We are a bit short staffed these days. 

    But yes. Are you sure that it is the descriptor you want to change, and not the cccd?

    Best regards,

    Edvin

  • Hi Edvin,

    I am wanting to add a 'User description descriptor' to an existing characteristic. The idea is that if you connect to the device with a generic app like LightBlue or your nRF Connect app, the app can display human readable text names for the characteristics. Searching through the Q&A, it looks like there are 2 way to do this, as described above, but neither way seems to work ?

    Appreciate your input ! Thanks

  • What does your sd_ble_gatts_descriptor_add() return?

    Does it return something other than 0 (NRF_SUCCESS)? Or is the issue that you don't see the name "test" on your central device?

     

    BR,

    Edvin

Related