<?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>Problem when I send more than 8 packets</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12093/problem-when-i-send-more-than-8-packets</link><description>Hello, 
 I&amp;#39;m a few novice in BLE, and I&amp;#39;ve got a problem. 
 I&amp;#39;m using a custom project based in UART example. I&amp;#39;m using Nexus 5 and nRF ToolsBox for text it. I&amp;#39;m saving the data in the memory. I can send packets of 20 bytes, but when I need send more</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 20 May 2016 20:26:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12093/problem-when-i-send-more-than-8-packets" /><item><title>RE: Problem when I send more than 8 packets</title><link>https://devzone.nordicsemi.com/thread/45770?ContentTypeID=1</link><pubDate>Fri, 20 May 2016 20:26:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fee2be2d-f6db-404a-9adf-40ac4c1f2918</guid><dc:creator>Christopher</dc:creator><description>&lt;p&gt;Have a look at this sequence diagram which present a way to manage BLE TX packets: &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s130.api.v2.0.0%2Fgroup___b_l_e___c_o_m_m_o_n___a_p_p___b_u_f_f___m_s_c.html"&gt;infocenter.nordicsemi.com/index.jsp&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem when I send more than 8 packets</title><link>https://devzone.nordicsemi.com/thread/45769?ContentTypeID=1</link><pubDate>Thu, 25 Feb 2016 09:44:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4f5a7ad-bf1f-4a1b-b068-e8fa9dc573a9</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You are very welcome :) on_ble_evt() is run at priority app_priority_low, so if waiting for something to happen in this event handler from another event handler you will wait forever.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem when I send more than 8 packets</title><link>https://devzone.nordicsemi.com/thread/45768?ContentTypeID=1</link><pubDate>Wed, 24 Feb 2016 22:40:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:446141c0-0aae-4c6a-a12f-04d9f93a027f</guid><dc:creator>cbp</dc:creator><description>&lt;p&gt;You have said &amp;quot;You should also not do this in an event handler, but in main.&amp;quot;&lt;/p&gt;
&lt;p&gt;Well, that was the problem. It&amp;#39;s solved!! Thank you very much Ole!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem when I send more than 8 packets</title><link>https://devzone.nordicsemi.com/thread/45767?ContentTypeID=1</link><pubDate>Wed, 24 Feb 2016 16:39:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54647eca-56df-4624-9b33-7349a16e5fdd</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You forgot semicolon after &lt;code&gt;while(tx_complete==false)&lt;/code&gt; so it will be equal to&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;while(tx_complete==false)
{
    tx_complete=false;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You should also not do this in an event handler, but in main.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem when I send more than 8 packets</title><link>https://devzone.nordicsemi.com/thread/45766?ContentTypeID=1</link><pubDate>Wed, 24 Feb 2016 14:48:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a018c50-1e1d-456e-9854-34e65ad5d8ed</guid><dc:creator>cbp</dc:creator><description>&lt;p&gt;I have put in my code this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = ble_mag_string_send(&amp;amp;m_mag, datos_ble, i);
if( err_code == BLE_ERROR_NO_TX_BUFFERS){
	while(tx_complete==false)
	tx_complete=false;
	err_code = ble_mag_string_send(&amp;amp;m_mag, datos_ble, i);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and this in on_ble_event():&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;case BLE_EVT_TX_COMPLETE:
					tx_complete=true;
					break;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But again, when the Nexus 5 have received 8 packets of 20 bytes, the communication is over :S&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem when I send more than 8 packets</title><link>https://devzone.nordicsemi.com/thread/45765?ContentTypeID=1</link><pubDate>Wed, 24 Feb 2016 14:37:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:646e8d91-809d-4191-beec-cb549a5f6fd0</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;Changed the answer. sd_ble_tx_packet_count_get(..) will only get the size of the buffer for that connection (7 packets).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem when I send more than 8 packets</title><link>https://devzone.nordicsemi.com/thread/45764?ContentTypeID=1</link><pubDate>Tue, 23 Feb 2016 17:59:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdabea42-2ac5-4646-addf-afb6a33e4d5a</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You can only send 6 packets per connection interval with the SoftDevice (it may also be less on the phone/central side). It will have buffers for 7 full packets and if you try to send more you will get error 0x3004, BLE_ERROR_NO_TX_PACKETS (formerly known as BLE_ERROR_NO_TX_BUFFERS). When you get this error you should wait to send until you get BLE_EVT_TX_COMPLETE event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>