<?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>connect interval</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/24256/connect-interval</link><description>SDK： nRF5_SDK_11.0.0
Softdevice： s132_nrf52_2.0.0_softdevice 
 #define MIN_CONN_INTERVAL MSEC_TO_UNITS(20, UNIT_1_25_MS) /**&amp;lt; Minimum acceptable connection interval (20 ms), Connection interval uses 1.25 ms units. */
#define MAX_CONN_INTERVAL MSEC_TO_UNITS</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Aug 2017 07:38:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/24256/connect-interval" /><item><title>RE: connect interval</title><link>https://devzone.nordicsemi.com/thread/95493?ContentTypeID=1</link><pubDate>Fri, 11 Aug 2017 07:38:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a70ea959-a2ca-4d3b-b427-269bb90dd3b0</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When initializing the Connection Parameters module you have the option to decide if a failed connection parameters update shall cause an &lt;strong&gt;automatic&lt;/strong&gt; disconnection or not. This is done by setting the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v13.0.0/structble__conn__params__init__t.html?cp=4_0_2_6_2_7_1_0#abf5ac3620c0afeef3c3a04608094119a"&gt;disconnect_on_fail&lt;/a&gt; flag.  A connection parameters update is here considered failed if the central and peripheral have not agreed upon the connection parameters after &lt;code&gt;MAX_CONN_PARAMS_UPDATE_COUNT&lt;/code&gt; number of connection parameter update attempts.&lt;/p&gt;
&lt;p&gt;Code snippet:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    /**@brief Function for initializing the Connection Parameters module.
 */
static void conn_params_init(void)
{
    ret_code_t             err_code;
    ble_conn_params_init_t cp_init;

    memset(&amp;amp;cp_init, 0, sizeof(cp_init));

    cp_init.p_conn_params                  = NULL;
    cp_init.first_conn_params_update_delay = FIRST_CONN_PARAMS_UPDATE_DELAY;
    cp_init.next_conn_params_update_delay  = NEXT_CONN_PARAMS_UPDATE_DELAY;
    cp_init.max_conn_params_update_count   = MAX_CONN_PARAMS_UPDATE_COUNT;
    cp_init.start_on_notify_cccd_handle    = m_hrs.hrm_handles.cccd_handle;
    cp_init.disconnect_on_fail             = false;
    cp_init.evt_handler                    = on_conn_params_evt;
    cp_init.error_handler                  = conn_params_error_handler;

    err_code = ble_conn_params_init(&amp;amp;cp_init);
    APP_ERROR_CHECK(err_code);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that you will get a &lt;code&gt;BLE_CONN_PARAMS_EVT_FAILED&lt;/code&gt; event after a failed connection parameters update. This allows you to directly disconnect, and/or take other actions in the Connection Parameters event handler, even if you have set the &lt;code&gt;disconnect_on_fail&lt;/code&gt; flag to false.&lt;/p&gt;
&lt;p&gt;Code snippet:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; * @param[in] p_evt  Event received from the Connection Parameters Module.
 */
static void on_conn_params_evt(ble_conn_params_evt_t * p_evt)
{
    ret_code_t err_code;

    if (p_evt-&amp;gt;evt_type == BLE_CONN_PARAMS_EVT_FAILED)
    {
        err_code = sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_CONN_INTERVAL_UNACCEPTABLE);
        APP_ERROR_CHECK(err_code);
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: connect interval</title><link>https://devzone.nordicsemi.com/thread/95492?ContentTypeID=1</link><pubDate>Fri, 11 Aug 2017 03:24:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb495fa5-541e-49be-9d05-3b184199e605</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;Please use the code button, otherwise the hash tag makes the code into a heading&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>