<?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>BLE Peripheral does not connect back after BLE central disconnects the first time</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/36245/ble-peripheral-does-not-connect-back-after-ble-central-disconnects-the-first-time</link><description>Hello Everyone, 
 I am facing an issue when trying to connect back BLE central again after disconnecting it from the BLE peripheral once. 
 The issue is reproducible as follows: 
 1. Start BLE peripheral on nrf52 DK (SD v14.2) running ble_app_uart and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Jul 2018 03:27:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/36245/ble-peripheral-does-not-connect-back-after-ble-central-disconnects-the-first-time" /><item><title>RE: BLE Peripheral does not connect back after BLE central disconnects the first time</title><link>https://devzone.nordicsemi.com/thread/139806?ContentTypeID=1</link><pubDate>Thu, 12 Jul 2018 03:27:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20c974b3-d056-498c-b231-67205daefe93</guid><dc:creator>SK</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Problem solved.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Setting system attributes while it connects back resolved the issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for this thread --&amp;gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/3338/error-code-0x3401"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/3338/error-code-0x3401&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And the bible --&amp;gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial"&gt;https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Helped me understand more about the underlying workings of BLE &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Peripheral does not connect back after BLE central disconnects the first time</title><link>https://devzone.nordicsemi.com/thread/139804?ContentTypeID=1</link><pubDate>Thu, 12 Jul 2018 02:25:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c1f1ca4-4b71-4512-ad97-c5f6e61f6232</guid><dc:creator>SK</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Just an update here!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So while running the default BLE peripheral example, it runs perfectly fine. That is to say once i disconnect Central and try to connect again, peripheral and central connects.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Issue i am having is when i modify the BLE peripheral code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am using timer to make it go to sleep and once timer expires, it will send some random data to central. However, when i disconnect Central and then try to connect back again, it throws me with this &lt;strong&gt;error code: 0x3401.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Please see the code attached.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;//inside main
while(true)
{
    if(timerExpires &amp;amp;&amp;amp; bleConnected)
    {
        do
        {
            length=10;
            err_code = ble_nus_string_send(&amp;amp;m_nus, data, &amp;amp;length);
            if((err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp; (err_code != NRF_ERROR_BUSY))
            {
                APP_ERROR_CHECK(err_code);
                timerExpires = false;
            }
        }
        
    }
    else if(bleConnected &amp;amp;&amp;amp; !timerExpires)
    {
        //enter low power mode
    }
    else
    {
        //do nothing
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Error occurs when it tries to send data over BLE after re-connection.&lt;/p&gt;
&lt;p&gt;I followed this page to get to know more --&amp;gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/3338/error-code-0x3401"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/3338/error-code-0x3401&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But, while debugging, it never comes to&amp;nbsp;&lt;code&gt;BLE_GATTS_EVT_SYS_ATTR_MISSING event.&amp;nbsp;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Any suggestions on what could be the issue here?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Peripheral does not connect back after BLE central disconnects the first time</title><link>https://devzone.nordicsemi.com/thread/139653?ContentTypeID=1</link><pubDate>Wed, 11 Jul 2018 02:21:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41317334-15ab-4b4a-9e94-e7fce38f8d47</guid><dc:creator>SK</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Any ideas pertaining to this issue?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>