<?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>Nr of Packets available</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/31312/nr-of-packets-available</link><description>I am modifying the BLE UART example, client and server, in order to have a higher throughput. I have selected that the connection interval is 7.5ms with a total number of 50 bytes to be transmitted. 
 On the BLE-NUS example, when I try to modify NRF_BLE_GATT_MAX_MTU_SIZE</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 13 Mar 2018 09:17:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/31312/nr-of-packets-available" /><item><title>RE: Nr of Packets available</title><link>https://devzone.nordicsemi.com/thread/124099?ContentTypeID=1</link><pubDate>Tue, 13 Mar 2018 09:17:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:020b129f-da52-44ce-aa1f-53f799550519</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/24840/using-dle-and-nrf_ble_gatt_max_mtu_size-23" target="_blank" rel="noopener noreferrer"&gt;This link&lt;/a&gt; could be helpful to configure a&amp;nbsp;greater&amp;nbsp;NRF_BLE_GATT_MAX_MTU_SIZE than the default value of 23 bytes.&amp;nbsp;I am assuming you are using SDK 14.2&lt;/p&gt;
&lt;p&gt;Take a look at the&amp;nbsp;ble_nus_string_send() function in ble_nus.c. You notice that there is an if statement which compares the string length (i.e. *p_length) to the&amp;nbsp;BLE_NUS_MAX_DATA_LEN, which is defined as 20 bytes if you use the default&amp;nbsp;NRF_BLE_GATT_MAX_MTU_SIZE. uart_event_handle() is the event handling function defined in main.c that calls&amp;nbsp;ble_nus_string_send() in the peripheral UART example &amp;amp; it is the event handling function that makes sure that the string will not be longer than the&amp;nbsp;NRF_BLE_GATT_MAX_MTU_SIZE.&lt;/p&gt;
&lt;p&gt;Difficult to say how many packets are available if you set the&amp;nbsp;NRF_BLE_GATT_MAX_MTU_SIZE to 158. It is definitely less than the max of 6 packets per connection interval using a connection interval of 7.5 ms in the softdevice S132 v5.1 (see &lt;a href="http://infocenter.nordicsemi.com/pdf/S132_SDS_v5.1.pdf" target="_blank" rel="noopener noreferrer"&gt;Table 27 &lt;/a&gt;in the softdevice specs). You should theoretically get a greater throughput if you increase the NRF_BLE_GATT_MAX_MTU_SIZE because you will have more space to send useful data because you do not lose as much space to the header bytes in&amp;nbsp;NRF_BLE_GATT_MAX_MTU_SIZE. Beware that if you have a lot of packet loss due to&amp;nbsp;packet collisions from other Bluetooth devices, your throughput&amp;nbsp;might be greater by decreasing the&amp;nbsp;NRF_BLE_GATT_MAX_MTU_SIZE. You will have to test this to see how many packets you can send per connection interval.&lt;/p&gt;
&lt;p&gt;I already answered above how many packets you can theoretically send if you set&amp;nbsp;NRF_BLE_GATT_MAX_MTU_SIZE to 23 in the paragraph above. Again, test this to see how many packets you can send. Yes, this is settled by the S132 softdevice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Last but not least, take a look at the &lt;a href="https://devzone.nordicsemi.com/b/blog/posts/throughput-and-long-range-demo" target="_blank" rel="noopener noreferrer"&gt;throughput demo&lt;/a&gt;, which gives a good explanation of how to achieve high throughput. Hope that helps!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>