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!
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!
sd_ble_gatts_descriptor_add() returns NRF_SUCCESS, but after that I still don't see the name that I specified in the app. More importantly, when I do that on my first characteristic, it somehow damages the second characteristic, which should be reporting consistent data with a notify to the central device. As soon as I try either method to add the user description descriptor to the first characteristic, the second characteristic does not report the correct data anymore.
Could you possibly grab any of your examples and try to add a user description descriptor?
Hello,
I added a description to the heart_rate_measurement characteristic in the ble_app_hrs example from SDK14..2.0.
It will not help to upload the project file, since the ble_hrs.c file is outside the project folder. I would have to upload the entire SDK for that. But all you need to change in order to add the characteristic user description is inside the heart_rate_measurement_char_add() function in the ble_hrs.c file.
Try an unmodified version of this project, and apply the changes between the lines:
memset(&char_md, 0, sizeof(char_md)); (line 243)
and
BLE_UUID_BLE_ASSIGN(ble_uuid, BLE_UUID_HEART_RATE_MEASUREMENT_CHAR);
It should look like this:
static_uint32_t heart_rate_measurement_char_add(...) [...] memset(&char_md, 0, sizeof(char_md)); // Char_user_desc added. Change from here char_md.char_props.notify = 1; //char_md.p_char_user_desc = NULL; char_md.p_char_pf = NULL; char_md.p_user_desc_md = NULL; char_md.p_cccd_md = &cccd_md; char_md.p_sccd_md = NULL; static char user_desc[] = "name"; // in nRF Connect this will show as "6E 61 6D 65" 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); // Char_user_desc added. Change to here BLE_UUID_BLE_ASSIGN(ble_uuid, BLE_UUID_HEART_RATE_MEASUREMENT_CHAR); [...] }
Compile and flash the project. If you connect to it with nRF Connect for Desktop, it should look like this:
Best regards,
Edvin
I have gone through the exact same steps, and find there is no way to get a human readable descriptor to show next to a custom characteristic in NrfConnect.
That seems too implausible to be true -- there must be a way...??
Did you try the implementation in my last reply?
It depends on what you mean by human readable, but the name "name" is there in hexadecimal reprecentation (0x6e 0x61 0x6d 0x65). nRF Connect for Desktop only supports hexadecimal view, but if you have your own mobile application it would be a small task to convert this to a "Human readable" text string.
I agree with you - we can see it in hex. However, We use nRFconnect as a tool for technicians, espc because of DFU - for that reason it would be great if they could also use it to quickly scan various services in human readable form...