<?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>Getting current connection interval</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69466/getting-current-connection-interval</link><description>In NCS, is there a way to get the currently used connection interval ?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 14 Dec 2020 15:16:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69466/getting-current-connection-interval" /><item><title>RE: Getting current connection interval</title><link>https://devzone.nordicsemi.com/thread/284837?ContentTypeID=1</link><pubDate>Mon, 14 Dec 2020 15:16:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed7542d4-a955-4322-8433-c425c27581c5</guid><dc:creator>Nicolas Brunner</dc:creator><description>&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting current connection interval</title><link>https://devzone.nordicsemi.com/thread/284792?ContentTypeID=1</link><pubDate>Mon, 14 Dec 2020 13:26:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c84c7152-eb6c-4ca0-830b-bbf2a693e4f2</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Inside connected(), set through&amp;nbsp;&lt;code&gt;&lt;span&gt;bt_conn_cb_register&lt;/span&gt;&lt;span&gt;(&amp;amp;&lt;/span&gt;&lt;span&gt;conn_callbacks&lt;/span&gt;&lt;/code&gt;&lt;span&gt;&lt;code&gt;)&lt;/code&gt;, where &lt;code&gt;conn_callbacks&lt;/code&gt; has a field that contains a pointer to &lt;code&gt;connected()&lt;/code&gt;&amp;nbsp;do the following:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void connected(struct bt_conn *conn, u8_t err)
{
    struct bt_conn_info info;
    if(!bt_conn_get_info(conn, &amp;amp;info))
	{
		printk(&amp;quot;Connection interval: %u\n&amp;quot;, info.le.interval);
	}
    .
    .
    //Other necessary code
    .
    .
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Inside&amp;nbsp;&lt;/span&gt;le_param_updated(), which is set through bt_conn_cb_register() as well, do the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void le_param_updated(struct bt_conn *conn, u16_t interval, u16_t latency, u16_t timeout)
{
    struct bt_conn_info info;
    if(!bt_conn_get_info(conn, &amp;amp;info))
	{
		printk(&amp;quot;Connection interval: %u\n&amp;quot;, info.le.interval);
	}
    .
    .
    //Other necessary code
    .
    .
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>