<?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>Timeout when I try to read the descriptor</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39416/timeout-when-i-try-to-read-the-descriptor</link><description>I tried to create a descriptor for a characteristic. I modified the app_blinky and added a ble_add_descr_params_t variable. After The Initialisation and definition of the ble_add_descr_params_t the descriptor is added with the descriptor_add funktion</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 18 Oct 2018 09:46:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39416/timeout-when-i-try-to-read-the-descriptor" /><item><title>RE: Timeout when I try to read the descriptor</title><link>https://devzone.nordicsemi.com/thread/153419?ContentTypeID=1</link><pubDate>Thu, 18 Oct 2018 09:46:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff9d1de1-4dd2-4be2-97ac-3775eb07029b</guid><dc:creator>Moe</dc:creator><description>&lt;p&gt;OK I found a mistake I made. The descriptor_add and the characteristic_add were in the wrong order.&lt;/p&gt;
&lt;p&gt;Thank you for the responses&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timeout when I try to read the descriptor</title><link>https://devzone.nordicsemi.com/thread/153302?ContentTypeID=1</link><pubDate>Wed, 17 Oct 2018 14:59:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:347379c5-eec3-4c34-b70b-2d50382f1bd6</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;HI Moe,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;NRF_ERROR_INVALID_STATE(0x08) is Invalid state to perform operation, a characteristic context is required. So I suspect that you&amp;#39;re not passing the right handle to the&amp;nbsp;descriptor_add() function.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please post the entire&amp;nbsp;ble_lbs_init() function so that I can check that you&amp;#39;re using the correct handle.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timeout when I try to read the descriptor</title><link>https://devzone.nordicsemi.com/thread/153087?ContentTypeID=1</link><pubDate>Tue, 16 Oct 2018 14:07:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f21aa0c7-a35a-4ea3-8474-8e1e8fcb2224</guid><dc:creator>Moe</dc:creator><description>&lt;p&gt;The error is comming from the function sd_ble_gatts_descriptor_add. Unfortunately I&amp;#39;m not able to specify it more, because I can&amp;#39;t see in this function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timeout when I try to read the descriptor</title><link>https://devzone.nordicsemi.com/thread/153038?ContentTypeID=1</link><pubDate>Tue, 16 Oct 2018 11:14:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5027d0a7-b0f7-4045-b071-d2c666c165f9</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Are you able to see on the&amp;nbsp;call stack where in d&lt;span&gt;escriptor_add&amp;nbsp;the&lt;/span&gt;&amp;nbsp;0x08 error originates from?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timeout when I try to read the descriptor</title><link>https://devzone.nordicsemi.com/thread/152804?ContentTypeID=1</link><pubDate>Mon, 15 Oct 2018 08:06:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e801a81-d2de-4cc2-a4c4-d1134650f396</guid><dc:creator>Moe</dc:creator><description>&lt;p&gt;Hi bjorn,&lt;/p&gt;
&lt;p&gt;Thank you for the fast response. When I implement your code the descriptor_add function returns a 8 as error code and the Program stops. The Log doesn&amp;#39;t says anything unusual. While Compiling I only get a warning for mixing types in your line 23 (desc_params.read_access = 1;) but this can be fixed with SEC_OPEN (what is the same).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timeout when I try to read the descriptor</title><link>https://devzone.nordicsemi.com/thread/152703?ContentTypeID=1</link><pubDate>Fri, 12 Oct 2018 13:15:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d51a3e9-f39b-460d-b0b6-c2a0a51c97de</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Moritz,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You need to give the descriptor a UUID, a own handle and initialize it with the correct parameters&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    // Add descriptor UUID to top off ble_lbs.h
    #define LBS_UUID_LED_DESC    0x1526
    
    // Modify ble_lbs_s struct in ble_lbs.h
    struct ble_lbs_s
    {
    uint16_t                    service_handle;      /**&amp;lt; Handle of LED Button Service (as provided by the BLE stack). */
    ble_gatts_char_handles_t    led_char_handles;    /**&amp;lt; Handles related to the LED Characteristic. */
    ble_gatts_char_handles_t    button_char_handles; /**&amp;lt; Handles related to the Button Characteristic. */
    uint8_t                     uuid_type;           /**&amp;lt; UUID type for the LED Button Service. */
    ble_lbs_led_write_handler_t led_write_handler;   /**&amp;lt; Event handler to be called when the LED Characteristic is written. */
    // Add handle for descriptor in the LBS struct
    uint16_t                    desc_handle;         
    };

    
    // Add this code below the led_char_add in ble_lbs_init()
    static uint8_t desc[] = &amp;quot;Hello&amp;quot;;
    ble_add_descr_params_t desc_params ={0};
    desc_params.uuid = LBS_UUID_LED_DESC;
    desc_params.uuid_type = p_lbs-&amp;gt;uuid_type;
    desc_params.is_value_user = false;
    desc_params.read_access = 1;
    desc_params.init_len = 0;
    desc_params.max_len = sizeof(desc);
    desc_params.p_value = desc;

    err_code= descriptor_add(p_lbs-&amp;gt;led_char_handles.value_handle, &amp;amp;desc_params, &amp;amp;p_lbs-&amp;gt;desc_handle);
    VERIFY_SUCCESS(err_code);
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>