<?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>Is the data passed to sd_ble_gatts_hvx() queued by value or by reference?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67284/is-the-data-passed-to-sd_ble_gatts_hvx-queued-by-value-or-by-reference</link><description>Using an approach similar to what&amp;#39;s in the ble_app_att_mtu_throughput example, my goal is to transfer data as fast as possible. (I.e. call sd_ble_gatts_hvx() on the same characteristic until I receive an NRF_ERROR_RESOURCES reply and then wait for the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 03 Dec 2025 00:15:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67284/is-the-data-passed-to-sd_ble_gatts_hvx-queued-by-value-or-by-reference" /><item><title>RE: Is the data passed to sd_ble_gatts_hvx() queued by value or by reference?</title><link>https://devzone.nordicsemi.com/thread/556058?ContentTypeID=1</link><pubDate>Wed, 03 Dec 2025 00:15:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0acdd057-704b-47b6-8674-c7f2fd66721e</guid><dc:creator>pcatania</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Torbj&amp;oslash;rn sorry to dig up an old post.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can I just ask, at what point is it safe to overwrite the p_data memory - I assume when&amp;nbsp;sd_ble_gatts_hvx() returns? But I wanted to check, I&amp;#39;ve been experiencing crashing when I call this aggressively fast during testing so I want to understand it as much as possible. Can I safely wait for&amp;nbsp;sd_ble_gatts_hvx() to return and immediately overwrite p_data?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks very much.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is the data passed to sd_ble_gatts_hvx() queued by value or by reference?</title><link>https://devzone.nordicsemi.com/thread/358911?ContentTypeID=1</link><pubDate>Fri, 18 Mar 2022 15:04:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4989adeb-4a76-4b36-afaa-fd0f241b6d9f</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;That&amp;#39;s what I wanted to know too!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is the data passed to sd_ble_gatts_hvx() queued by value or by reference?</title><link>https://devzone.nordicsemi.com/thread/275986?ContentTypeID=1</link><pubDate>Tue, 20 Oct 2020 14:48:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ea193ff-0e6f-4a67-8b95-4490f11f8c19</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;You welcome &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is the data passed to sd_ble_gatts_hvx() queued by value or by reference?</title><link>https://devzone.nordicsemi.com/thread/275408?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 14:17:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fde73682-3424-4e90-aa5f-f3e578ea262b</guid><dc:creator>rf_az</dc:creator><description>&lt;p&gt;That is good news - thank you for the info!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is the data passed to sd_ble_gatts_hvx() queued by value or by reference?</title><link>https://devzone.nordicsemi.com/thread/275387?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 13:26:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc82e0b4-c3ba-45ad-b644-edf22fbb6c1e</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When you call&amp;nbsp;&lt;span&gt;sd_ble_gatts_hvx() the data pointed to by p_data will be copied to an internal buffer in the SoftDevice, so there is no need to keep this data in the buffer until the data is sent by the stack.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;br /&gt;Torbjørn&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>