<?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>Central peripheral BLE address connection check</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/46052/central-peripheral-ble-address-connection-check</link><description>(開発環境 ) OS in development environment ：Windows7 HARD :(Taiyo Yuden)EBSHSN Series Evaluation Board : Central / Peripherals CPU :(Nordic) nRF52832 / ARMR Cortex?-M4F 32 bit processor 28-pin Land Grid Array / 15GPIOs / SWD Soft Ver:nRF5_SDK_15.2.0_9412b96</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Apr 2019 10:45:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/46052/central-peripheral-ble-address-connection-check" /><item><title>RE: Central peripheral BLE address connection check</title><link>https://devzone.nordicsemi.com/thread/182335?ContentTypeID=1</link><pubDate>Tue, 16 Apr 2019 10:45:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b512b4c7-8c01-46be-b076-4930c5cb8bfc</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;In the disconnected event you should have a conn_handle.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;case BLE_GAP_EVT_DISCONNECTED:
NRF_LOG_INFO(&amp;quot;Disconnected conn_handle %d&amp;quot;, p_ble_evt-&amp;gt;evt.gap_evt.conn_handle);
...&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can compare this conn_hande to the conn_handle that occured in the BLE_GAP_EVT_CONNECTED event. The connected event has both a conn_handle and an address.&lt;/p&gt;
&lt;p&gt;So let us say that in the BLE_GAP_EVT_CONNECTED event you had conn_handle 0x01 and address 0xea88a2c41a92.&lt;/p&gt;
&lt;p&gt;Then, later, you get a disconnect with conn_handle 0x01, this means that the device with address &lt;span&gt;0xea&lt;/span&gt;&lt;span&gt;88&lt;/span&gt;&lt;span&gt;a2c41a92 disconnected.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Edvin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central peripheral BLE address connection check</title><link>https://devzone.nordicsemi.com/thread/182233?ContentTypeID=1</link><pubDate>Tue, 16 Apr 2019 06:05:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dec1771e-cc5d-4fa8-9c63-0cf5e93f683d</guid><dc:creator>yokokawa</dc:creator><description>&lt;div class="col"&gt;
&lt;div id="center_col"&gt;
&lt;div class="med" id="res"&gt;
&lt;div id="search"&gt;
&lt;div&gt;
&lt;div id="ires"&gt;
&lt;div id="rso"&gt;
&lt;div class="bkWMgd"&gt;
&lt;div class="g knavi obcontainer mod"&gt;
&lt;div&gt;
&lt;div class="vk_c" id="tw-container"&gt;
&lt;div class="r-iAF75bDFL9GI xpdbox xpdclose" id="uid_0"&gt;
&lt;div class="vk_bk r-iEbY_waIXoTA"&gt;
&lt;div id="tw-ob"&gt;
&lt;div class="oSioSc"&gt;
&lt;div id="tw-target"&gt;
&lt;div class="gsrt tw-nfl tw-ta-container" id="tw-target-text-container"&gt;
&lt;pre class="tw-data-text tw-ta tw-text-small" id="tw-target-text" dir="ltr"&gt;&lt;span lang="en"&gt;I misunderstood the BLE address, but I thought that the number specified at the time of transmission was the BLE address.
When BLE communication is disconnected, the disconnected communication number can not be known.
When BLE communication is disconnected, the BLE address &amp;quot;p_gap_evt-&amp;gt; conn_handle&amp;quot; is always &amp;quot;0x00&amp;quot; in &amp;quot;BLE_NUS_C_EVT_DISCONNECTED&amp;quot;, so it is not possible to know the disconnected number.
Please tell me how to check the disconnection number.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="col" id="rhscol"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central peripheral BLE address connection check</title><link>https://devzone.nordicsemi.com/thread/181446?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2019 05:21:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b277b326-e653-489f-9952-12460870059f</guid><dc:creator>Jimmy Wong</dc:creator><description>&lt;p&gt;The address is 0xea88a2c41a92 (if you are using the nRF52 as central).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central peripheral BLE address connection check</title><link>https://devzone.nordicsemi.com/thread/181445?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2019 05:21:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7eba5d1-1496-4263-acbd-da6455a39e61</guid><dc:creator>Jimmy Wong</dc:creator><description>&lt;p&gt;The address is 0xea88a2c41a92 (if you are using the nRF52 as central).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central peripheral BLE address connection check</title><link>https://devzone.nordicsemi.com/thread/181442?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2019 05:03:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c38c4c8-ccd5-46eb-98e8-c758814e78e6</guid><dc:creator>yokokawa</dc:creator><description>&lt;pre class="tw-data-text tw-ta tw-text-small" dir="ltr"&gt;&lt;span lang="en"&gt;&amp;quot;P_connected-&amp;gt; peer_addr.addr&amp;quot;
I checked the value of, but I do not know what it represents.
【Reading result】
[0]: 0x92
[1]: 0x1a
[2]: 0xc4
[3]: 0xa2
[4]: 0x88
[5]: 0xea
Please tell me the judgment method.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="tw-data-text tw-ta tw-text-small" id="tw-target-text" dir="ltr"&gt;&lt;span lang="en"&gt;Is there a function to return connection status when BLE address is specified?&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="tw-data-text tw-ta tw-text-small" id="tw-target-text" dir="ltr"&gt;&lt;span lang="en"&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Central peripheral BLE address connection check</title><link>https://devzone.nordicsemi.com/thread/181435?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2019 02:56:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b8d84fa-8628-4d1a-9208-16897dc1f714</guid><dc:creator>Jimmy Wong</dc:creator><description>&lt;p&gt;hi,&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You get peer address at&amp;nbsp;&lt;/span&gt;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v4.0.2/group___b_l_e___g_a_p___e_n_u_m_e_r_a_t_i_o_n_s.html?cp=2_3_0_1_1_2_1_1_1_0#ggada486dd3c0cce897b23a887bed284fefaa0b4789724d202a13a5e7eab85c52957"&gt;&lt;code&gt;BLE_GAP_EVT_CONNECTED&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;event (see&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;ble_gap_evt_connected_t&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;structure).&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;or&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;You can use the scan module if you are using the SDK 15.3. (it has the scan module).&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/jimmywong2003/nrf5-ble-multiple-role-example/blob/master/ble_app_lbs_nus_its_multi-role/main.c"&gt;https://github.com/jimmywong2003/nrf5-ble-multiple-role-example/blob/master/ble_app_lbs_nus_its_multi-role/main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Function for handling Scaning events.
 *
 * @param[in]   p_scan_evt   Scanning event.
 */
static void scan_evt_handler(scan_evt_t const * p_scan_evt)
{
        ret_code_t err_code;

        switch(p_scan_evt-&amp;gt;scan_evt_id)
        {
        case NRF_BLE_SCAN_EVT_CONNECTING_ERROR:
                err_code = p_scan_evt-&amp;gt;params.connecting_err.err_code;
                APP_ERROR_CHECK(err_code);
                break;

        case NRF_BLE_SCAN_EVT_CONNECTED:
        {
                ble_gap_evt_connected_t const * p_connected =
                        p_scan_evt-&amp;gt;params.connected.p_connected;
                // Scan is automatically stopped by the connection.
                NRF_LOG_INFO(&amp;quot;Connecting to target 0x%02x%02x%02x%02x%02x%02x&amp;quot;,
                             p_connected-&amp;gt;peer_addr.addr[0],
                             p_connected-&amp;gt;peer_addr.addr[1],
                             p_connected-&amp;gt;peer_addr.addr[2],
                             p_connected-&amp;gt;peer_addr.addr[3],
                             p_connected-&amp;gt;peer_addr.addr[4],
                             p_connected-&amp;gt;peer_addr.addr[5]
                             );
        } break;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>