<?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>Having problems after initiate disconnect from slave side</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7087/having-problems-after-initiate-disconnect-from-slave-side</link><description>Hello 
 I&amp;#39;m using S110 with nRF51822. 
 I&amp;#39;m trying to implement some logic which is quite simple, but for some reason things are not working properly. 
 I&amp;#39;m advertising using the BLE slave device.
I initiate a connection from master device to the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 May 2015 15:14:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7087/having-problems-after-initiate-disconnect-from-slave-side" /><item><title>RE: Having problems after initiate disconnect from slave side</title><link>https://devzone.nordicsemi.com/thread/25040?ContentTypeID=1</link><pubDate>Mon, 18 May 2015 15:14:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9cf52f7-38f8-4b94-a467-45e6cdeea305</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;When you initiated your disconnect right after CONNECTED event, did you check for error returns? Seems to me that disconnect event did not go through successfully&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Having problems after initiate disconnect from slave side</title><link>https://devzone.nordicsemi.com/thread/25039?ContentTypeID=1</link><pubDate>Mon, 18 May 2015 14:46:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b6b2706-235a-4a3d-aacf-4988e4886262</guid><dc:creator>Kramer</dc:creator><description>&lt;p&gt;Hey shibshab&lt;/p&gt;
&lt;p&gt;The problem is that I initiate disconnect right after CONNECTED event, and I don&amp;#39;t get BLE_GAP_EVT_DISCONNECTED event after that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Having problems after initiate disconnect from slave side</title><link>https://devzone.nordicsemi.com/thread/25038?ContentTypeID=1</link><pubDate>Mon, 18 May 2015 05:22:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:582d367e-72f4-47b3-bf91-a94f4b2c79f7</guid><dc:creator>shibshab</dc:creator><description>&lt;p&gt;You are correct, you should be able to disconnect from the slave.&lt;/p&gt;
&lt;p&gt;You need to handle the &lt;code&gt;BLE_GAP_EVT_DISCONNECTED&lt;/code&gt; event in order for the slave to be able to function after performing the disconnect procedure. The reason is that the softdevice needs to know that it is in a valid state before advertising.&lt;/p&gt;
&lt;p&gt;Try adding this to your BLE  event handler:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void on_ble_evt(ble_evt_t * p_ble_evt)
{
    switch (p_ble_evt-&amp;gt;header.evt_id)
    {
        case BLE_GAP_EVT_DISCONNECTED:
        {
            m_conn_handle = BLE_CONN_HANDLE_INVALID;
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>