<?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>How to determine packets per connection supported by connecting device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/68002/how-to-determine-packets-per-connection-supported-by-connecting-device</link><description>In my peripheral FW I set the Data Length to 251 and MTU to 247. I also set the Tx Max time to 16 (16 * 1.25msec), However I always see the during the connection handshaking that the max caps out at 2120usec. I&amp;#39;m not sure how I can determine the maximum</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 06 Nov 2020 07:58:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/68002/how-to-determine-packets-per-connection-supported-by-connecting-device" /><item><title>RE: How to determine packets per connection supported by connecting device</title><link>https://devzone.nordicsemi.com/thread/278723?ContentTypeID=1</link><pubDate>Fri, 06 Nov 2020 07:58:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2fddcf0-9a44-4a4e-8d25-5a24cf275d69</guid><dc:creator>Edvin</dc:creator><description>[quote user="Dave_couling"]So if I am sending chunks of 247bytes payloads which is the maximum MTU size, how can I determine how many packets can actually be sent per connection event?&amp;nbsp; In other words how many MTU-size packets?&amp;nbsp;&amp;nbsp;[/quote]
&lt;p&gt;&amp;nbsp;You typically don&amp;#39;t know, but you can keep queuing packets using sd_ble_gatts_hvx() until it returns NRF_ERROR_RESOURCES. Then the softdevice will send as many of the packets as possible. The amount depends on the connection parameters, and the amount of dropped packets in the connection event.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Dave_couling"]This blog suggests that different phones support different packet amounts:[/quote]
&lt;p&gt;That is correct. In BLE there are a lot of parameters (and I believe they are all mentioned in the novelbits blog post). The way that it works is that a BLE connection is started with very basic parameters, and then all the parameters are negotiated, and the limiting device decides (say one device requests MTU 247 and one says I can only do MTU 180, then 180 will be used).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can experiment with what the different parameters does with the throughput using 2 DKs and the examples\ble_central_and_peripheral\experimental\&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_att_mtu.html"&gt;ble_app_att_mtu_throughput example&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The ble_app_uart example will request maximum throughput parameters, so if you tweak the application to send as many packets as possible, and count the number of packets and length of packets that are successfully sent, you will see the throughput for that phone.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to determine packets per connection supported by connecting device</title><link>https://devzone.nordicsemi.com/thread/278676?ContentTypeID=1</link><pubDate>Thu, 05 Nov 2020 18:43:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7cb6654a-3748-48cb-bce5-2460cbbd5217</guid><dc:creator>Dave_couling</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Not sure I understand what you&amp;#39;re getting at.&amp;nbsp; So if I am sending chunks of 247bytes payloads which is the maximum MTU size, how can I determine how many packets can actually be sent per connection event?&amp;nbsp; In other words how many MTU-size packets?&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This blog suggests that different phones support different packet amounts:&amp;nbsp;&lt;a href="https://www.novelbits.io/bluetooth-5-speed-maximum-throughput/"&gt;https://www.novelbits.io/bluetooth-5-speed-maximum-throughput/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What I&amp;#39;m trying to determine in FW is how many packets are supported by a connected phone, so I can determine the maximum through at live run-time.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;DC&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to determine packets per connection supported by connecting device</title><link>https://devzone.nordicsemi.com/thread/278615?ContentTypeID=1</link><pubDate>Thu, 05 Nov 2020 14:00:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aca7420b-868b-424f-b64e-78a6a4d44b1e</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I see that it always says 2120µs, but if you change the&amp;nbsp;NRF_SDH_BLE_GAP_EVENT_LENGTH, it will use the according time of the event. You will see that the throughput is increased when increasing this, and decreased when you lower this value. I think the max time is for each packet, but the devices can send several packets within the&amp;nbsp;NRF_SDH_BLE_GAP_EVENT_LENGTH in each connection event.&lt;/p&gt;
&lt;p&gt;This means that if you set the max TX time to 16 = 20ms, it will only be able to use the radio for 20ms within each connection interval.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>