<?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>Directly modify Link Layer packet</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/59365/directly-modify-link-layer-packet</link><description>Hello, 
 I am very new to BLE and NRF and trying to understand what the best way would be to send data from one device to another 
 
 From the documentation and messing around with ble_app_blinky on my nrf52833 DK as I understand it there is a Link Layer</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 29 Mar 2020 23:41:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/59365/directly-modify-link-layer-packet" /><item><title>RE: Directly modify Link Layer packet</title><link>https://devzone.nordicsemi.com/thread/242263?ContentTypeID=1</link><pubDate>Sun, 29 Mar 2020 23:41:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12846411-c155-4637-925a-74b800b2d74d</guid><dc:creator>LucosidE</dc:creator><description>&lt;p&gt;Never mind, it works as expected, I realized in my switch statement I used NRF_LOG_DEBUG but my LOG_LEVEL was 3.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Directly modify Link Layer packet</title><link>https://devzone.nordicsemi.com/thread/242262?ContentTypeID=1</link><pubDate>Sun, 29 Mar 2020 22:47:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85ed6557-f5fe-427a-8068-1cbdf0f3ba6d</guid><dc:creator>LucosidE</dc:creator><description>&lt;p&gt;Thank Kenneth,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am getting a little bit closer to the setup mentioned above. I think now I am having trouble understanding the SDK. I have a 52833DK trying to set up an L2CAP channel with 52840 Dongle which is running the peripheral blinky app. I am simply using the blinky app since I can try to set up an L2CAP channel after connection is established. I also have a 52840DK acting as a sniffer.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My code works as follows, the 52833 scans for device named &amp;quot;BLINKY&amp;quot; and connects to it. This part works.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When&amp;nbsp;BLE_GAP_EVT_CONNECTED is triggered on the 52833 I call&amp;nbsp;sd_ble_l2cap_ch_setup with same params as the OTS example. At this point I can see in wireshark that everything is as I expect.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;No.	Time	Source	PHY	Protocol	Length	Delta time (&amp;#181;s end to start)	SN	NESN	More Data	Event counter	Info
834	20.674	c4:03:29:65:50:fe	LE 1M	LE LL	21	498				0	ADV_IND
835	20.675	c4:03:29:65:50:fe	LE 1M	LE LL	21	1050				0	ADV_IND
836	21.677	c4:03:29:65:50:fe	LE 1M	LE LL	21	1000658				0	ADV_IND
837	21.678	f7:51:61:6c:70:ca	LE 1M	LE LL	34	151				0	CONNECT_REQ
838	21.679	Master_0xb2a7e1bf	LE 1M	L2CAP	18	1253	0	0	False	0	LE Credit Based Connection Request (CID: 0040, Initial Credits: 0)
839	21.679	Slave_0xb2a7e1bf	LE 1M	LE LL	0	150	0	1	False	0	Empty PDU
840	21.707	Master_0xb2a7e1bf	LE 1M	LE LL	0	29545	1	1	False	1	Empty PDU
841	21.708	Slave_0xb2a7e1bf	LE 1M	L2CAP	18	151	1	0	False	1	LE Credit Based Connection Response (CID: 0000, Initial Credits: 0)
842	21.737	Master_0xb2a7e1bf	LE 1M	LE LL	0	29546	0	0	False	2	Empty PDU
843	21.738	Slave_0xb2a7e1bf	LE 1M	LE LL	0	150	0	1	False	2	Empty PDU
844	21.767	Master_0xb2a7e1bf	LE 1M	LE LL	0	29692	1	1	False	3	Empty PDU
845	21.768	Slave_0xb2a7e1bf	LE 1M	LE LL	0	150	1	0	False	3	Empty PDU
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Since the 52840 Dongle is not set up for L2CAP it refuses the connection. In wireshark I can see&amp;nbsp;LE Result: Connection Refused - No Resources Available (0x0004)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Frame 841: 44 bytes on wire (352 bits), 44 bytes captured (352 bits) on interface wireshark_extcap2808, id 0
Nordic BLE Sniffer
Bluetooth Low Energy Link Layer
Bluetooth L2CAP Protocol
    Length: 14
    CID: Low Energy L2CAP Signaling Channel (0x0005)
    Command: LE Credit Based Connection Response
        Command Code: LE Credit Based Connection Response (0x15)
        Command Identifier: 0x03
        Command Length: 10
        Destination CID: Null identifier (0x0000)
        MTU: 0
        MPS: 0
        Initial Credits: 0
        LE Result: Connection Refused - No Resources Available (0x0004)
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I am currently registering a BLE observer as in all the examples I&amp;#39;ve seen.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    // Register a handler for BLE events.
    NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;However on the 52833DK the&amp;nbsp;p_ble_evt-&amp;gt;header.evt_id is never BLE_L2CAP_EVT_CH_SETUP_REFUSED or&amp;nbsp;BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED in ble_event_handler. From&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v16.0.0%2Findex.html"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v16.0.0%2Findex.html&lt;/a&gt;&amp;nbsp;Variant 2 I am expecting to see those events after 52840 Dongle refuses the L2CAP setup. Is there a special handler&amp;nbsp;needed to catch L2CAP events?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Directly modify Link Layer packet</title><link>https://devzone.nordicsemi.com/thread/241735?ContentTypeID=1</link><pubDate>Thu, 26 Mar 2020 08:23:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bbe9379-8624-45a7-b36a-e8e6697ebd95</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Your calculation is not taking into account pre- and post processing is part of the BLE event.&amp;nbsp;Also,&amp;nbsp;I don&amp;#39;t think you can rely on peer is always sending empty packets. The minimum 2.5ms is choisen because in BLE everything is in 1.25ms resolution (e.g. connection interval = n * 1.25ms), and when taking into account the pre- and post processing it just isn&amp;#39;t enough time to also include any radio activity if the BLE event is shorter than 2.5ms period. Realistically if you need to support long packets, I expect you will need to set BLE event to 3.75ms,&amp;nbsp;but that should still work with 12 device, since 3.75ms * 12 &amp;lt; 50ms.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Directly modify Link Layer packet</title><link>https://devzone.nordicsemi.com/thread/241651?ContentTypeID=1</link><pubDate>Wed, 25 Mar 2020 16:29:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b52e0029-f177-4580-bc4b-ed0fda7e2edd</guid><dc:creator>LucosidE</dc:creator><description>&lt;p&gt;Thank Kenneth, I was confusing data length with ATT MTU.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I will get a second 52840DK and go ahead try to test the throughput under different settings. As I am understanding so far to reduce overhead I can avoid GATT all together and establish an L2CAP channel for each device. Looking at the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v7.0.1%2Fgroup___b_l_e___l2_c_a_p___c_h___s_e_t_u_p___m_s_c.html"&gt;l2cap channel setup message sequence&lt;/a&gt;&amp;nbsp;once a connection is established I can initiate a channel from one device to another. Then the packets sent and their length in octets will be as follows:&lt;/p&gt;
&lt;p&gt;[Preamble 1][Access Address 4][Link Layer header 2][L2CAP header 4][DATA(Data Length - 4)][MIC 4][CRC 3]&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Where I can put anything into DATA i want using&amp;nbsp;sd_ble_l2cap_tx()&lt;/p&gt;
&lt;p&gt;Looking at BLE spec the raw radio is 1MBPS but there is a mandatory 150us delay between packets (Antenna cooling to avoid frequency shift?). Each packet is acknowledged with 80bits.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So for a 27 Data Length we have a total of 41bytes or &lt;span&gt;328bits&lt;/span&gt;. The timing will be as follows.&lt;/p&gt;
&lt;p&gt;Side A&amp;nbsp;sends&amp;nbsp;&lt;span&gt;328bits = 328us -&amp;gt; Wait 150us -&amp;gt; Side B Acknowledges 80bits (empty packet) = 80us -&amp;gt; Wait 150us. Total time to send 1 packet of 27 Data Length&amp;nbsp; =&amp;nbsp;(328+150+80+150)us or 0.708ms. Thus&amp;nbsp;with&amp;nbsp;event length of 7.5ms we can ideally send&amp;nbsp;10.59 packets. This is close to the 9LL packets you mention.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So if I set Data Length to maximum of&amp;nbsp;251bytes the packet would be&amp;nbsp;265bytes or&amp;nbsp;2120bits long. The timing would work as:&amp;nbsp;Side A&amp;nbsp;sends 2120bits&amp;nbsp;= 2120us -&amp;gt; Wait 150us -&amp;gt; Side B Acknowledges 80bits (empty packet) = 80us -&amp;gt; Wait 150us. Which means I can have an event length of (2120+150+80+150)us or 2.5ms. Is this why event length is multiples of 2.5ms?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;With this set up I would be sending 247 DATA bytes that I can fill up using&amp;nbsp;sd_ble_l2cap_tx()&amp;nbsp; in 2.5ms. So for say 12 devices I can set the event length to 2.5ms and connection interval to 50ms meaning each device will send 247 bytes of data 20 times a second leading to an ideal throughput of 4.9Kbytes. Switching to LE 2 PHY (as I understand it this is just&amp;nbsp;2 bits instead of 1 GFSK) I can get up to 9.6Kbytes.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Excited to try this, hopefully I can get my hands on another 52840DK&amp;nbsp;soon.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Directly modify Link Layer packet</title><link>https://devzone.nordicsemi.com/thread/241298?ContentTypeID=1</link><pubDate>Tue, 24 Mar 2020 08:59:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a608670b-bbca-4eb2-817e-010df3e83710</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The event length specify the maximum time width of the &amp;quot;timeslot&amp;quot;&amp;nbsp;the active link will allow to exchange data during an BLE event, the actual timing and number of packet that can fit into the &amp;quot;timeslot&amp;quot;&amp;nbsp;follow the BLE spec and also depend on the length of packets, type of transfer and direction of packets. In specific the LL payload size have a dramatic impact on the throughput, since a 155byte ATT MTU payload will be split into multiple LL packets over the air if using the default size of 27bytes, actually 6 LL packets will be required to send 155bytes, at the same time the 7.5ms event length allow for 9 LL packets, so will be able to send 1.5 ATT MTU in each window:&lt;/p&gt;
&lt;p&gt;155 / 0.0075 * 1.5 * 8 = 248 kbps.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Directly modify Link Layer packet</title><link>https://devzone.nordicsemi.com/thread/241200?ContentTypeID=1</link><pubDate>Mon, 23 Mar 2020 15:26:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95fa0fd8-289b-455d-a4d7-9a04695e7088</guid><dc:creator>LucosidE</dc:creator><description>&lt;p&gt;Hi Kenneth,&amp;nbsp;thanks a lot, I think I am getting closer to understanding the possible throughput for my case and BLE in general.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Looking at the throughput tables I think I can correctly calculate theoretical maximum for some of the table. Here is my thinking:&lt;/p&gt;
&lt;p&gt;Connection interval is&amp;nbsp;time between two data transfer events, event length is how long the data transfer event is.&amp;nbsp;Minimal event length is 2.5ms during which 2 Link Layer packets get transferred.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This lines up with the throughput numbers you provided for some rows of the table, for example with a connection interval of 7.5ms&lt;/p&gt;
&lt;table class="table long" id="ble_data_throughput__table_sz3_3wv_bs" border="1" cellpadding="4" cellspacing="0" frame="border" rules="all" summary=""&gt;
&lt;thead class="thead"&gt;
&lt;tr class="row"&gt;
&lt;th class="entry cellrowborder" id="d3780e106" colspan="1" rowspan="1"&gt;Protocol&lt;/th&gt;
&lt;th class="entry cellrowborder" id="d3780e109" colspan="1" rowspan="1"&gt;ATT MTU size&lt;/th&gt;
&lt;th class="entry cellrowborder" id="d3780e112" colspan="1" rowspan="1"&gt;Event length&lt;/th&gt;
&lt;th class="entry cellrowborder" id="d3780e115" colspan="1" rowspan="1"&gt;Method&lt;/th&gt;
&lt;th class="entry cellrowborder" id="d3780e118" colspan="1" rowspan="1"&gt;Maximum data throughput (LE 1M PHY)&lt;/th&gt;
&lt;th class="entry cellrowborder" id="d3780e122" colspan="1" rowspan="1"&gt;Maximum data throughput (LE 2M PHY)&lt;/th&gt;
&lt;/tr&gt;
&lt;tr class="row"&gt;
&lt;th class="entry cellrowborder"&gt;GATT SERVER&lt;/th&gt;
&lt;th class="entry cellrowborder"&gt;23&lt;/th&gt;
&lt;th class="entry cellrowborder"&gt;2.5ms&lt;/th&gt;
&lt;th class="entry cellrowborder"&gt;&lt;span&gt;Send Notification&lt;/span&gt;&lt;/th&gt;
&lt;th class="entry cellrowborder"&gt;&lt;span&gt;42.6kbps&lt;/span&gt;&lt;/th&gt;
&lt;th class="entry cellrowborder"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;/table&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To calculate the 42.6kbps we have 1000/7.5 =133.333 connections per second. Each connection has one event of 2.5ms. During each event 2 Link Layer packets are transferred. Each packet has 23-3 bytes payload.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So we will have 1000/7.5*2 packets transfered, since each packet has (23-3) bytes of payload we can calculate the throughput in bps as 1000/7.5*2*(23-3)*8 = 42.6kbps.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However I must be missing something since this does not work for other rows of the table when we have event length larger than 2.5ms. For example:&amp;nbsp;&lt;/p&gt;
&lt;table class="table long" id="ble_data_throughput__table_sz3_3wv_bs" border="1" cellpadding="4" cellspacing="0" frame="border" height="24" rules="all" summary="" width="638"&gt;
&lt;tbody class="tbody"&gt;
&lt;tr class="row"&gt;
&lt;td class="entry cellrowborder" colspan="1" headers="d3780e106" rowspan="4"&gt;GATT Client&lt;/td&gt;
&lt;td class="entry cellrowborder" colspan="1" headers="d3780e109" rowspan="4"&gt;23&lt;/td&gt;
&lt;td class="entry cellrowborder" colspan="1" headers="d3780e112" rowspan="4"&gt;7.5 ms&lt;/td&gt;
&lt;td class="entry cellrowborder" colspan="1" headers="d3780e115" rowspan="1"&gt;Receive Notification&lt;/td&gt;
&lt;td class="entry cellrowborder" colspan="1" headers="d3780e118" rowspan="1"&gt;192.0 kbps&lt;/td&gt;
&lt;td class="entry cellrowborder" colspan="1" headers="d3780e122" rowspan="1"&gt;256.0 kbps&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;I was thinking now since event length is 7.5 instead of 2.5 we will send 3 times as many Link Layer packets however&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1000/7.5*2*(23-3)*8*3 = 128.0kbps and not 192.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also as I understand BLE is 1MBPS using LE 1M PHY, at 1MBPS each bit takes a microsecond. so 2500 bits can be send in a 2.5ms interval. For ATT MTU size of 158 as in the table does this mean only 1 Link Layer packet is sent every 2.5ms since&amp;nbsp;the number of bits in two packets 158*2*8 is just a little larger than 2500? How is the row with 158 ATT_MTU computed?&lt;/p&gt;
&lt;table class="table long" id="ble_data_throughput__table_sz3_3wv_bs" border="1" cellpadding="4" cellspacing="0" frame="border" rules="all" summary=""&gt;
&lt;tbody class="tbody"&gt;
&lt;tr class="row"&gt;
&lt;td class="entry cellrowborder" colspan="1" headers="d3780e106" rowspan="4"&gt;GATT Server&lt;/td&gt;
&lt;td class="entry cellrowborder" colspan="1" headers="d3780e109" rowspan="4"&gt;158&lt;/td&gt;
&lt;td class="entry cellrowborder" colspan="1" headers="d3780e112" rowspan="4"&gt;7.5 ms&lt;/td&gt;
&lt;td class="entry cellrowborder" colspan="1" headers="d3780e115" rowspan="1"&gt;Send Notification&lt;/td&gt;
&lt;td class="entry cellrowborder" colspan="1" headers="d3780e118" rowspan="1"&gt;248.0 kbps&lt;/td&gt;
&lt;td class="entry cellrowborder" colspan="1" headers="d3780e122" rowspan="1"&gt;330.6 kbps&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Following&amp;nbsp;last table it seems that for&amp;nbsp;12 devices&amp;nbsp;at a connection interval of 40ms, event length of 2.5, and ATT_MTU 158 assuming only 1 Link Layer packet gets sent per event I can get a theoretical throughput of 1000/40*(158-3) =&amp;nbsp;&lt;span&gt;3875 bytes per second. Since the events would not overlap.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Directly modify Link Layer packet</title><link>https://devzone.nordicsemi.com/thread/241103?ContentTypeID=1</link><pubDate>Mon, 23 Mar 2020 11:49:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28a0c9cd-c07a-4c69-aa8a-44487dd84e59</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;You can find various throughput numbers here depending on configuration:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/ble_data_throughput/ble_data_throughput.html"&gt;https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/ble_data_throughput/ble_data_throughput.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As you can see you may get slightly higher throughput (e.g.&amp;nbsp;&lt;span&gt;771.1 kbps -&amp;gt; 803 kbps). However, whether it is worth the additional development time to get it right (firmware and application), and the drawback of likely not being compatible with many phone vendors I will let be up for discussion.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you need multiple links please check out:&lt;br /&gt;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/multilink_scheduling/suggested_intervals_windows_s132.html"&gt;https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/multilink_scheduling/suggested_intervals_windows_s132.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Kenneth&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Directly modify Link Layer packet</title><link>https://devzone.nordicsemi.com/thread/241010?ContentTypeID=1</link><pubDate>Sun, 22 Mar 2020 22:35:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:753f1c60-0f1a-4be2-bbf2-9b459e2232b9</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;there is an&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fble_sdk_app_ots.html&amp;amp;cp=4_0_0_4_1_2_30"&gt;object transfer service example&lt;/a&gt;&amp;nbsp;that uses L2CAP channels. I don&amp;#39;t have any experience with them, sorry.&lt;/p&gt;
&lt;p&gt;You missed another thing: minimal event length for BLE is 2.5ms, thus you cannot have 50 events&amp;nbsp;for 12 different devices per second, you&amp;#39;re limited with 400 events/sec. Samples will be grouped by two packets in a connection interval, so it&amp;#39;s better to send 128 bytes at once. I don&amp;#39;t think you can win anything with L2CAP channels.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Directly modify Link Layer packet</title><link>https://devzone.nordicsemi.com/thread/241008?ContentTypeID=1</link><pubDate>Sun, 22 Mar 2020 18:53:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1ce6801-f181-4986-a267-270c601e1b67</guid><dc:creator>LucosidE</dc:creator><description>&lt;p&gt;Hi Dmitry, thanks for your quick response, the L2CAP information is very helpful&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;After reading more about L2CAP it seems that basic L2CAP frames will allow for the smallest overhead while still supporting connection to a BLE device. Carefully setting up the L2CAP MTU will avoid data fragmentation.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For example lets say I have a data packet of 32 bytes. I can set up Link Layer payload to be 36 octets&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;//From att_mtu_throughput example
err_code = nrf_ble_gatt_data_length_set(&amp;amp;m_gatt, BLE_CONN_HANDLE_INVALID, 36&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;then use basic L2CAP which will have a 4 octet header (Length = 32, Channel ID = &lt;span&gt;0x0001 - 0x007F&lt;/span&gt;) and my 32 bytes of data.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;ESB seems very close to what I need, unfortunately it only supports up to 8 devices. I am looking for up to 12.&lt;/p&gt;
&lt;p&gt;My end goal is to have multiple devices that sample 32 bytes of data at 100Hz to stream that data to a single central device. I though I could set the connection interval to 10ms and directly set up the Link Layer MTU to be 32 bytes and just put the data in. However it seems there is no direct access to the Link Layer packet. So as I understand it L2CAP will give me the smallest overhead. For example I can set the connection interval to 20ms, set the Link Layer MTU to be 68 bytes then set up L2CAP on each device with Length 64 and different channel IDs. Finally on each device I put together 2 32 byte data samples and they get sent. Is my thinking correct that this will maximize throughput from multiple devices to a single one?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is there an L2CAP example using the sdk? I only found ones using GATT.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a ton&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Directly modify Link Layer packet</title><link>https://devzone.nordicsemi.com/thread/241000?ContentTypeID=1</link><pubDate>Sun, 22 Mar 2020 10:17:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e51719d8-fbc6-4471-8b23-e4d7ba402ff0</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;BLE 4.2 and upper allows you to enlarge your payload up to 247 bytes, allowing throughput close to theoretical maximum. Also you can use custom upper-layer protocol instead of GATT with&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/10786/l2cap-oriented-connection"&gt;L2CAP connection-oriented channels&lt;/a&gt;.&amp;nbsp;Another way is to use&amp;nbsp;some protocol with lower overhead, for example&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/intro-to-shockburstenhanced-shockburst"&gt;esb&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>