<?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>Why 250 ms interval between subsequent reads?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22043/why-250-ms-interval-between-subsequent-reads</link><description>I observe strange behavior while reading value for long characteristics. 
 I have characteristic 100 bytes long (read only).
In GATT client I must read value with subsequent reads
( sd_ble_gattc_read with proper offsets). Everything works fine with</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 May 2017 12:15:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22043/why-250-ms-interval-between-subsequent-reads" /><item><title>RE: Why 250 ms interval between subsequent reads?</title><link>https://devzone.nordicsemi.com/thread/86512?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 12:15:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0838a214-b014-480c-9fcf-7d66ecf00dcc</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;I am not familiar with how the MBED OS uses our SDK, so there might be some &amp;quot;bootlenecks&amp;quot; there, but if they&amp;#39;ve implemented it correctly then you should see the throughput that we list in the SoftDevice Product Specification, Chapter 18, &lt;a href="http://infocenter.nordicsemi.com/pdf/S132_SDS_v2.0.pdf"&gt;here&lt;/a&gt; is the link to the SDS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why 250 ms interval between subsequent reads?</title><link>https://devzone.nordicsemi.com/thread/86511?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 07:44:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5034cf27-31b9-4258-a764-3449024f72a3</guid><dc:creator>HeS</dc:creator><description>&lt;p&gt;I&amp;#39;m using MBED OS v5.3 (SDK v12.x) with SoftDevice S132 v2.0.1.
Probably the best &amp;quot;strategy&amp;quot; is to wait for software update to SDK v13 and newer SD.
I see that such upgrade is prepared.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why 250 ms interval between subsequent reads?</title><link>https://devzone.nordicsemi.com/thread/86509?ContentTypeID=1</link><pubDate>Mon, 15 May 2017 12:18:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfb3709a-e00c-4272-836f-85f204810c37</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;And the &amp;quot;Wait for bucket (off=xx) st=0x0&amp;quot; entries? Which SDK and SoftDevice version are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why 250 ms interval between subsequent reads?</title><link>https://devzone.nordicsemi.com/thread/86508?ContentTypeID=1</link><pubDate>Mon, 15 May 2017 12:09:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2defd5f-238b-4072-bceb-2f3764227258</guid><dc:creator>HeS</dc:creator><description>&lt;p&gt;@BS:&amp;quot;Are you calling sd_ble_gattc_read immediately when you get the BLE_GATTC_EVT_READ_RSP event?&amp;quot;
YES. I can delay read with EventQueue but i think is not necessary. Status after read is ZERO, so no error in read.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why 250 ms interval between subsequent reads?</title><link>https://devzone.nordicsemi.com/thread/86507?ContentTypeID=1</link><pubDate>Mon, 15 May 2017 12:07:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c467cd03-1df9-43ed-8cb1-eb28f747b24b</guid><dc:creator>HeS</dc:creator><description>&lt;p&gt;@Bjørn Spockeli:&amp;quot;How are you handling the BLE_GATTC_EVT_READ_RSP event?&amp;quot;
I have my own callback function (processOnRead). This function copy received fragment to buffer and executed next read command.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why 250 ms interval between subsequent reads?</title><link>https://devzone.nordicsemi.com/thread/86510?ContentTypeID=1</link><pubDate>Mon, 15 May 2017 12:04:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb3b2ec1-42b5-446c-ba77-f35d2b643b54</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Could you explain the  &amp;quot;Wait for bucket (off=xx) st=0x0&amp;quot; entries? Are you calling sd_ble_gattc_read immediately when you get the BLE_GATTC_EVT_READ_RSP event?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why 250 ms interval between subsequent reads?</title><link>https://devzone.nordicsemi.com/thread/86506?ContentTypeID=1</link><pubDate>Mon, 15 May 2017 11:50:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c366e49-0db3-4ea1-b192-6bb14b1794db</guid><dc:creator>HeS</dc:creator><description>&lt;p&gt;Explanation to logs:
Receiver (central) send custom frame with command (in log &amp;quot;INFO;&amp;quot;) and wait for response (sender).
Sender (peripheral) receive command, execute and set response in read characteristic. Receiver read characteristic (128 byte long).&lt;/p&gt;
&lt;p&gt;Log is completed in RAM buffer and displayed after end of transaction.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why 250 ms interval between subsequent reads?</title><link>https://devzone.nordicsemi.com/thread/86505?ContentTypeID=1</link><pubDate>Mon, 15 May 2017 11:49:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6b30d35-c5f7-474e-bfe2-90d77c6a3825</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;I was referring to a Wireshark trace from nRF Sniffer so that we can see how many packets that are sent per connection interval. How are you handling the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v2.0.1/group___b_l_e___g_a_t_t_c___v_a_l_u_e___r_e_a_d___m_s_c.html"&gt;BLE_GATTC_EVT_READ_RSP&lt;/a&gt; event?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why 250 ms interval between subsequent reads?</title><link>https://devzone.nordicsemi.com/thread/86504?ContentTypeID=1</link><pubDate>Mon, 15 May 2017 11:43:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5ae4e51-d239-4617-b958-ad6658003401</guid><dc:creator>HeS</dc:creator><description>&lt;p&gt;Receiver log second half:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  0:39:845 Wait for bucket (off=44) st=0x0
  0:40:095 BLE-data (off=44, len=22) bodyLen:119
  0:40:095 Incomplete packet.Fragment: 66 != (119 + 9)
  0:40:095 Wait for bucket (off=66) st=0x0
  0:40:345 BLE-data (off=66, len=22) bodyLen:119
  0:40:345 Incomplete packet.Fragment: 88 != (119 + 9)
  0:40:345 Wait for bucket (off=88) st=0x0
  0:40:595 BLE-data (off=88, len=22) bodyLen:119
  0:40:595 Incomplete packet.Fragment: 110 != (119 + 9)
  0:40:595 Wait for bucket (off=110) st=0x0
  0:40:845 BLE-data (off=110, len=18) bodyLen:119
  0:40:845 BLE-packet completed (ftype:1) btype:0, len:119
  0:41:095 Disconnected for connection 0
  0:49:414 UART-Request &amp;#39;log&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why 250 ms interval between subsequent reads?</title><link>https://devzone.nordicsemi.com/thread/86503?ContentTypeID=1</link><pubDate>Mon, 15 May 2017 11:42:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb0d657f-3147-4c4e-aef3-3e53a755c8bf</guid><dc:creator>HeS</dc:creator><description>&lt;p&gt;Receiver log. First half (comment limits:)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  0:36:428 UART-Request &amp;#39;ble.send&amp;#39;
  0:36:429 Setting BLE parameters err_code:0
  0:36:429 PA LNA setting: 0
  0:36:429 Prefered params(st:0): min:30 max:100 latency:0 timeout:400
  0:36:430 UART-Init bucket 1 chunks, 5 chars in queue. 0 in buffer 
  0:36:966 Connection for device 0 status: 0  (state : 0)
  0:37:968 Connection Callback (6 Tx buffers available)
  0:39:095 Terminated SD for handle 0.
  0:39:095 Send command &amp;#39;info;&amp;#39; for connection 0
  0:39:595 BLE-data (off=0, len=22) bodyLen:119
  0:39:595 FRAME sNode:2 seq:0 dNode:0 fType:1 bLen:119 bType:0
  0:39:595 FRAME body: &amp;#39;?=========== ?&amp;#39;
  0:39:595 Incomplete packet.Fragment: 22 != (119 + 9)
  0:39:596 Wait for bucket (off=22) st=0x0
  0:39:845 BLE-data (off=22, len=22) bodyLen:119
  0:39:845 Incomplete packet.Fragment: 44 != (119 + 9)
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why 250 ms interval between subsequent reads?</title><link>https://devzone.nordicsemi.com/thread/86502?ContentTypeID=1</link><pubDate>Mon, 15 May 2017 11:38:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:568e0e39-1333-4a46-86a7-97620176d992</guid><dc:creator>HeS</dc:creator><description>&lt;p&gt;Ok. Sender log:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  0:06:151 Setting BLE parameters err_code:0
  0:06:151 PA LNA setting: 0
  0:06:151 Prefered params(st:0): min:30 max:100 latency:0 timeout:400
  0:06:152 UART-Init bucket 1 chunks, 15 chars in queue. 0 in buffer 
  0:19:233 Connect: AdrType:1 Addr:49436555FAF8 ownAddr:B272939FDAD5
  0:19:233 Connection Callback (7 Tx buffers available)
  0:20:484 BLE-data (off=0, len=14) bodyLen:5
  0:20:484 FRAME sNode:1 seq:0 dNode:0 fType:1 bLen:5 bType:0
  0:20:484 FRAME body: &amp;#39;info;&amp;#39;
  0:20:484 BLE-packet completed (ftype:1) btype:0, len:5
  0:20:485 BLE-Request &amp;#39;info&amp;#39;
  0:20:486 BLE-Init bucket 1 chunks, 462 chars in queue. 0 in buffer 
  0:20:487 FRAME sNode:2 seq:0 dNode:0 fType:1 bLen:119 bType:0
  0:20:487 FRAME body: &amp;#39;?=========== System statistics =========&amp;#39;
  0:20:488 BLE-set response (2) 128 length. Status:0
  0:22:359 BLE-disconnection reason: 0x13
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why 250 ms interval between subsequent reads?</title><link>https://devzone.nordicsemi.com/thread/86501?ContentTypeID=1</link><pubDate>Mon, 15 May 2017 11:19:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7692eee6-c0f2-454e-8c62-15fdbfdcfc3b</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;It would be very helpful if you could upload a sniffer trace of the transaction.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why 250 ms interval between subsequent reads?</title><link>https://devzone.nordicsemi.com/thread/86500?ContentTypeID=1</link><pubDate>Mon, 15 May 2017 08:58:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1505e8b-6c8e-4806-a179-07d875780e00</guid><dc:creator>HeS</dc:creator><description>&lt;p&gt;I set on both side the same connection parameters (with &lt;strong&gt;sd_ble_gap_ppcp_set&lt;/strong&gt;):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;min:30,  
max:100,  
latency:0,  
timeout:400
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and set on both side the same behavior strategy to BLE_CONN_BW_HIGH
(6 Tx/Rx buffers in Central and 7 Tx on Peripheral) by this snippet:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//-----------------
...
    if(role == 2)
    	conn_bw.role = BLE_GAP_ROLE_CENTRAL;
    else
    	conn_bw.role = BLE_GAP_ROLE_PERIPH;
    conn_bw.conn_bw.conn_bw_rx = BLE_CONN_BW_HIGH;
    conn_bw.conn_bw.conn_bw_tx = BLE_CONN_BW_HIGH;
    ble_opt.common_opt.conn_bw = conn_bw;
    sd_ble_opt_set(BLE_COMMON_OPT_CONN_BW, &amp;amp;ble_opt)
...
//-----------------
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I find only one place in SDK documentation where 250 ms interval is analysed.
(SysTick driver settings, 24-bit counter on 64MHz clock overflows every ~250 ms).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why 250 ms interval between subsequent reads?</title><link>https://devzone.nordicsemi.com/thread/86499?ContentTypeID=1</link><pubDate>Sun, 14 May 2017 22:54:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c44070fe-8fc5-4837-9ad0-193213761053</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;well what are your connection parameters set to for that connection? You get to choose the max and min intervals when you make the connection, what did you choose? If you chose 250ms then that&amp;#39;s why you&amp;#39;re getting 250ms&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>