<?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>In Multi-Link Central Example, Where can I check the disconnect code?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79116/in-multi-link-central-example-where-can-i-check-the-disconnect-code</link><description>Hello, all. 
 
 I&amp;#39;m using nRF52833, pca10100. 
 What I&amp;#39;m trying to do is just manually disconnect. 
 So, I referred to the Multi-link Central example. Multi-link Central is that pressing BUTTON1 on the central, all connected peripherals are disconnected</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 01 Sep 2021 08:01:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79116/in-multi-link-central-example-where-can-i-check-the-disconnect-code" /><item><title>RE: In Multi-Link Central Example, Where can I check the disconnect code?</title><link>https://devzone.nordicsemi.com/thread/327536?ContentTypeID=1</link><pubDate>Wed, 01 Sep 2021 08:01:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61bab274-d65c-4e60-9394-4bdc76f57afe</guid><dc:creator>lyrics</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/79116/in-multi-link-central-example-where-can-i-check-the-disconnect-code/327532#327532"]The Multilink central does not use BSP for buttons (only LEDs),[/quote]
&lt;p&gt;Oh, I didn&amp;#39;t check this. I understand this. Thank you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/79116/in-multi-link-central-example-where-can-i-check-the-disconnect-code/327532#327532"]. In that handling, call&amp;nbsp;&lt;span&gt;sd_ble_gap_disconnect() for each active connection.&lt;/span&gt;[/quote]
&lt;p&gt;&lt;span&gt;It&amp;#39;s important to get the connection handle data.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thank you. :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: In Multi-Link Central Example, Where can I check the disconnect code?</title><link>https://devzone.nordicsemi.com/thread/327532?ContentTypeID=1</link><pubDate>Wed, 01 Sep 2021 07:43:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d13ef45a-fafd-4121-9c2a-506043bc6ab1</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Lyrics,&lt;/p&gt;
&lt;p&gt;The Multilink central does not use BSP for buttons (only LEDs), so you there is no way to&amp;nbsp;use the&amp;nbsp;BSP_EVENT_DISCONNECT event to trigger disconnect without more changes to the example. I kept that to provide context. The only thing you need to disconnect is to call&amp;nbsp;sd_ble_gap_disconnect() for each connection handle you want to disconnect from.&lt;/p&gt;
&lt;p&gt;If you want to do this with a button press and with minimal changes to the multilink central example you could for instance configure an additional button in&amp;nbsp;buttons_init, adding a second line in the buttons array. That could still use the same&amp;nbsp;button_event_handler, and then you add a case for the new button in that handler. In that handling, call&amp;nbsp;&lt;span&gt;sd_ble_gap_disconnect() for each active connection.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: In Multi-Link Central Example, Where can I check the disconnect code?</title><link>https://devzone.nordicsemi.com/thread/327496?ContentTypeID=1</link><pubDate>Wed, 01 Sep 2021 00:54:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:742153a7-7fd0-46cd-a1b2-8894623833cf</guid><dc:creator>lyrics</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/79116/in-multi-link-central-example-where-can-i-check-the-disconnect-code/327381#327381"]which has this code snippet to trigger disconnect by a button press on the DK:[/quote]
&lt;p&gt;As you explain,&amp;nbsp;in the example of ble_app_gatts, I understood that pressing the button trigger &amp;#39;BSP_EVENT_DISCONNECT&amp;#39; case.&lt;/p&gt;
&lt;p&gt;However, the multi-link central example also sets the BSP_EVENT_DISCONNECT setting in bsp_btn_ble.c, but I can&amp;#39;t find where that BSP_EVENT_DISCONNECT case is.&lt;/p&gt;
&lt;p&gt;(this is BSP_EVENT_DISCONNECT setting code that I found.)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static uint32_t connection_buttons_configure()
{
    uint32_t err_code;

    err_code = bsp_event_to_button_action_assign(BTN_ID_SLEEP,
                                                 BTN_ACTION_SLEEP,
                                                 BSP_EVENT_DEFAULT);
    RETURN_ON_ERROR_NOT_INVALID_PARAM(err_code);

    err_code = bsp_event_to_button_action_assign(BTN_ID_WHITELIST_OFF,
                                                 BTN_ACTION_WHITELIST_OFF,
                                                 BSP_EVENT_WHITELIST_OFF);
    RETURN_ON_ERROR_NOT_INVALID_PARAM(err_code);


    err_code = bsp_event_to_button_action_assign(BTN_ID_DISCONNECT,
                                                 BTN_ACTION_DISCONNECT,
                                                 BSP_EVENT_DISCONNECT);
    RETURN_ON_ERROR_NOT_INVALID_PARAM(err_code);

    return NRF_SUCCESS;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In other words, I don&amp;#39;t understand about is how DISCONNECT interrupt is called in multi-link central sample and I cannot find where code can be checked.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;lyrics&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: In Multi-Link Central Example, Where can I check the disconnect code?</title><link>https://devzone.nordicsemi.com/thread/327381?ContentTypeID=1</link><pubDate>Tue, 31 Aug 2021 10:32:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d7cc556-2f5f-4b9e-8f72-bec246ba6813</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You disconnect by calling &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.2.0/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html?cp=4_7_3_2_2_1_3_20#ga4031d0e4034c6f5900ad6d35b763fb0d"&gt;sd_ble_gap_disconnect()&lt;/a&gt;. This takes two parameters, the connection handle and the disconnect reason. The method here is example the same regardless of if the role is central or peripheral.&lt;/p&gt;
&lt;p&gt;You can see an example of this in for instance the ble_app_gatts example, which has this code snippet to trigger disconnect by a button press on the DK:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        case BSP_EVENT_DISCONNECT:
            err_code = sd_ble_gap_disconnect(m_conn_handle,
                                             BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
            if (err_code != NRF_ERROR_INVALID_STATE)
            {
                APP_ERROR_CHECK(err_code);
            }
            break;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>