<?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 long do pointers to characteristic data need to be valid?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9723/how-long-do-pointers-to-characteristic-data-need-to-be-valid</link><description>The documentation is lacking critical details about what the soft devices do with characteristic data you give it. When you create or update a characteristic you need to give it a pointer to the data. At this point two things can happen: 
 
 The data</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 14 Oct 2015 12:58:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9723/how-long-do-pointers-to-characteristic-data-need-to-be-valid" /><item><title>RE: How long do pointers to characteristic data need to be valid?</title><link>https://devzone.nordicsemi.com/thread/36001?ContentTypeID=1</link><pubDate>Wed, 14 Oct 2015 12:58:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2f4ee2b-9014-42d5-b26d-cf4e0d3c920d</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Ah frames. I&amp;#39;d forgotten those existed!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How long do pointers to characteristic data need to be valid?</title><link>https://devzone.nordicsemi.com/thread/36000?ContentTypeID=1</link><pubDate>Wed, 14 Oct 2015 12:56:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad503b56-1913-400f-9c55-5088b2549b4d</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;To properly copy links from infocenter, right-click on the desired chapter in the content list on the left side and copy from there - link that you provided point to main page.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How long do pointers to characteristic data need to be valid?</title><link>https://devzone.nordicsemi.com/thread/35999?ContentTypeID=1</link><pubDate>Wed, 14 Oct 2015 12:52:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9587b0b5-cfe8-48c6-9272-3fcd01f084d3</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Ah found it here: &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v1.0.0/structble__gatts__attr__t.html"&gt;infocenter.nordicsemi.com/.../structble__gatts__attr__t.html&lt;/a&gt;  By the way the formatting seems a bit wrong on that page. I think it would be nice if the function documentation mention this, rather than just the documentation for the parameter structure.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How long do pointers to characteristic data need to be valid?</title><link>https://devzone.nordicsemi.com/thread/35998?ContentTypeID=1</link><pubDate>Wed, 14 Oct 2015 12:50:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21b2195c-34e7-4f73-be3c-4cac05d19ff0</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;I can&amp;#39;t actually find that documentation snippet. It isn&amp;#39;t here: &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v1.0.0/group___b_l_e___g_a_t_t_s___f_u_n_c_t_i_o_n_s.html?cp=2_7_2_1_0_2_3_5_10#ga2760c51ea71853bd74e2e7e7117ef52a"&gt;infocenter.nordicsemi.com/.../group___b_l_e___g_a_t_t_s___f_u_n_c_t_i_o_n_s.html&lt;/a&gt;  or here: &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v1.0.0/structble__gatts__value__t.html"&gt;infocenter.nordicsemi.com/.../structble__gatts__value__t.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How long do pointers to characteristic data need to be valid?</title><link>https://devzone.nordicsemi.com/thread/35997?ContentTypeID=1</link><pubDate>Wed, 14 Oct 2015 12:45:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:910fca23-5613-48fa-9211-f3a8f1fd63df</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;This is actually documented together with the API calls themselves.&lt;/p&gt;
&lt;p&gt;For &lt;strong&gt;p_value&lt;/strong&gt; of &lt;strong&gt;ble_gatts_attr_t&lt;/strong&gt; (used in &lt;strong&gt;sd_ble_gatts_characteristic_add&lt;/strong&gt;, your example) this is stated:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Pointer to the attribute data. Please
note that if the @ref
BLE_GATTS_VLOC_USER value location is
selected in the attribute metadata,
this will have to point to a buffer
that remains valid through the
lifetime of the attribute. This
excludes usage of automatic variables
that may go out of scope or any other
temporary location. The stack may
access that memory directly without
the application&amp;#39;s knowledge. For
writable characteristics, this value
must not be a location in flash
memory.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Which means that the lifetime is defined based on &lt;strong&gt;ble_gatts_attr_md_t.vloc&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;If there are any other places where our documentation is lacking this, then please give us a hint.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How long do pointers to characteristic data need to be valid?</title><link>https://devzone.nordicsemi.com/thread/35996?ContentTypeID=1</link><pubDate>Wed, 14 Oct 2015 12:37:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9982208-1479-43c5-b7e7-8000354fe24a</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;I think that depends of vloc parameter in ble_gatts_attr_md_t... some description may be found &lt;a href="http://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v8.x.x/doc/8.0.0/s110/html/a00854.html#gaddb51f959e18123c5e215e22af0c31a9"&gt;here&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>