<?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>There are a way to clean queued data on tx buffer?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86099/there-are-a-way-to-clean-queued-data-on-tx-buffer</link><description>Hi everyone, 
 I am using nrfConnect 3.9.3, And SDK v1.7.0. 
 I am working on a project based on uart example. 
 My question is if there are some way for clean/discard all the data that a peer have buffered on nus tx characteristic through bt_nus_send</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 25 Mar 2022 15:40:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86099/there-are-a-way-to-clean-queued-data-on-tx-buffer" /><item><title>RE: There are a way to clean queued data on tx buffer?</title><link>https://devzone.nordicsemi.com/thread/360071?ContentTypeID=1</link><pubDate>Fri, 25 Mar 2022 15:40:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3c6cdca-1356-41b6-b314-186115124694</guid><dc:creator>Priyanka</dc:creator><description>&lt;p&gt;Hi Daniel,&lt;/p&gt;
&lt;p&gt;I am afraid there is no way to achieve this. Once the data is uploaded in the stack it stays there until it is transmitted or disconnected.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Priyanka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: There are a way to clean queued data on tx buffer?</title><link>https://devzone.nordicsemi.com/thread/359812?ContentTypeID=1</link><pubDate>Thu, 24 Mar 2022 13:01:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9de82825-53bb-4c0a-9add-580fa7bfea94</guid><dc:creator>sotillo2409</dc:creator><description>&lt;p&gt;As I know data is queued until data is sent or there is a disconnection.&lt;/p&gt;
&lt;p&gt;There isn&amp;#39;t a way to trigger the same function as a disconnection trigger to clean the ble tx buffer on softdevice?&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: There are a way to clean queued data on tx buffer?</title><link>https://devzone.nordicsemi.com/thread/359765?ContentTypeID=1</link><pubDate>Thu, 24 Mar 2022 10:26:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9bc17fa0-02b8-482b-b35a-790577817a38</guid><dc:creator>sotillo2409</dc:creator><description>&lt;p&gt;Hi another tiime,&lt;/p&gt;
&lt;p&gt;my question is same as:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/37627/reset-clear-hvn-tx-queue"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/37627/reset-clear-hvn-tx-queue&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But on the SDK 1.7.0 on a nrf52840 with softdevice s140.&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: There are a way to clean queued data on tx buffer?</title><link>https://devzone.nordicsemi.com/thread/359760?ContentTypeID=1</link><pubDate>Thu, 24 Mar 2022 10:08:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22d2526d-7d40-4f13-8fdb-33995dfdb235</guid><dc:creator>sotillo2409</dc:creator><description>&lt;p&gt;Hi, sorry but I have implemented the radio notification distances callback already. What I need is a way to clean the data queued on ble tx buffer as i explained on my first post&lt;/p&gt;
[quote userid="107158" url="~/f/nordic-q-a/86099/there-are-a-way-to-clean-queued-data-on-tx-buffer"]My question is if there are some way for clean/discard all the data that a peer have buffered on nus tx characteristic through &lt;strong&gt;bt_nus_send().&lt;/strong&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you Priyanka&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f603.svg" title="Smiley"&gt;&amp;#x1f603;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: There are a way to clean queued data on tx buffer?</title><link>https://devzone.nordicsemi.com/thread/359753?ContentTypeID=1</link><pubDate>Thu, 24 Mar 2022 09:55:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09abd363-555b-4a36-952b-1504e2046586</guid><dc:creator>Priyanka</dc:creator><description>&lt;p&gt;Hi Daniel,&lt;/p&gt;
&lt;p&gt;Kindly take a look at the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/mpsl/doc/api.html#c.MPSL_RADIO_NOTIFICATION_DISTANCES"&gt;MPSL RADIO NOTIFICATION DISTANCES&lt;/a&gt;. Hope this helps. &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;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Priyanka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: There are a way to clean queued data on tx buffer?</title><link>https://devzone.nordicsemi.com/thread/359667?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 18:06:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29f6d0b2-a857-4ce1-9ef0-4a22844511a0</guid><dc:creator>sotillo2409</dc:creator><description>&lt;p&gt;Hi another time, I was trying to find a function to clean (&amp;amp;att-&amp;gt;tx_queue), due to&amp;nbsp; this buffer is filled when bt_nus_send() -&amp;gt; gatt_notify() -&amp;gt; bt_att_send()&lt;/p&gt;
&lt;p&gt;On the last function is filled the buffer with the function&lt;/p&gt;
&lt;p&gt;net_buf_put(&amp;amp;att-&amp;gt;tx_queue, buf);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So makes sense that att_reset() clean all the att-&amp;gt;tx_queue&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void att_reset(struct bt_att *att)
{
	struct bt_att_req *req, *tmp;
	struct net_buf *buf;

#if CONFIG_BT_ATT_PREPARE_COUNT &amp;gt; 0
	/* Discard queued buffers */
	while ((buf = net_buf_get(&amp;amp;att-&amp;gt;prep_queue, K_NO_WAIT))) {
		net_buf_unref(buf);
	}
#endif /* CONFIG_BT_ATT_PREPARE_COUNT &amp;gt; 0 */

	while ((buf = net_buf_get(&amp;amp;att-&amp;gt;tx_queue, K_NO_WAIT))) {
		net_buf_unref(buf);
	}

	att-&amp;gt;conn = NULL;

	/* Notify pending requests */
	SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&amp;amp;att-&amp;gt;reqs, req, tmp, node) {
		if (req-&amp;gt;func) {
			req-&amp;gt;func(NULL, BT_ATT_ERR_UNLIKELY, NULL, 0,
				  req-&amp;gt;user_data);
		}

		bt_att_req_free(req);
	}

	k_mem_slab_free(&amp;amp;att_slab, (void **)&amp;amp;att);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Unfortunatelly isn&amp;#39;t work, data queued keeps beeing sended.&lt;/p&gt;
[quote userid="107158" url="~/f/nordic-q-a/86099/there-are-a-way-to-clean-queued-data-on-tx-buffer"]My question is if there are some way for clean/discard all the data that a peer have buffered on nus tx characteristic through &lt;strong&gt;bt_nus_send().&lt;/strong&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Any suggestion is welcome, i think that what i am asking mustn&amp;#39;t be an impossibble thing, no?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>