<?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 disconnect</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14576/ble-disconnect</link><description>I&amp;#39;m observing frequent Bluetooth disconnection on my custom board which has nRF51822 SoC.
So far, I haven&amp;#39;t been able to figure out the root cause. In order to narrow down the issue,
I&amp;#39;m using the ble_app_template example from the SDK, with very litle</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Feb 2018 14:09:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14576/ble-disconnect" /><item><title>RE: BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/119965?ContentTypeID=1</link><pubDate>Tue, 06 Feb 2018 14:09:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7b9121c-bbde-4e5c-888e-ca945a79f7d9</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;This should have been posted as a new question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/55655?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 22:16:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab1166d3-9c8b-45d3-89c6-a868ac6a45d1</guid><dc:creator>pranavsk1994</dc:creator><description>&lt;p&gt;Hi @sidekick, I had a similar kind of doubt regarding the connection interval time for BLE Nordic UART Service on nrf52840 microcontroller with softdevice s140. I want to know after connecting with a nordic mobile app, can the connection remain idle for longer time.
If I keep the connection idle it disconnects after certain time
The solution you mentioned of replacing &amp;quot;sd_ble_gap_disconnect&amp;quot; with  &amp;quot;sd_ble_gap_ppcp_set&amp;quot; in connection parameter event handler, so &amp;quot;sd_ble_gap_ppcp_set&amp;quot;  accepts connection parameters as input do I need to initialize the gap connection parameters in event handler again?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/55654?ContentTypeID=1</link><pubDate>Mon, 04 Jul 2016 09:04:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c868d12-5ba6-41fe-8e62-3c5245c67e4b</guid><dc:creator>sidekick</dc:creator><description>&lt;p&gt;@Kristin: Thank you. The above method worked on Android, however later, while testing with an iOS based device, found that newer version of iOS (v9.3.2) exhibit Bluetooth spec. violation and had to resort to method described &lt;a href="https://devzone.nordicsemi.com/question/22058/disconnect-reason-hci-error-code-0x2aupdated/?comment=85271#comment-85271"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/55653?ContentTypeID=1</link><pubDate>Wed, 22 Jun 2016 10:51:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ffc2b9e-22e3-4142-93eb-26c6232e5800</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;What you describe should work fine as long as it is fine for your device to accept any connection interval set by the central. However, I would recommend to have some parameter validation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/55652?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 14:41:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0836c8c-154f-408c-b397-b84b600a68e0</guid><dc:creator>sidekick</dc:creator><description>&lt;p&gt;@Kristin: Thank you. I followed your suggestion and found that there were multiple problems.
&lt;strong&gt;1:&lt;/strong&gt; I was not properly handling &lt;code&gt;BLE_GAP_EVT_CONN_PARAM_UPDATE&lt;/code&gt; event coming from the central (on_ble_event) and &lt;strong&gt;2:&lt;/strong&gt; there were some explicit call to &lt;code&gt;sd_ble_gap_disconnect()&lt;/code&gt;, which I&amp;#39;ve commented out at the moment. A call to &lt;code&gt;ble_conn_param_init(&amp;amp;cp_init)&lt;/code&gt; creates a connection parameter update timer and associates a handler &lt;code&gt;update_timeout_handler&lt;/code&gt; with it. It is called &lt;code&gt;MAX_CONN_PARAMS_UPDATE_COUNT&lt;/code&gt; number of times if the parameters are not okay with the central and if the central rejects all of those requests from peripheral, the event handler &lt;code&gt;on_conn_params_evt&lt;/code&gt; associated with the connection parameter gets invoked, where I was calling &lt;code&gt;sd_ble_gap_disconnect&lt;/code&gt;. Now instead of calling &lt;code&gt;sd_ble_gap_disconnect&lt;/code&gt;, I accept central&amp;#39;s connection parameter by calling&lt;code&gt;sd_ble_gap_ppcp_set&lt;/code&gt; in the connection parameter event handler. I know, I should also do some parameter validation, before accepting the values, but is this an okay approach ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/55651?ContentTypeID=1</link><pubDate>Mon, 20 Jun 2016 10:42:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e5f2570-ff8f-4c8a-b456-8e9ccbef1fcd</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;I would recommend you to do the following:&lt;/p&gt;
&lt;p&gt;Set a breakpoint on all sd_ble_gap_disconnect() calls in your application. When your peripheral device wants to disconnect, it will then stop there. From there, you can start &amp;quot;going backwards&amp;quot; and try to track down the root cause for the disconnect.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>