Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

User Defined String for CHAR_DESCRIPTOR_UUID16

User Defined String for CHAR_DESCRIPTOR_UUID16

JaeyoungY_71
Employee
Employee
First comment on KBA 25 solutions authored 10 solutions authored

To write a user defined string for CHAR_DESCRIPTOR_UUID16, you need to do the following.

 

1. Add a char description and make the permission readable in wiced_bt_gatt_db.c

CHAR_DESCRIPTOR_UUID16(USER_DESCRIPTOR, GATT_UUID_CHAR_DESCRIPTION, LEGATTDB_PERM_READABLE ),

 

2. Add USER_DESCRIPTOR in enum in wiced_bt_gatt_db.h

 

3. In ble_proximity_reporter.c, define a global user_defined_str

static char user_defined_str[] = "Temperature in the room";

 

4. Add the following switch clause to ble_proximity_gatt_read_request() in ble_proximity_reporter.c

   case USER_DESCRIPTOR:

       p_attribute_value_source = user_defined_str;

       attribute_value_length = sizeof( user_defined_str );

       break;

 

5. In your LightBlue you should now see the string attached to the characteristic

 

  IMG_0844.jpg

425 Views