<?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 send and receive speed, GATTS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18286/ble-send-and-receive-speed-gatts</link><description>Hello, 
 Currently i am doing some testing with the NRF52 DK.
I am measuring the time it takes to send and receive a BLE message.
I am using the high bandwidth setting the the TX and RX. 
 conn_bw.conn_bw.conn_bw_rx = BLE_CONN_BW_HIGH;
conn_bw.conn_bw</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 14 Dec 2016 13:25:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18286/ble-send-and-receive-speed-gatts" /><item><title>RE: BLE send and receive speed, GATTS</title><link>https://devzone.nordicsemi.com/thread/70627?ContentTypeID=1</link><pubDate>Wed, 14 Dec 2016 13:25:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1283c84c-ae4f-462a-8f1f-e78068c706af</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Issue was that I was still searching for other devices, while sending.
Same issue as here : &lt;a href="https://devzone.nordicsemi.com/question/17987/synchronize-two-devices/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE send and receive speed, GATTS</title><link>https://devzone.nordicsemi.com/thread/70626?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2016 16:01:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70dfb2cc-06f3-4398-af90-1fde6e909dae</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;127.8 kbps in each direction means that you can send and receive at 127.8 kbps. This number is basically just 6 TX/RX packets per connection event and a connection interval of 7.5ms:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;6 packets per event * 8 bits per byte * 20 byte per packet / 7.5 ms = 128 kbps
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Why you don&amp;#39;t get that high throughput when sending and receiving, I don&amp;#39;t know. It can be application processing or something else. As the SDS says:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Maximum throughput will only be possible when the application reads data packets as they are received, and
provides new data as packets are transmitted, without delay
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You should take a look at the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/ble_sdk_app_att_mtu.html?cp=4_0_1_4_2_1_0"&gt;ATT MTU throughput example&lt;/a&gt; in SDK 12.2.0. This also shows how you can change the MTU or PDU (packet payload) size and connection event extension to get even higher speeds. Maximum speed with SoftDevice S132 v3 can be up to 765.8kbps, see &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.sds/dita/softdevices/s130/ble_data_throughput/ble_data_throughput.html?cp=2_3_0_0_16"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE send and receive speed, GATTS</title><link>https://devzone.nordicsemi.com/thread/70625?ContentTypeID=1</link><pubDate>Mon, 12 Dec 2016 17:44:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe396149-4dc8-450c-8850-f2b660a1fa82</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;I found the issue, i was scanning while sending....
&lt;a href="https://devzone.nordicsemi.com/question/17987/synchronize-two-devices/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;, same issue as here.&lt;/p&gt;
&lt;p&gt;another question: I am using the S132 V2, and i read this: 127.8 kbps (each
direction)
What does this mean , that i have 64kb/s send and receive?, since i reach 139kb/s to one deveice, but only 54kb/s whe the device is sending and receiving.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE send and receive speed, GATTS</title><link>https://devzone.nordicsemi.com/thread/70623?ContentTypeID=1</link><pubDate>Fri, 09 Dec 2016 13:54:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c39d9f65-8e71-40e2-a941-a36ff433c702</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;To update the connection parameters you will have to call &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html#gaf89b434841998ab384e0612dca9e12f8"&gt;&lt;code&gt;sd_ble_gap_conn_param_update(..)&lt;/code&gt;&lt;/a&gt;, with sd_ble_gap_ppcp_set(..) you are only setting the preferred connection parameters. Basically this is the way it goes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The central will decide the initial connection parameters. If you are using an nRF device for the central, the desired connection parameters (the SoftDevice may choose higher values if it is not possible due to too many connections) are the last parameter in &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html#gacb36dc9947591179acb83aef50b04282"&gt;&lt;code&gt;sd_ble_gap_connect(..)&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The central or peripheral can later update or request to update the connection parameters by calling &lt;code&gt;sd_ble_gap_conn_param_update(..)&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Check what the connection parameters used by the central is. I also advise you to use the SDK &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/lib_ble_conn_params.html?cp=4_0_0_3_1_3"&gt;connection parameters negotiation library&lt;/a&gt; which is used by most of our BLE examples.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE send and receive speed, GATTS</title><link>https://devzone.nordicsemi.com/thread/70624?ContentTypeID=1</link><pubDate>Fri, 09 Dec 2016 13:16:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34163e46-14ef-4f19-a8ea-fef998a6af6e</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;I did the same test but now i send 100 packets with 20 bytes payload.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Average = 384,0847778 == 260 packet/s
Max = 537,5976563 == 186 packet/s
Min = 223,7243652 == 446 packet/s 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I shouldn&amp;#39;t be to reach 446 packets/s with 85 ms delay. With 446 packets/s = ~13,5 ms delay,
800 pakcets/s = 7.5 ms,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE send and receive speed, GATTS</title><link>https://devzone.nordicsemi.com/thread/70622?ContentTypeID=1</link><pubDate>Fri, 09 Dec 2016 12:54:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e0873b5-3b80-43b4-a3a7-dbf40a5b3f6b</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;when i start sending i set a gpio pin high, this is measured on a other nrf52DK and i take a RTC timestamp wich is 30US per tick. When I receive  the message on my other device, i am polling with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sizeOfCurrentEvent = sizeOfEvent;
err = sd_ble_evt_get((u8*)currentEventBuffer, &amp;amp;sizeOfCurrentEvent);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;if err == NRF_SUCCES
then I check if it my messeage, if so I set another GPIO pin high. my 3rd NRF52Dk will take a second time stamp, timestamp2-timestamp1 = result/32768*1000 = result in ms&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE send and receive speed, GATTS</title><link>https://devzone.nordicsemi.com/thread/70621?ContentTypeID=1</link><pubDate>Fri, 09 Dec 2016 12:46:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9781aa43-9bc9-47d2-853e-015378c7e78b</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;I am setting the interval here. with the setting above, also slavelatancy is 0.	&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_gap_conn_params_t gapConnectionParams;
	memset(&amp;amp;gapConnectionParams, 0, sizeof(gapConnectionParams));
	gapConnectionParams.min_conn_interval = Config-&amp;gt;meshMinConnectionInterval;
	gapConnectionParams.max_conn_interval = Config-&amp;gt;meshMaxConnectionInterval;
	gapConnectionParams.slave_latency = Config-&amp;gt;meshPeripheralSlaveLatency;
	gapConnectionParams.conn_sup_timeout = Config-&amp;gt;meshConnectionSupervisionTimeout;
	err = sd_ble_gap_ppcp_set(&amp;amp;gapConnectionParams);
	APP_ERROR_CHECK(err); //OK
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE send and receive speed, GATTS</title><link>https://devzone.nordicsemi.com/thread/70620?ContentTypeID=1</link><pubDate>Fri, 09 Dec 2016 12:28:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9fedd05-3261-49f7-a573-26c754041df3</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;How are you measuring? Do you measure from the sd_ble_gattc_write(..) command is sent to the TX complete event is received or to the packet is received on the other side?&lt;/p&gt;
&lt;p&gt;You will naturally have variable latency in BLE because of the connection interval. If you manage to update the SoftDevice buffer right before the connection event, you will have the lowest latency, if you do it right after, you will have the highest latency (lowest + connection interval).&lt;/p&gt;
&lt;p&gt;You should check that the connection interval is actually set to 7.5 ms, from your measurements it looks like it may be closer to 85 ms.&lt;/p&gt;
&lt;p&gt;The application can also delay the measurements depending on interrupt levels and where you start/stop the measurements or where you call sd_ble_gattc_write(..).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>