<?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 fragment the BLE Data</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111873/how-to-fragment-the-ble-data</link><description>In my project I am facing issues to send 6000 bytes per second through BLE to androis app 
 For reading the sensor it is taking 30-40 ms processing time and after that I am sending buffer to BLE I want to fragment the data using BT_L2CAP_TX_FRAG_COUNT</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 22 Mar 2025 00:56:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111873/how-to-fragment-the-ble-data" /><item><title>RE: How to fragment the BLE Data</title><link>https://devzone.nordicsemi.com/thread/528485?ContentTypeID=1</link><pubDate>Sat, 22 Mar 2025 00:56:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06e0dcd4-557f-4fce-b7d2-22d6562174c2</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;In the application core, you need these.&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.9.1/samples/bluetooth/throughput/prj.conf#L32-L39"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.9.1/samples/bluetooth/throughput/prj.conf#L32-L39&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In the network core, you need these, but most of them should be set to such values by default.&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.9.1/samples/bluetooth/throughput/prj.conf#L38-L44"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.9.1/samples/bluetooth/throughput/prj.conf#L38-L44&lt;/a&gt;&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.9.1/samples/bluetooth/throughput/prj.conf#L32"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.9.1/samples/bluetooth/throughput/prj.conf#L32&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fragment the BLE Data</title><link>https://devzone.nordicsemi.com/thread/528197?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2025 11:37:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43e16f5c-9a0a-497f-8d20-f2954c99dc0b</guid><dc:creator>pal_722</dc:creator><description>&lt;p&gt;My data rate is 102kbps and am I trying to achieve that in NUS,&amp;nbsp;&lt;br /&gt;Can you tell me what configurations specifically has to be changed ?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fragment the BLE Data</title><link>https://devzone.nordicsemi.com/thread/528190?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2025 11:08:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5c925a3-3be9-4de6-9906-d363565c46a6</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi pal_722,&lt;/p&gt;
&lt;p&gt;The configuration changes necessary are already discussed in this thread.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As you are on the nRF5340 DK, you need to remember that you have a network core running the BT Controller, and the application core running the host. Some configs need to be set on&amp;nbsp;a specific core, and some need to be set on both. The Throughput sample&amp;nbsp;also shows&amp;nbsp;exactly that. You will need to pay attention to it.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fragment the BLE Data</title><link>https://devzone.nordicsemi.com/thread/528157?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2025 09:01:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0eaecdf0-42c0-42b7-bfed-387984ff40a0</guid><dc:creator>pal_722</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/vthieu"&gt;Hieu&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;In my application I am trying to send 12750bytes in one second. I am currently using NUS sample on two nrf5340 dks.&amp;nbsp;&lt;br /&gt;What configuration changes has to be done to achieve this throughput?&lt;/p&gt;
&lt;p&gt;I went through the throughput example, the default test case has higher data rate than my requirement.&amp;nbsp;&lt;br /&gt;I am expecting to get the required rate in my application too. But am confused as to what has to be done?I have been working for really long to achieve this and have failed miserably.&lt;br /&gt;Your reply will be of great help!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Regards&lt;br /&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fragment the BLE Data</title><link>https://devzone.nordicsemi.com/thread/488033?ContentTypeID=1</link><pubDate>Mon, 10 Jun 2024 07:48:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66da2883-357b-4cd5-9350-64d4f71c9c0f</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;You can consider using asynchronous APIs for both sensor reading and BLE.&lt;/p&gt;
&lt;p&gt;Sensor readings will be queued in callback. In your main thread/function/loop, the queue can be check, and if there is data, you send it there.&lt;/p&gt;
&lt;p&gt;The best way is to have different threads for the job. I recommend going over our free online course on&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/"&gt;nRF Connect SDK Fundamentals&lt;/a&gt;, where the topic of threads is covered.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fragment the BLE Data</title><link>https://devzone.nordicsemi.com/thread/487974?ContentTypeID=1</link><pubDate>Sat, 08 Jun 2024 06:16:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af60b50b-2d5c-4061-b725-6cf54814938d</guid><dc:creator>Madhu Mohan Reddy</dc:creator><description>&lt;p&gt;when sensor data ready pin triggers low(DRDY) ,sensor data reading function call happens and in same function I am sending data to BLE.(if Buffer is full)&lt;br /&gt;if(flag == 150) send the buffer to BLE.&lt;br /&gt;&lt;br /&gt;How can I send the data to BLE and read the sensor parellel&amp;nbsp;&lt;br /&gt;&lt;br /&gt;would you give some suggestions&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Thank you&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fragment the BLE Data</title><link>https://devzone.nordicsemi.com/thread/487963?ContentTypeID=1</link><pubDate>Fri, 07 Jun 2024 17:58:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b526c25-8c0d-4d8a-882b-df36f32c6814</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Madhu Mohan,&lt;/p&gt;
&lt;p&gt;It seems that you are new to BLE. I think it might benefit you to go over our free online course &lt;a href="https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/"&gt;Bluetooth Low Energy Fundamentals&lt;/a&gt;.&lt;/p&gt;
[quote user="Madhan Mohan Reddy"]&lt;p&gt;Using bt_gatt_notify(); is best for sending 6000 bytes as multiple chunks?&lt;/p&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;p&gt;Using&amp;nbsp;&lt;span&gt;bt_gatt_write_without_response&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;); is best?&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Notifying is an action that only the device in Peripheral role can do. &lt;br /&gt;Writing without Response is an action that only the device in Central role can do.&lt;/p&gt;
&lt;p&gt;In your use-case, it is most likely that your device is the Peripheral, and the Android device is the Central. If this is the case, you need to use bt_gatt_notify().&lt;/p&gt;
[quote user="Madhan Mohan Reddy"]&lt;div&gt;&lt;span&gt;CONFIG_BT_BUF_ACL_RX_SIZE&lt;/span&gt;&lt;span&gt;=502&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_ATT_PREPARE_COUNT&lt;/span&gt;&lt;span&gt;=2&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_L2CAP_TX_BUF_COUNT&lt;/span&gt;&lt;span&gt;=10&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_L2CAP_TX_MTU&lt;/span&gt;&lt;span&gt;=498&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_L2CAP_DYNAMIC_CHANNEL&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_CONN_TX_MAX&lt;/span&gt;&lt;span&gt;=10&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_BUF_ACL_TX_COUNT&lt;/span&gt;&lt;span&gt;=10&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_BUF_ACL_TX_SIZE&lt;/span&gt;&lt;span&gt;=502&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;I am bit confusing maximum we can send 495 buffer at a time or max 244 to BLE?&lt;br /&gt;In throughput Sample dummy buffer is declared as 498&amp;nbsp;&lt;/div&gt;[/quote]
&lt;p&gt;The 244 limit is to keep the GATT operation done in a single air packet. The GATT operation will be packed into a Link Layer packet, where&amp;nbsp;only 244~249 bytes of GATT data can be packed.&lt;/p&gt;
&lt;p&gt;However, a&amp;nbsp;GATT operation with longer value is still possible, and it will just be&amp;nbsp;split into multiple Link Layer packets. The maximum size&amp;nbsp;of the GATT operation is configured by&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.6.1/kconfig/index.html#CONFIG_BT_L2CAP_TX_MTU"&gt;CONFIG_BT_L2CAP_TX_MTU&lt;/a&gt;.&amp;nbsp;It is 498 by default in the Throughput sample, and likely why the dummy array is also 498.&lt;/p&gt;
[quote user="Madhan Mohan Reddy"]My buffer size is 150, i want 40 buffers every second ?&amp;nbsp; And To read the sensor data is taking some time for spi 25 msec&amp;nbsp;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;40 transfers of 150 bytes each second should be doable. The SPI read should not be a concern. Ideally you want to read the sensor&amp;nbsp;and send data&amp;nbsp;in parallel, not sequentially. You might want to consider using a separate thread for each job.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fragment the BLE Data</title><link>https://devzone.nordicsemi.com/thread/487770?ContentTypeID=1</link><pubDate>Thu, 06 Jun 2024 14:08:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f8ae850-f704-4b68-b615-4eb9619076cd</guid><dc:creator>Madhu Mohan Reddy</dc:creator><description>&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_BUF_ACL_RX_SIZE&lt;/span&gt;&lt;span&gt;=502&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_ATT_PREPARE_COUNT&lt;/span&gt;&lt;span&gt;=2&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_L2CAP_TX_BUF_COUNT&lt;/span&gt;&lt;span&gt;=10&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_L2CAP_TX_MTU&lt;/span&gt;&lt;span&gt;=498&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_L2CAP_DYNAMIC_CHANNEL&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_CONN_TX_MAX&lt;/span&gt;&lt;span&gt;=10&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_BUF_ACL_TX_COUNT&lt;/span&gt;&lt;span&gt;=10&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_BUF_ACL_TX_SIZE&lt;/span&gt;&lt;span&gt;=502&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;I am bit confusing maximum we can send 495 buffer at a time or max 244 to BLE?&lt;br /&gt;In throughput Sample dummy buffer is declared as 498&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fragment the BLE Data</title><link>https://devzone.nordicsemi.com/thread/487752?ContentTypeID=1</link><pubDate>Thu, 06 Jun 2024 13:42:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f87b249d-6dea-4c8d-a025-997c28f9ee62</guid><dc:creator>Madhu Mohan Reddy</dc:creator><description>&lt;p&gt;Hi Hieu&lt;br /&gt;&lt;br /&gt;Using bt_gatt_notify(); is best for sending 6000 bytes as multiple chunks?&lt;/p&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;p&gt;Using&amp;nbsp;&lt;span&gt;bt_gatt_write_without_response&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;); is best?&lt;br /&gt;&lt;br /&gt;My buffer size is 150, i want 40 buffers every second ?&amp;nbsp; And To read the sensor data is taking some time for spi 25 msec&amp;nbsp;&lt;br /&gt;&lt;br /&gt;How can i achieve this?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fragment the BLE Data</title><link>https://devzone.nordicsemi.com/thread/487709?ContentTypeID=1</link><pubDate>Thu, 06 Jun 2024 11:50:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71c4102d-6f1f-4286-a618-3ff35d9a2874</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hello Madhu Mohan,&lt;/p&gt;
&lt;p&gt;The 6000 bytes of data you are trying to send will have to be broken down into PDUs at the GATT layer and the GAP layer.&lt;/p&gt;
&lt;p&gt;At the GATT layer, the data has to be divided into chunks within the GATT MTU size. This must be done by the application.&lt;/p&gt;
&lt;p&gt;At the GAP layer, the GATT PDU is divided into packets based on the negotiated Data Length between the Central and Peripheral devices. This is done automatically by the stack.&lt;/p&gt;
&lt;p&gt;In general,&amp;nbsp;the developer just needs to configure the&amp;nbsp;application to support higher GATT MTU size and GAP Data Length. The particularities of these configurations have been discussed on DevZone and you will be able to find more information by searching.&lt;/p&gt;
&lt;p&gt;For example, this is best shown by the Throughput example.&lt;/p&gt;
&lt;p&gt;Throughput example in the nRF5 SDK:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/ble_sdk_app_att_mtu.html"&gt;https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/ble_sdk_app_att_mtu.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Throughput sample in the nRF Connect SDK:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.6.1/page/nrf/samples/bluetooth/throughput/README.html"&gt;https://docs.nordicsemi.com/bundle/ncs-2.6.1/page/nrf/samples/bluetooth/throughput/README.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>