<?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>What is the communication interval during service, characteristic and descriptor discovery?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37531/what-is-the-communication-interval-during-service-characteristic-and-descriptor-discovery</link><description>I am using SDK 12.3.0 and S130 2.0.1. 
 
 In example ble_app_uart and ble_app_uart_c, 
 Central setting: 
 
 
 Peripheral setting: 
 
 
 Why it took so long to discover service, characteristic and descriptor? 
 After connection establishment, the connection</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 16 Aug 2018 11:58:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37531/what-is-the-communication-interval-during-service-characteristic-and-descriptor-discovery" /><item><title>RE: What is the communication interval during service, characteristic and descriptor discovery?</title><link>https://devzone.nordicsemi.com/thread/144522?ContentTypeID=1</link><pubDate>Thu, 16 Aug 2018 11:58:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:641367a5-4e08-455b-bc3d-d75cdac91d3c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;1. FIRST_CONN_PARAMS_UPDATE_DELAY starts to count down from the BLE_GAP_EVT_CONNECTED event.&lt;/p&gt;
&lt;p&gt;2. It starts automatically. You can see it in ble_conn_params.c.&lt;/p&gt;
&lt;p&gt;3. If the negotiation fails, and is rejected, it starts a new timer with NEXT_CONN_PARAMS_UPDATE_DELAY.&lt;/p&gt;
&lt;p&gt;4. Sorry. My bad. I heard that once, but it looks like it is not recommended to do so, because typically, phones connect with a short connection interval, and since you want to do the service discovery quick, it was not recommended to change to a longer connection interval before this was finished. You can negotiate at once, if you like. You can see the connection parameters in the BLE_GAP_EVT_CONNECTED event:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;case BLE_GAP_EVT_CONNECTED:
NRF_LOG_INFO(&amp;quot;conn_int = 0x%x&amp;quot;, p_ble_evt-&amp;gt;evt.gap_evt.params.connected.conn_params.min_conn_interval;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;it doesn&amp;#39;t matter whether you check min_conn_interval or max_conn_interval. They have the same value in this event.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the communication interval during service, characteristic and descriptor discovery?</title><link>https://devzone.nordicsemi.com/thread/144471?ContentTypeID=1</link><pubDate>Thu, 16 Aug 2018 09:24:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb6d1dea-f48e-47bb-ae82-349896856f08</guid><dc:creator>John_Doe</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;What do you mean by &amp;quot;&lt;span&gt;this must be called after service discovery&lt;/span&gt;&amp;quot;? After&amp;nbsp;BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP or&amp;nbsp;BLE_GATTC_EVT_DESC_DISC_RSP??&lt;/p&gt;
&lt;p&gt;From ble_db_discovery.c in central,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    switch (p_ble_evt-&amp;gt;header.evt_id)
    {
        case BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP:
            on_primary_srv_discovery_rsp(p_db_discovery, &amp;amp;(p_ble_evt-&amp;gt;evt.gattc_evt));
            break;

        case BLE_GATTC_EVT_CHAR_DISC_RSP:
            on_characteristic_discovery_rsp(p_db_discovery, &amp;amp;(p_ble_evt-&amp;gt;evt.gattc_evt));
            break;

        case BLE_GATTC_EVT_DESC_DISC_RSP:
            on_descriptor_discovery_rsp(p_db_discovery, &amp;amp;(p_ble_evt-&amp;gt;evt.gattc_evt));
            break;

        case BLE_GAP_EVT_DISCONNECTED:
            on_disconnected(p_db_discovery, &amp;amp;(p_ble_evt-&amp;gt;evt.gap_evt));
            break;

        default:
            break;
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here is some questions,&lt;/p&gt;
&lt;p&gt;When would&amp;nbsp;&lt;span&gt;FIRST_CONN_PARAMS_UPDATE_DELAY start to count down? &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Does peripheral&amp;nbsp;start &amp;quot;connection parameters negotiation&amp;quot; request in this uart example automatically&amp;nbsp;when the countdown is finished or I need to&amp;nbsp; use ble_conn_params_change_conn_params function to start the&amp;nbsp;negotiation request?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;What is the use of&amp;nbsp;NEXT_CONN_PARAMS_UPDATE_DELAY?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What would happen if&amp;nbsp;peripheral&amp;nbsp;sent&amp;nbsp;&amp;quot;connection parameters&amp;nbsp;negotiation&amp;quot; request before service discovery task is&amp;nbsp;completed.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Most of the time it is central (client) to do service discovery task. So, does peripheral (server) know when would service discovery task is completed?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Sorry for so many questions.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the communication interval during service, characteristic and descriptor discovery?</title><link>https://devzone.nordicsemi.com/thread/144454?ContentTypeID=1</link><pubDate>Thu, 16 Aug 2018 08:38:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:823f2b3e-c329-4050-a47e-6e5216895256</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;It is always the central that decides the connection interval. The peripheral can request changes, but it is the central that has the final saying. The only thing the peripheral can do if it does not get the desired connection parameters, is disconnect.&lt;/p&gt;
&lt;p&gt;The softdevice will, when given a max and min conn_interval, always use the MAX, since it is the most power efficient, so thus, the 4s connection interval is used in this case.&lt;/p&gt;
&lt;p&gt;The peripheral will try to negotiate after a certain amount of time, FIRST_CONN_PARAMS_UPDATE_DELAY, which is typically set to 5 seconds. You can try to shorten this. The important thing is that this must be called after service discovery, and hence the delay is often set to 5 seconds.&lt;/p&gt;
&lt;p&gt;The central will in this case accept the new connection parameters, since the desired value is within the MIN-MAX range.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>