<?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>How to change value of descriptor?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/11277/how-to-change-value-of-descriptor</link><description>Hello, 
 I&amp;#39;ve generated code via latest BDS and nRF51 SDK 10 plugin, and everything works OK, beside &amp;quot;desciptor&amp;quot; change.
When I execute function to set value of descriptor: 
 ble_control_register_data_descriptor_set(&amp;amp;service_struct, &amp;amp;control_register_data_descriptor</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Jan 2016 12:34:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/11277/how-to-change-value-of-descriptor" /><item><title>RE: How to change value of descriptor?</title><link>https://devzone.nordicsemi.com/thread/42415?ContentTypeID=1</link><pubDate>Tue, 19 Jan 2016 12:34:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cfad1ef-74f9-4e8f-afe9-b22c36d2b112</guid><dc:creator>jokii</dc:creator><description>&lt;p&gt;Regarding name &amp;quot;New descriptor&amp;quot;, it was generated by BDS. Originally defined name was just &amp;quot;descriptor&amp;quot;. Maybe this also have to be fixed in BDS plugin.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change value of descriptor?</title><link>https://devzone.nordicsemi.com/thread/42414?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2016 15:30:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bab3857-a6f0-4ba8-9643-8a4ed0894075</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;Inside &lt;code&gt;ble_service_control_register_data_new_descriptor_set&lt;/code&gt; we find&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;return sd_ble_gatts_value_set(p_service-&amp;gt;conn_handle, p_service-&amp;gt;control_register_data_new_descriptor_handles.value_handle, &amp;amp;gatts_value);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The attribute handle we use here (second parameter) is never set. It is given to us here In &lt;code&gt;ble_service_init&lt;/code&gt; :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = descriptor_add(BLE_GATT_HANDLE_INVALID, &amp;amp;control_register_data_new_descriptor, &amp;amp;descr_handle);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But descr handle is not saved to &lt;code&gt;p_service-&amp;gt;control_register_data_new_descriptor_handles.value_handle, &amp;amp;gatts_value&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I am not sure if this is a bug in BDS or the Nordic Plugin.  Try replacing this in &lt;code&gt;ble_service_init&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = descriptor_add(BLE_GATT_HANDLE_INVALID, &amp;amp;control_register_data_new_descriptor, &amp;amp;descr_handle);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;with this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = descriptor_add(BLE_GATT_HANDLE_INVALID, &amp;amp;control_register_data_new_descriptor, &amp;amp;(p_service-&amp;gt;control_register_data_new_descriptor_handles.value_handle));
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we pass the attribute handle of the service struct, and the function descriptor_add will save the handle for us.&lt;/p&gt;
&lt;p&gt;PS: Try to avoid naming your descriptors &amp;quot;New descriptor&amp;quot;. It is very confusing to read the generated code :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change value of descriptor?</title><link>https://devzone.nordicsemi.com/thread/42413?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2016 14:09:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:350c4aa5-e405-4444-ae29-ac12a0bd3c78</guid><dc:creator>jokii</dc:creator><description>&lt;p&gt;Sorry for misleading - &lt;code&gt;ble_mug_control_register_data_set&lt;/code&gt; and &lt;code&gt;ble_control_register_data_descriptor_set&lt;/code&gt; was edited by hand before I&amp;#39;ve attached example project (original source). In attached example project where I extracted problem &lt;code&gt;ble_control_register_data_descriptor_set&lt;/code&gt; corresponds to &lt;code&gt;ble_service_control_register_data_new_descriptor_set&lt;/code&gt;as you can see in code snippet (ble_service.c:114-118). &lt;code&gt;ble_mug_control_register_data_set&lt;/code&gt; in example isn&amp;#39;t present (it&amp;#39;s work, so not included).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change value of descriptor?</title><link>https://devzone.nordicsemi.com/thread/42412?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2016 14:00:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2bf244bb-d626-42d4-949e-5f405e94ea37</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;I cannnot find  &lt;code&gt;ble_mug_control_register_data_set&lt;/code&gt; nor &lt;code&gt;ble_control_register_data_descriptor_set&lt;/code&gt; in the files you provided. In which file and what line under can i find them?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change value of descriptor?</title><link>https://devzone.nordicsemi.com/thread/42411?ContentTypeID=1</link><pubDate>Wed, 13 Jan 2016 16:03:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:adb40fc9-b999-47c5-9544-64e34af8ca16</guid><dc:creator>jokii</dc:creator><description>&lt;p&gt;Finally found attach file button :)
File: &amp;quot;experimental_bluetoothds_template_COPY.zip&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to change value of descriptor?</title><link>https://devzone.nordicsemi.com/thread/42410?ContentTypeID=1</link><pubDate>Wed, 13 Jan 2016 13:48:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b5f6263-3f81-4f95-9d61-1da78fd7450e</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;I cannot access the attached file on filedropper for some reason. Can you attach a zip of the project to your question post?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>