<?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>BLE Throughput</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84813/ble-throughput</link><description>Hi All, 
 As far as I know , BLE Thrughput is basically set around a few parameters =&amp;gt; 1. NRF_SDH_BLE_GAP_DATA_LENGTH 
 2. NRF_SDH_BLE_GATT_MAX_MTU_SIZE 
 3. NRF_SDH_BLE_GAP_EVENT_LENGTH 
 My question is =&amp;gt; Does the value of NRF_SDH_BLE_GAP_EVENT_LENGTH</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Mar 2022 07:27:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84813/ble-throughput" /><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/358532?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 07:27:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e610ed0-37fa-440b-b482-3db35dbc193e</guid><dc:creator>Einar Thorsrud</dc:creator><description>[quote user="kai19960504"]So the setting value of Event length is best equal to connection interval?[/quote]
&lt;p&gt;If the goal is maximal throughput with a single connection, then yes.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/358510?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 00:31:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:702159a6-e901-4c6c-84aa-3e71cad0ae92</guid><dc:creator>kai19960504</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/84813/ble-throughput/358221#358221"]like ensure the event length is equal the connection interval[/quote]
&lt;p&gt;I currently make the event length equal to the connection interval according to your method. After testing several times, the problem of packet loss does not occur.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So the setting value of Event length is best equal to connection interval?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/358221?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2022 13:16:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d78d1dad-6528-487a-9829-977cc5bacf51</guid><dc:creator>Einar Thorsrud</dc:creator><description>[quote user="kai19960504"]If it does not return successfully, it means the buffer is full.[/quote]
&lt;p&gt;Yes, if&amp;nbsp;sd_ble_gatts_hvx() returns&amp;nbsp;NRF_ERROR_RESOURCES it means the buffer is full. It can also return other error codes though, so you should not assume that all errors indicate that the queue is full.&lt;/p&gt;
[quote user="kai19960504"]I have also increased the length of NRF_SDH_BLE_GAP_EVENT_LENGTH but it still drops packets.[/quote]
&lt;p&gt;OK. There are things you can do (like ensure the event length is equal the connection interval, and that it is of sensible length). But there will be a limit to the throughput. And if you try to send more then the link can handle, you will get&amp;nbsp;NRF_ERROR_RESOURCES returned from&amp;nbsp;sd_ble_gatts_hvx(). That is expected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/358086?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2022 00:55:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:770853fe-e700-43a2-9f27-2928c8aa6efc</guid><dc:creator>kai19960504</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static ret_code_t error_messages_send(ble_gatts_hvx_params_t * const p_hvx_params,  uint16_t conn_handle)
{
    ret_code_t err_code = sd_ble_gatts_hvx(conn_handle, p_hvx_params);
    if (err_code == NRF_SUCCESS)
    {
        //NRF_LOG_INFO(&amp;quot;Error notification has been sent using conn_handle: 0x%04X&amp;quot;, conn_handle);
         NRF_LOG_INFO(&amp;quot;OK   : %x&amp;quot;,AppData_CNT++);
    }
    else
    {
        //NRF_LOG_DEBUG(&amp;quot;Error: 0x%08X while sending notification with conn_handle: 0x%04X&amp;quot;,
        //              err_code,
        //              conn_handle);
        NRF_LOG_INFO(&amp;quot;Fail : %x&amp;quot;,AppData_CNT++);
    }
    return err_code;
    
}&lt;/pre&gt;I checked some stuff about sd_ble_gatts_hvx().&lt;/p&gt;
&lt;p&gt;If it does not return successfully, it means the buffer is full.&lt;/p&gt;
&lt;p&gt;I have also increased the length of NRF_SDH_BLE_GAP_EVENT_LENGTH but it still drops packets.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/355964?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2022 09:18:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:333fabb8-f226-4aa2-8303-a2cc245152f9</guid><dc:creator>kai19960504</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;I roughly understand what you mean, but I don&amp;#39;t have a clue how to draw a conclusion at the moment, so I won&amp;#39;t close this discussion at this time&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/355798?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2022 11:54:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01ebb343-a955-4d01-89f0-801b836c43f3</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;With a sniffer you can see how many packets are exchanged per connection event. That does not necessarily tell you what the &lt;em&gt;maximum&lt;/em&gt;&amp;nbsp;for a specific device is, as this is not a parameter in BLE as such, and that is exchanged on air. There could be other reasons for the number of packets not being as high as you expected (for instance, that you do not have enough data to send fast enough, of that one of the devices also needs to do other things like have time for other Bluetooth connections or WiFi, etc.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/355698?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2022 06:33:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26f1577a-ea15-4c51-be15-85d6c273d8ec</guid><dc:creator>kai19960504</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;So through Sniffer, I can confirm the maximum Packet that a Connection Interval can transmit, right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/355525?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 11:52:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6942192-6f44-46a6-ac1a-2220643ab3d8</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;You were&amp;nbsp;asking how to interpret the picture which shows that different phone models support a different set of packets per connection event. This does shows exactly that, but nothing else. This is implementation specific limitations in those devices, and not a general limitation. There is no defined maximum number of packets per connection event in the Bluetooth specification, nor in Nordic&amp;#39;s BLE stacks.&lt;/p&gt;
&lt;p&gt;In a nutshell: The picture tells you what those phones are capable of with regards to packets per connection, and nothing more.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/355401?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2022 00:42:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9a3b359-59af-49c1-8f94-2078804fec49</guid><dc:creator>kai19960504</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/84813/ble-throughput/354979#354979"]This is entirely implementation specific though, and there is no such limitation in the Bluetooth specification. And for nRF devices there is no limit.[/quote]
&lt;p&gt;I&amp;#39;m not very sure what you mean?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/354979?ContentTypeID=1</link><pubDate>Fri, 25 Feb 2022 10:06:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:137659e7-f850-4aab-8e40-0d79a46db00e</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Different devices may have different limitations. this shows that some different phone models have a limit of packets per connection event. This is entirely implementation specific though, and there is no such limitation in the Bluetooth specification. And for nRF devices there is no limit.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/354903?ContentTypeID=1</link><pubDate>Fri, 25 Feb 2022 00:21:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8943421-2759-4d27-8584-90328b67c28e</guid><dc:creator>kai19960504</dc:creator><description>&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1645748421651v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;So,how to interpret this picture?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/354730?ContentTypeID=1</link><pubDate>Thu, 24 Feb 2022 08:19:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d186813d-45da-4f19-bdf8-049d39469baa</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;There is no hard limit of 6 packets per connection event. If there is more data to send, there is time left in the event, and there are no retransmissions, you can send even more packets than that per event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/354699?ContentTypeID=1</link><pubDate>Thu, 24 Feb 2022 00:26:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b795f40-8e61-4618-a3e1-8cda53519b18</guid><dc:creator>kai19960504</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;I have checked a lot of information, and it shows that many packets can be sent, but I can only receive up to 6 packets per connection interval. Is this correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/353509?ContentTypeID=1</link><pubDate>Thu, 17 Feb 2022 07:15:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3156ccb6-da34-4800-ab31-e1b895f4a247</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Kai,&lt;/p&gt;
&lt;p&gt;That was my bad. I did not realize that you only included parts of the table. I see now that this is the upper few rows of Table 1 under &lt;a href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/ble_data_throughput/ble_data_throughput.html"&gt;Bluetooth Low Energy data throughput&lt;/a&gt;&amp;nbsp;in the latest SoftDevice Specification.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/353483?ContentTypeID=1</link><pubDate>Thu, 17 Feb 2022 00:21:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31ae0e88-8594-4dba-b018-2b21cb6a0290</guid><dc:creator>kai19960504</dc:creator><description>[quote userid="7377" url="~/f/nordic-q-a/84813/ble-throughput/353453#353453"]infocenter.nordicsemi.com/.../quote]
&lt;p&gt;The content of v7.3.0 is like the picture when I asked the question, I don&amp;#39;t understand what you said &amp;quot;Note that the documentation you refer to is for an old SoftDevice.&amp;quot;&lt;/p&gt;[/quote]&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/353453?ContentTypeID=1</link><pubDate>Wed, 16 Feb 2022 18:03:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41a576d3-6e32-4697-a215-709f3014b422</guid><dc:creator>Einar Thorsrud</dc:creator><description>[quote user="kai19960504"]&lt;p&gt;Could you please provide the latest S132 SPEC?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/struct_nrf52/struct/s132.html"&gt;https://infocenter.nordicsemi.com/topic/struct_nrf52/struct/s132.html&lt;/a&gt;&lt;/p&gt;
[quote user="kai19960504"]Else question is 1 packet have 20byte,how long will that packet take?[/quote]
&lt;p&gt;Which exact time are you after here?&amp;nbsp;If this is 20 &lt;em&gt;payload&lt;/em&gt; bytes, you would see about 272 us on air. The SIG has a page which may be interesting for you: &lt;a href="https://www.bluetooth.com/blog/exploring-bluetooth-5-how-fast-can-it-be/"&gt;How Fast Can It Be?&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/353384?ContentTypeID=1</link><pubDate>Wed, 16 Feb 2022 13:45:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a55d71dc-efdb-494f-9182-a00cfc4ffee3</guid><dc:creator>kai19960504</dc:creator><description>&lt;p&gt;Could you please provide the latest S132 SPEC?&lt;/p&gt;
&lt;p&gt;Else question is 1 packet have 20byte,how long will that packet take?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/353382?ContentTypeID=1</link><pubDate>Wed, 16 Feb 2022 13:41:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1127202a-6534-461c-9fcb-42a648ca194f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;It means that you have 6 ms that you can spend to transfer packets, but there is no need to spend the entire 6 ms (though that is not a very long time). You can also send several short packets or a single long. Here you don&amp;#39;t use data length extension, so you can send several short packets. This is handled by the Bluetooth stack though, so you cannot do anything other than to try to send as much data a possible so that the stack always has more data to send.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/353373?ContentTypeID=1</link><pubDate>Wed, 16 Feb 2022 13:32:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5eea8ec-6fc6-4fd9-bfa2-5226f4d9b704</guid><dc:creator>kai19960504</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Here is my sdk_config.h setting&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1645018166298v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1645018207347v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/417x60/__key/communityserver-discussions-components-files/4/pastedimage1645018212701v3.png" /&gt;&lt;/p&gt;
&lt;p&gt;Now&amp;nbsp;&lt;span&gt;NRF_SDH_BLE_GAP_EVENT_LENGTH&amp;nbsp;&amp;nbsp;is 6,so my packet will transfer total 6ms?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/353363?ContentTypeID=1</link><pubDate>Wed, 16 Feb 2022 13:22:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb3e0126-6986-481e-927e-08286e1db22f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The event length is a Bluetooth concept. A connection event occurs every connection interval, and the duration of it is defined by the event length. During the event length, packets can be exchanged. If the event length is as long as the connection interval, packets can be exchanged more or less continuously. This maximises throughput.&lt;/p&gt;
[quote user=""]If the event length equal 7.5ms,does it mean that it can transmit 6 packets?[/quote]
&lt;p&gt;Yes and no. If you cant fit 6 packets, then yes. If you can fit more, then you can send more. There is no defined maximum. Note that the documentation you refer to is for an old SoftDevice. More recent SoftDevice versions does not have this bandwidth configuration, but instead just allows you to configure the event length, using&amp;nbsp;NRF_SDH_BLE_GAP_EVENT_LENGTH&amp;nbsp; as you have found.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>