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

how to add PROPERTY UUID and DESCRIPTOR UUID ?

Hi, We are trying to add gatt characteristic, we have a reference code which is BLE based, but other chipset and we are trying to port the code to Nordic 51822 chipset using Nordic ble stack

while adding gatt characteristic [VALUE], we need to do 2 more char additions [property and descriptor]. i see the the PROPERTY uuid as 0x2803 [please see the below link] developer.bluetooth.org/.../DeclarationsHome.aspx and also DESCRIPTOR uuid as 0x2901 developer.bluetooth.org/.../DescriptorsHomePage.aspx

so its like this PROPERTY characteristic add with uuid 0x2803 proprietary/VALUE characteristic add with uuid DESCRIPTOR characteristic add with uuid 0x2901

please help me with following code

In below structure typedef struct { uint8_t format; /< Format of the value, see @ref BLE_GATT_CPF_FORMATS. */ int8_t exponent; /< Exponent for integer data types. */ uint16_t unit; /< UUID from Bluetooth Assigned Numbers. */ uint8_t name_space; /< Namespace from Bluetooth Assigned Numbers, see @ref BLE_GATT_CPF_NAMESPACES. */ uint16_t desc; /**< Namespace description from Bluetooth Assigned Numbers, see @ref BLE_GATT_CPF_NAMESPACES. */ } ble_gatts_char_pf_t; the unit which stands for UUID should be choosen for PROPERTY characteristic add with uuid 0x2803 Is this correct place to add the PROPERTY chara UUID of 0x2803?

the actual propietary uuid is added here attr_char_value.p_uuid = &ble_uuid;

how to add the DESCRIPTOR  uuid 0x2901, i could not find any place in all data 
structures where to add this uuid of descriptor.

Please let me know how to do it.

Thanks

Parents
  • FormerMember
    0 FormerMember

    A descriptor is added by adding it to the characteristic metadata in the characteristic where it belongs, it can be done the following way:

    1 . Define a description:

    #define TX_DESC 												"TX_char"
    
    1. Add the description to the characteristic metatdata:

       uint8_t					   user_descr[] = TX_DESC;
       char_md.char_user_desc_max_size			= sizeof(user_descr);
       char_md.char_user_desc_size		        = sizeof(user_descr);
       char_md.p_char_user_desc                = (uint8_t *) user_descr;
      

    A property is added a similar way; it is also added by adding it to the characteristic metadata for the characteristic where it belongs:

    char_md.char_props.write            = 1;
    char_md.char_props.write_wo_resp    = 1;
    char_md.char_props.indicate			= 1;
    
Reply
  • FormerMember
    0 FormerMember

    A descriptor is added by adding it to the characteristic metadata in the characteristic where it belongs, it can be done the following way:

    1 . Define a description:

    #define TX_DESC 												"TX_char"
    
    1. Add the description to the characteristic metatdata:

       uint8_t					   user_descr[] = TX_DESC;
       char_md.char_user_desc_max_size			= sizeof(user_descr);
       char_md.char_user_desc_size		        = sizeof(user_descr);
       char_md.p_char_user_desc                = (uint8_t *) user_descr;
      

    A property is added a similar way; it is also added by adding it to the characteristic metadata for the characteristic where it belongs:

    char_md.char_props.write            = 1;
    char_md.char_props.write_wo_resp    = 1;
    char_md.char_props.indicate			= 1;
    
Children
Related