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

user description descriptor

Hi, How to set user description descriptor to a particular attribute? I have created one primary gatt service with more than four characteristics, when is see it through the master control panel, i get confuse on which is belongs to which characteristics. I have attached the snap of my master control panel, please suggest me how to add descriptors like battery level, device name in some other characteristics.

Regards, Balaji

master_control_panel.png

Parents
  • Adding a User Description Descriptor should just require setting 3 additional fields in the ble_gatts_char_md_t:

    
        char_md.p_char_user_desc  = (uint8_t *) user_desc;
        char_md.char_user_desc_size = strlen(user_desc);
        char_md.char_user_desc_max_size = strlen(user_desc);
    
    

    Based on your screenshot, it seems as if you've forgotten to set the size parameters, but have a memset on the structure, setting all fields to 0, essentially giving you a 0-length user description.

Reply
  • Adding a User Description Descriptor should just require setting 3 additional fields in the ble_gatts_char_md_t:

    
        char_md.p_char_user_desc  = (uint8_t *) user_desc;
        char_md.char_user_desc_size = strlen(user_desc);
        char_md.char_user_desc_max_size = strlen(user_desc);
    
    

    Based on your screenshot, it seems as if you've forgotten to set the size parameters, but have a memset on the structure, setting all fields to 0, essentially giving you a 0-length user description.

Children
No Data
Related