Characteristic cannot show descriptors

Hi 
I tried to put descriptor on the characteristic recently and it didn't seem to work. Is there something wrong with that?

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*Initialize alert service parameter and add charactoristics to the service*/
uint32_t ble_alert_init(ble_nus_t * p_alert, ble_nus_init_t const * p_alert_init)
{
uint32_t err_code;
ble_uuid_t ble_uuid;
ble_uuid128_t alert_base_uuid = ALERT_BASE_UUID;
VERIFY_PARAM_NOT_NULL(p_alert);
VERIFY_PARAM_NOT_NULL(p_alert_init);
/*Initialize the second custom service structure.*/
p_alert->data_handler = p_alert_init->data_handler;
err_code = sd_ble_uuid_vs_add(&alert_base_uuid, &p_alert->uuid_type);
//VERIFY_SUCCESS(err_code);
ble_uuid.type = p_alert->uuid_type;
ble_uuid.uuid = BLE_UUID_ALERT_SERVICE;
/*Add second custom service.*/
err_code = sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

If I take the following code that adds characteristic, descriptor will be displayed successfully,I want to know why my code above won't display descriptor.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*Initialize alert service parameter and add charactoristics to the service*/
uint32_t ble_alert_init(ble_nus_t * p_alert, ble_nus_init_t const * p_alert_init)
{
uint32_t err_code;
ble_uuid_t ble_uuid;
uint8_t value[130] = {0x00};
uint8_t data_len = 0;
ble_uuid128_t alert_base_uuid = ALERT_BASE_UUID;
VERIFY_PARAM_NOT_NULL(p_alert);
VERIFY_PARAM_NOT_NULL(p_alert_init);
/*Initialize the second custom service structure.*/
p_alert->data_handler = p_alert_init->data_handler;
err_code = sd_ble_uuid_vs_add(&alert_base_uuid, &p_alert->uuid_type);
//VERIFY_SUCCESS(err_code);
ble_uuid.type = p_alert->uuid_type;
ble_uuid.uuid = BLE_UUID_ALERT_SERVICE;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



Best regard

  • Hi,

    The names you give to characteristics only exist locally in your implementation (or in a standard document if it is a standard sevice). Over the air, only numbers are usedin Bluetooth, so you will need to map the UUID value to what it represents (and name it) in all implementations, for in your mobile phone app. nRF Connect for mobile cannot know what you want to name your servies, and will only show the UUID (it shows names for some services/characteristics that is knows about because it is part of the app implementation).