<?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>How to get all of the BLE connection state?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53608/how-to-get-all-of-the-ble-connection-state</link><description>Aside from the connection interval, I&amp;#39;d like to know if the 2Mhz phy is enable along with Data Packet Length Extension and Connection Event Length Extension. 
 
 Is there a way for the app to get this information?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 24 Oct 2019 12:19:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53608/how-to-get-all-of-the-ble-connection-state" /><item><title>RE: How to get all of the BLE connection state?</title><link>https://devzone.nordicsemi.com/thread/216617?ContentTypeID=1</link><pubDate>Thu, 24 Oct 2019 12:19:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:147147d7-d3c3-4bdf-baf7-1e02544bb4a9</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote userid="8138" url="~/f/nordic-q-a/53608/how-to-get-all-of-the-ble-connection-state"]I&amp;#39;d like to know if the 2Mhz phy[/quote]
&lt;p&gt;When the PHY is updated you will get a event,&amp;nbsp;BLE_GAP_EVT_PHY_UPDATE, with the PHY that is used. See &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v6.1.1/structble__gap__evt__phy__update__t.html?cp=3_5_2_2_2_1_4_25"&gt;this &lt;/a&gt;and &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.1.1/group___b_l_e___g_a_p___p_e_r_i_p_h_e_r_a_l___p_h_y___u_p_d_a_t_e.html?cp=3_5_3_2_2_1_3_7_1"&gt;this link&lt;/a&gt;.&lt;/p&gt;
[quote userid="8138" url="~/f/nordic-q-a/53608/how-to-get-all-of-the-ble-connection-state"]&lt;span style="font-size:inherit;"&gt;along with&amp;nbsp;&lt;/span&gt;Data Packet Length Extension[/quote]
&lt;p&gt;This is handled by the GATT Module. You can read it with the function &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__nrf__ble__gatt.html?cp=5_5_0_6_2_12_10#ga1e01e765c2cf0043c3213da12924d161"&gt;nrf_ble_gatt_data_length_get().&lt;/a&gt;&lt;/p&gt;
[quote userid="8138" url="~/f/nordic-q-a/53608/how-to-get-all-of-the-ble-connection-state"]and&amp;nbsp;Connection Event Length Extension.[/quote]
&lt;p&gt;This is something that is either enabled or disabled.&amp;nbsp;&lt;span&gt;When enabled the SoftDevice will dynamically extend the connection event when possible.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If&amp;nbsp;&lt;/span&gt;&lt;em&gt;sd_ble_opt_set(BLE_COMMON_OPT_CONN_EVT_EXT,&amp;nbsp;&amp;amp;opt)&amp;nbsp;&lt;/em&gt;returned&amp;nbsp;NRF_SUCCESS, it&amp;#39;s enabled. You cannot use&amp;nbsp;&lt;span&gt;sd_ble_opt_get for this option. See &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s312.api.v6.1.1/structble__common__opt__conn__evt__ext__t.html?cp=3_5_5_0_2_1_2_3_9_0#ab65ddd3e9a2b26b0ae8a3c49a18a1f8f"&gt;this link.&lt;/a&gt;&amp;nbsp;Snippet on how to enable:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    ret_code_t err_code;
    ble_opt_t  opt;

    memset(&amp;amp;opt, 0x00, sizeof(opt));
    opt.common_opt.conn_evt_ext.enable = 1;

    err_code = sd_ble_opt_set(BLE_COMMON_OPT_CONN_EVT_EXT, &amp;amp;opt);
    APP_ERROR_CHECK(err_code);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>