<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nRF Connect desktop  Error: &amp;quot;failed to get descriptor&amp;quot;</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57996/nrf-connect-desktop-error-failed-to-get-descriptor</link><description>Hi, 
 I am trying to use nRF Connect for desktop with a dongle or nrf52 DK to connect with another board. When I want to get the value from the connected board, it would always display this error: &amp;quot;failed to get descriptor&amp;quot;, no matter whether using &amp;quot;notify</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 12 Apr 2020 09:11:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57996/nrf-connect-desktop-error-failed-to-get-descriptor" /><item><title>RE: nRF Connect desktop  Error: "failed to get descriptor"</title><link>https://devzone.nordicsemi.com/thread/244256?ContentTypeID=1</link><pubDate>Sun, 12 Apr 2020 09:11:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81afdccf-bcfd-4c07-b1fb-8c7f5f3c35c8</guid><dc:creator>JJJSchmidt</dc:creator><description>&lt;p&gt;Take a look at Hung Bui&amp;#39;s answer to &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/7222/ble-nus---tx-cccd-discovery/25507?focus=true"&gt;this&lt;/a&gt; question.&amp;nbsp; If you are not using the peer manager, you must handle the BLE_GATTS_EVT_SYS_ATTR_MISSING event in your BLE event handler function.&amp;nbsp; The blinky example includes this case in the function ble_evt_handler() in main.c:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;        case BLE_GATTS_EVT_SYS_ATTR_MISSING:
            // No system attributes have been stored.
            err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
            APP_ERROR_CHECK(err_code);
            break;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It appears that without this response nRF Connect for desktop will hang until it hits a GATT timeout, and will show the error &amp;quot;Failed to get descriptors, a gatt operation already in progress&amp;quot; or simply &amp;quot;Received a Gatt timeout&amp;quot;.&amp;nbsp; Another indication is when you hover the mouse over the arrow to toggle notifications (to the right of the characteristic), you see the message &amp;quot;CCCD not discovered&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect desktop  Error: "failed to get descriptor"</title><link>https://devzone.nordicsemi.com/thread/235473?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 13:46:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8227f7d3-8d16-40ca-b750-c1102663e812</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Then there must be something in your simplified HRM service/function that is causing this error. Please try comparing these to try and find out what the critical changes are. Error 133 (0x85) is just a general GATT error, so it&amp;#39;s hard to say what exactly is the reason.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect desktop  Error: "failed to get descriptor"</title><link>https://devzone.nordicsemi.com/thread/235412?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 11:13:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0670b25a-95bd-4574-9a0a-0ee3b9194b6b</guid><dc:creator>Taoyi</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Error_5F00_133_5F00_0x85_5F00_GATT.jpg" /&gt;Here&amp;#39;s the log when I tried to read the descriptor&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect desktop  Error: "failed to get descriptor"</title><link>https://devzone.nordicsemi.com/thread/235355?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 08:45:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14e7d91d-9e1e-4602-b2aa-f05c90c47614</guid><dc:creator>Taoyi</dc:creator><description>&lt;p&gt;Thanks for your help. This error only happens when the characteristic uses notification and&amp;nbsp;has&amp;nbsp;cccd. I tried your method and it does not work.&amp;nbsp;&lt;br /&gt;The example I&amp;#39;m using only remove battery level service, and simplify the heart rate function. Here&amp;#39;s the related code, and I cannot find the difference of CCCD related part between official example and this one.&amp;nbsp;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void services_init(void)
{
ret_code_t err_code;
ble_hrs_init_t hrs_init;
ble_dis_init_t dis_init;
uint8_t body_sensor_location;
nrf_ble_qwr_init_t qwr_init = {0};

qwr_init.error_handler = nrf_qwr_error_handler;
err_code = nrf_ble_qwr_init(&amp;amp;m_qwr, &amp;amp;qwr_init);
APP_ERROR_CHECK(err_code);


/*------------------------------------*/
body_sensor_location = BLE_HRS_BODY_SENSOR_LOCATION_WRIST;
memset(&amp;amp;hrs_init, 0, sizeof(hrs_init));
hrs_init.evt_handler = NULL;
hrs_init.is_sensor_contact_supported = true;
hrs_init.p_body_sensor_location = &amp;amp;body_sensor_location;

hrs_init.hrm_cccd_wr_sec = SEC_OPEN;
hrs_init.bsl_rd_sec = SEC_OPEN;
err_code = ble_hrs_init(&amp;amp;m_hrs, &amp;amp;hrs_init);
APP_ERROR_CHECK(err_code);
/*--------------------END-------------------*/

/*------------------------------*/
memset(&amp;amp;dis_init, 0, sizeof(dis_init));

ble_srv_ascii_to_utf8(&amp;amp;dis_init.manufact_name_str, (char *)MANUFACTURER_NAME);
dis_init.dis_char_rd_sec = SEC_OPEN;
err_code = ble_dis_init(&amp;amp;dis_init);
APP_ERROR_CHECK(err_code);
/*-------------------END-----------------*/
}

&lt;/pre&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint32_t ble_hrs_init(ble_hrs_t * p_hrs, const ble_hrs_init_t * p_hrs_init)
{
    uint32_t              err_code;
    ble_uuid_t            ble_uuid;
    ble_add_char_params_t add_char_params;
    uint8_t               initial_hrm[9];
	uint8_t               encoded_initial_hrm[MAX_HRM_LEN];
  
    p_hrs-&amp;gt;evt_handler                 = p_hrs_init-&amp;gt;evt_handler;
    p_hrs-&amp;gt;is_sensor_contact_supported = p_hrs_init-&amp;gt;is_sensor_contact_supported;
    p_hrs-&amp;gt;conn_handle                 = BLE_CONN_HANDLE_INVALID;
    p_hrs-&amp;gt;is_sensor_contact_detected  = false;
    p_hrs-&amp;gt;rr_interval_count           = 0;
    p_hrs-&amp;gt;max_hrm_len                 = MAX_HRM_LEN;

    BLE_UUID_BLE_ASSIGN(ble_uuid, BLE_UUID_HEART_RATE_SERVICE);
    err_code = sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY,
                                        &amp;amp;ble_uuid,
                                        &amp;amp;p_hrs-&amp;gt;service_handle);
    if (err_code != NRF_SUCCESS)
    {
        return err_code;
    }

    memset(&amp;amp;add_char_params, 0, sizeof(add_char_params));
    add_char_params.uuid              = BLE_UUID_HEART_RATE_MEASUREMENT_CHAR;
    add_char_params.max_len           = MAX_HRM_LEN;
    add_char_params.init_len          = hrm_encode(p_hrs, INITIAL_VALUE_HRM, encoded_initial_hrm);
    add_char_params.p_init_value      = encoded_initial_hrm;
    add_char_params.is_var_len        = true;
	
    add_char_params.char_props.notify = 1;
    add_char_params.cccd_write_access = p_hrs_init-&amp;gt;hrm_cccd_wr_sec;
				
		//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);
		
		
    //Add char
    err_code = characteristic_add(p_hrs-&amp;gt;service_handle, &amp;amp;add_char_params, &amp;amp;(p_hrs-&amp;gt;hrm_handles));
    if (err_code != NRF_SUCCESS)
    {
        return err_code;
    }
		
		
		
    if (p_hrs_init-&amp;gt;p_body_sensor_location != NULL)
    {
        memset(&amp;amp;add_char_params, 0, sizeof(add_char_params));
        add_char_params.uuid            = BLE_UUID_BODY_SENSOR_LOCATION_CHAR;
        add_char_params.max_len         = sizeof(uint8_t);
        add_char_params.init_len        = sizeof(uint8_t);
        add_char_params.p_init_value    = p_hrs_init-&amp;gt;p_body_sensor_location;
        add_char_params.char_props.read = 1;
        add_char_params.read_access     = p_hrs_init-&amp;gt;bsl_rd_sec;
				
        err_code = characteristic_add(p_hrs-&amp;gt;service_handle, &amp;amp;add_char_params, &amp;amp;(p_hrs-&amp;gt;bsl_handles));
        if (err_code != NRF_SUCCESS)
        {
            return err_code;
        }
    }

    return NRF_SUCCESS;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect desktop  Error: "failed to get descriptor"</title><link>https://devzone.nordicsemi.com/thread/235329?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 07:59:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c9eb488-a9df-4157-b6be-15c1c320b184</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What exact changes have been made from the original ble_app_hrs example? Does this error occur on all of the services, or just the body sensor one? Is seems like the body sensor characteristic has been edited somewhat in your example. Can you show me how it is configured as well?&lt;/p&gt;
&lt;p&gt;I also see that your init_len and init_value differs from the characteristic parameters of the HRM configuration, try changing these to the values below to see if that helps.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    add_char_params.init_len          = hrm_encode(p_hrs, INITIAL_VALUE_HRM, encoded_initial_hrm);
    add_char_params.p_init_value      = encoded_initial_hrm;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;We also have &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial"&gt;this BLE characteristics tutorial&lt;/a&gt;, so if your goal is to add custom characteristics I suggest taking a look at that.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect desktop  Error: "failed to get descriptor"</title><link>https://devzone.nordicsemi.com/thread/235206?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2020 13:47:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2b49efa-4b7e-40f1-a57e-912c5e822ed0</guid><dc:creator>Taoyi</dc:creator><description>&lt;p&gt;I tried the hrs example in the official SDK and it works. The example I was running was provided by another company and it was just a simplified version of&amp;nbsp;&lt;span&gt;the official&amp;nbsp;ble_hrs_example.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;When I tried to connect it using nrf connect for android, if I first open the notification, and then read the cccd, it works. However, if I first read the cccd, then&amp;nbsp;it returns the error! It depends on the order! All other functions (read the location...) could work.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;Thus, I&amp;#39;m thinking that could it be possible that some configurations are wrong? or some parameters are wrong? or something is missing?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Here&amp;#39;s the code of charateristic add part&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;    memset(&amp;amp;add_char_params, 0, sizeof(add_char_params));
    add_char_params.uuid              = BLE_UUID_HEART_RATE_MEASUREMENT_CHAR;
    add_char_params.max_len           = MAX_HRM_LEN;
    add_char_params.init_len          = 0;
    add_char_params.p_init_value      = initial_hrm;
    add_char_params.is_var_len        = true;
    add_char_params.char_props.notify = 1;
    add_char_params.cccd_write_access = p_hrs_init-&amp;gt;hrm_cccd_wr_sec;
				
	
    err_code = characteristic_add(p_hrs-&amp;gt;service_handle, &amp;amp;add_char_params, &amp;amp;(p_hrs-&amp;gt;hrm_handles));
    if (err_code != NRF_SUCCESS)
    {
        return err_code;
    }&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you very much&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect desktop  Error: "failed to get descriptor"</title><link>https://devzone.nordicsemi.com/thread/235189?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2020 12:50:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6253e635-7ec7-4f58-9ca1-a9c386b71c63</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Taoyi&lt;/p&gt;
&lt;p&gt;According to the error message, another GATT operation is already in progress, so I assume the connected board is already doing something GATT related. What application is this? I just tested myself, using the ble_app_hrs example application (SDK v.16.0.0), and don&amp;#39;t run into this problem at all using two nRF52 DKs. AS you can see in the log below, reading and writing attribute values do not cause any issues.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-4b1955674ff7491eabbd6f30dba7fd03/pastedimage1582116576454v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect desktop  Error: "failed to get descriptor"</title><link>https://devzone.nordicsemi.com/thread/235107?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2020 09:38:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24f3602b-03a0-49ae-af02-80f99c2e69de</guid><dc:creator>Taoyi</dc:creator><description>&lt;p&gt;When I used nrf connect for android, it cannot read the value of CCCD. But the value of&amp;nbsp;CCCD should be 0x0000 or 0x0001 depends on whether the notification is opening!&lt;/p&gt;
&lt;p&gt;When I tried to read the value, it would disconnect and return error 0x85 GATT error&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>