<?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: L2CAP Fragmentation and reassembly</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65105/ble-l2cap-fragmentation-and-reassembly</link><description>nRF52840, SDK v16.0.0 SD140v7.0.1 
 Our electrical engineers gave us a hard ATT_MTU limit of 65 bytes, so as to keep the peak current low on the battery for our ultra-low-power IoT device. We can not TX/RX more than 65-byte ATT_MTU per connection interval</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 28 Aug 2020 09:39:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65105/ble-l2cap-fragmentation-and-reassembly" /><item><title>RE: BLE: L2CAP Fragmentation and reassembly</title><link>https://devzone.nordicsemi.com/thread/266936?ContentTypeID=1</link><pubDate>Fri, 28 Aug 2020 09:39:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:685df713-a405-4f85-a7c5-f5e23dedad20</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Happy to help Charles. The best of luck with your project &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;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE: L2CAP Fragmentation and reassembly</title><link>https://devzone.nordicsemi.com/thread/266810?ContentTypeID=1</link><pubDate>Thu, 27 Aug 2020 16:05:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f6da9a9-7187-4cff-8438-3ed58f0d1440</guid><dc:creator>charles</dc:creator><description>&lt;p&gt;Thanks to both of you for the detailed and thoughtful responses. This is extremely helpful and we sincerely appreciate it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE: L2CAP Fragmentation and reassembly</title><link>https://devzone.nordicsemi.com/thread/266559?ContentTypeID=1</link><pubDate>Wed, 26 Aug 2020 14:57:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:844ec0c0-6e2f-4d6c-a76a-11033bef07a2</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;Hi Charles,&lt;/p&gt;
&lt;p&gt;Let me share my thoughts concerning your case. If 65-byte limitation is quite hard, I&amp;#39;m afraid you should take it into account at application level. As Torbj&amp;oslash;rn pointed out, miminum event length is 2.5 ms that is quite long, and you have no control over a number of packets sent during a single event, other than restrain SoftDevice&amp;#39;s tx queue no more than 65 bytes long. Using large MTU with short data length, you&amp;#39;ll probably see two or more fragments sent one-by-one every connection event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE: L2CAP Fragmentation and reassembly</title><link>https://devzone.nordicsemi.com/thread/266417?ContentTypeID=1</link><pubDate>Wed, 26 Aug 2020 09:29:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5424bc3-a453-497e-bc15-0b15bd43ccd7</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Charles&lt;/p&gt;
&lt;p&gt;The maximum ATT_MTU you can use is normally 512 bytes, while the maximum data length is 251 (leaving 244 bytes for data once you subtract the 3 byte ATT header and the 4 byte L2CAP header).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If your data fits logically in ~160 bytes then I would scale the MTU after this, plus 3 bytes for the ATT header.&amp;nbsp;Using a larger ATT_MTU might provide slightly more efficient communication, depending on how the link layer can split the attribute into multiple 65 byte on air packets, but I don&amp;#39;t think the difference would be very significant.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;span&gt;NRF_SDH_BLE_GAP_EVENT_LENGTH can be quite useful, yes, but I don&amp;#39;t think it is directly related to any parameters in the Bluetooth specification. The transmit window is related to the first packet in a BLE connection, and is not relevant for subsequent packets in a connection.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The number of packets you can send in one connection event is not defined by the Bluetooth specification, other than that it needs to be at least one (obviously), and that you can extend it for as long as both the master and the slave allow by setting the &amp;#39;more data&amp;#39; bit in the packet header.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The&amp;nbsp;NRF_SDH_BLE_GAP_EVENT_LENGTH uses a unit of 1.25ms, and the minimum value is 2,&amp;nbsp;meaning the minimum time you can set is 2.5ms.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user="nicholsonc"]I wonder if I misspoke and instead of seeing 23-byte ATT_MTU we&amp;#39;re actually seeing 23-byte data length? I&amp;#39;ll investigate more; if was a report from a partner of ours.[/quote]
&lt;p&gt;Typically the minimum data length should be 27 bytes, because this includes the 4 byte L2CAP header on top of the 23 byte minimum attribute MTU.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Did they mention which phone(s) they were talking about?&lt;/p&gt;
[quote user="nicholsonc"]Do you know of any resources that catalogue the capabilities of modern Android + iOS handsets? We&amp;#39;re using a third-party testing company for handset compatibility and they&amp;#39;re doing a great job, but we&amp;#39;ve also wished for a database somewhere that describes BLE version, max ATT_MTU / Data Length / Connection Interval ranges / Slave Latency / .....[/quote]
&lt;p&gt;I don&amp;#39;t know of any such tool unfortunately.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;At various times we have thought of doing something like that ourselves, create an app that people can run on their own handsets that would report the capabilities back to the cloud.&amp;nbsp;Then it wouldn&amp;#39;t be necessary for any one company or group to acquire every single phone, but it could be a collaborative project between users of the app (assuming they have a Nordic DK available to act as the peripheral device).&amp;nbsp;&lt;br /&gt;We might do something like this in the future, but for the time being we don&amp;#39;t have any concrete plans for it unfortunately.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE: L2CAP Fragmentation and reassembly</title><link>https://devzone.nordicsemi.com/thread/266033?ContentTypeID=1</link><pubDate>Mon, 24 Aug 2020 14:38:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e5b8932-186e-410e-9f40-f0c870ed68db</guid><dc:creator>charles</dc:creator><description>&lt;p&gt;Thanks for the thorough and fast response,&amp;nbsp;&lt;span&gt;Torbj&amp;oslash;rn&lt;/span&gt;!&lt;/p&gt;
&lt;p&gt;So it sounds like a good strategy is to go for as large of an ATT_MTU as we can get (250?), and then as long as the Data Length is &amp;lt;= 65 we&amp;#39;ll get the fragmentation + reassembly for free and keep our EEs happy. They were very excited to learn about the NRF_SDH_BLE_GAP_EVENT_LENGTH field as well, presumably that controls the &amp;quot;transmit window&amp;quot; value?&lt;/p&gt;
&lt;p&gt;I wonder if I misspoke and instead of seeing 23-byte ATT_MTU we&amp;#39;re actually seeing 23-byte data length? I&amp;#39;ll investigate more; if was a report from a partner of ours.&lt;/p&gt;
&lt;p&gt;Do you know of any resources that catalogue the capabilities of modern Android + iOS handsets? We&amp;#39;re using a third-party testing company for handset compatibility and they&amp;#39;re doing a great job, but we&amp;#39;ve also wished for a database somewhere that describes BLE version, max ATT_MTU / Data Length / Connection Interval ranges / Slave Latency / .....&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Charles&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE: L2CAP Fragmentation and reassembly</title><link>https://devzone.nordicsemi.com/thread/266017?ContentTypeID=1</link><pubDate>Mon, 24 Aug 2020 14:10:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31e24ecc-7968-47e7-9651-4dc250502487</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Charles&lt;/p&gt;
&lt;p&gt;In this case it sounds like your best bet is to use LE Data Length Extension, but ensure that you don&amp;#39;t set the data length larger than 65.&lt;/p&gt;
&lt;p&gt;Then you can safely set the ATT_MTU to 160 bytes or more, and the link layer will have to fragment a single 160 byte update into multiple on-air packets according to the data length.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You might want to set the&amp;nbsp;NRF_SDH_BLE_GAP_EVENT_LENGTH to a low number also, otherwise the SoftDevice will be able to send multiple packets back to back in a single connection event, which could break your peak current constraints set by the electrical engineers.&lt;/p&gt;
&lt;p&gt;If you have central devices that don&amp;#39;t support more than 23-byte ATT MTU I must assume these are quite old devices, as longer ATT MTU has been a feature in the specification for a long time?&lt;br /&gt;In this case you don&amp;#39;t really have any choice other than to split the packet into multiple fragments manually, and send 20 bytes at a time.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE: L2CAP Fragmentation and reassembly</title><link>https://devzone.nordicsemi.com/thread/265857?ContentTypeID=1</link><pubDate>Sun, 23 Aug 2020 18:27:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:442fc6df-df00-4558-927e-2c26d8ac4aa9</guid><dc:creator>charles</dc:creator><description>&lt;p&gt;Sorry, to be clear, by&lt;/p&gt;
[quote userid="25714" url="~/f/nordic-q-a/65105/ble-l2cap-fragmentation-and-reassembly"]We have a scenario where the most optimal solution would be to have the BLE LL / L2CAP fragment and reassemble data for us, so that we can write ~160 bytes over N connection intervals, but not require application-level awareness of this fragmentation and reassembly. Ideally this ~160 byte payload would appear all at once to the GATT Client running on the Central device.[/quote]
&lt;p&gt;I mean, &amp;quot;so that we can write ~160 bytes over N connection intervals with the ATT_MTU &amp;lt;= 65 bytes&amp;quot;. If the Central only supports a 23-byte ATT_MTU, then this would take 160 / 20 = 8 connection intervals.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>