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

Where is the descriptor added in \examples\ble_peripheral\ble_app_uart?

Hello, when I run the subject example and connect to it, I see the RX and TX characteristics like I'd expect.

However, I see a descriptor on the TX characteristic which I didn't expect.

I've studied the code and can't see where this is added.  There certainly is no call to descriptor_add or to sd_ble_gatts_descriptor_add.

What is the single descriptor, and is it added automatically and why?  And if not, where is it added?

Thank you.

Edit:

Here is all the service initialization code

  
            // Add the RX Characteristic.
            memset(&add_char_params, 0, sizeof(add_char_params));
            add_char_params.uuid                     = BLE_UUID_NUS_RX_CHARACTERISTIC;
            add_char_params.uuid_type                = service_uuid.type;
            add_char_params.max_len                  = 244;
            add_char_params.init_len                 = sizeof(uint8_t);
            add_char_params.is_var_len               = true;
            add_char_params.char_props.write         = 1;
            add_char_params.char_props.write_wo_resp = 1;

            add_char_params.read_access  = SEC_OPEN;
            add_char_params.write_access = SEC_OPEN;

    

            err_code = characteristic_add(p_our_service->service_handle, &add_char_params,&(p_our_service->characteristic1_handles));
            if (err_code != NRF_SUCCESS) { RETURN_FAULT(18,err_code) }
            
            //////////////////////////////////////////
            // * Service                 
            //   * RX characteristic   
            //   * TX characteristic    <--- Add this
            //////////////////////////////////////////  
            
            // Add the TX Characteristic.
            /**@snippet [Adding proprietary characteristic to the SoftDevice] */
            memset(&add_char_params, 0, sizeof(add_char_params));
            add_char_params.uuid              = BLE_UUID_NUS_TX_CHARACTERISTIC;
            add_char_params.uuid_type         = service_uuid.type;
            add_char_params.max_len           = 244;
            add_char_params.init_len          = sizeof(uint8_t);
            add_char_params.is_var_len        = true;
            add_char_params.char_props.notify = 1;

            add_char_params.read_access       = SEC_OPEN;
            add_char_params.write_access      = SEC_OPEN;
            add_char_params.cccd_write_access = SEC_OPEN;

            err_code = characteristic_add(p_our_service->service_handle, &add_char_params,&(p_our_service->characteristic2_handles));
            if (err_code != NRF_SUCCESS) { RETURN_FAULT(20,err_code) }

Here is one screen shot from a phone sniffer, you can see "Descriptors: 1" even though no code creating it above

And here is another screenshot from my custom tool, you can see the UUID of the mystery descriptor

Related