<?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>connect timeout</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34011/connect-timeout</link><description>Hi,All, 
 I am using nrf52832 as a slave, the SDK version is 12.3. I set the connection timeout to 10s as follows 
 #define CONN_SUP_TIMEOUT MSEC_TO_UNITS(1000, UNIT_10_MS) 
 I think that CONN_SUP_TIMEOUT is no data sent after 10s connection, then enter</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 May 2018 08:04:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34011/connect-timeout" /><item><title>RE: connect timeout</title><link>https://devzone.nordicsemi.com/thread/130943?ContentTypeID=1</link><pubDate>Fri, 04 May 2018 08:04:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8b9a222-c346-464a-96fe-4326e9f0f7bd</guid><dc:creator>amywei</dc:creator><description>&lt;p&gt;Hi,Sigurd&lt;/p&gt;
&lt;p&gt;Thanks for your answer, I think I can solve my problem now&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: connect timeout</title><link>https://devzone.nordicsemi.com/thread/130940?ContentTypeID=1</link><pubDate>Fri, 04 May 2018 07:58:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbac3cd0-afee-48f9-90d0-68f906c25e3f</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote userid="69821" url="~/f/nordic-q-a/34011/connect-timeout/130904"]If there is always an empty data packet interaction, will Bluetooth have a connection timeout?[/quote]
&lt;p&gt;No, in that case you will not timeout.&amp;nbsp;&lt;/p&gt;
[quote userid="69821" url="~/f/nordic-q-a/34011/connect-timeout/130904"]BLE_HCI_CONNECTION_TIMEOUT is a error code，not&amp;nbsp; event ，how can i use it?[/quote]
&lt;p&gt;&lt;span&gt;In the event structure for BLE_GAP_EVT_DISCONNECTED, you will find the reason for the disconnect. See &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/structble__gap__evt__disconnected__t.html?cp=2_3_1_1_3_2_1_4_20"&gt;this page&lt;/a&gt;. If the disconnect happend because of a connection timeout, the disconnct reason will be&amp;nbsp;BLE_HCI_CONNECTION_TIMEOUT.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Snippet:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void on_ble_evt(ble_evt_t * p_ble_evt)
{
    uint32_t err_code;
    uint8_t disconnect_reason;

    switch (p_ble_evt-&amp;gt;header.evt_id)
    {

        case BLE_GAP_EVT_DISCONNECTED:
            disconnect_reason = p_ble_evt-&amp;gt;evt.gap_evt.params.disconnected.reason;
            if(disconnect_reason  == BLE_HCI_CONNECTION_TIMEOUT)
            {
                //disconnect_reason is BLE_HCI_CONNECTION_TIMEOUT
            }
            err_code = bsp_indication_set(BSP_INDICATE_IDLE);
            APP_ERROR_CHECK(err_code);
            m_conn_handle = BLE_CONN_HANDLE_INVALID;
            break; // BLE_GAP_EVT_DISCONNECTED&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: connect timeout</title><link>https://devzone.nordicsemi.com/thread/130904?ContentTypeID=1</link><pubDate>Fri, 04 May 2018 01:44:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad506819-dc45-440a-a4ea-50030caa2ef9</guid><dc:creator>amywei</dc:creator><description>&lt;p&gt;&lt;strong&gt;Thanks&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;My&amp;nbsp;BLE peripheral is in a connection with a central.&amp;nbsp; In order to keep the connection, Bluetooth will send empty data packets to&amp;nbsp;keep&amp;nbsp;connection when there is no valid data interaction. If there is always an empty data packet interaction, will Bluetooth have a connection timeout?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;BLE_HCI_CONNECTION_TIMEOUT is a error code，not&amp;nbsp; event ，how can i use it?&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: connect timeout</title><link>https://devzone.nordicsemi.com/thread/130784?ContentTypeID=1</link><pubDate>Thu, 03 May 2018 10:54:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c36d23a9-bdd2-481a-a26a-8c41aa45b984</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If your BLE peripheral is in a connection with a central, and the central stops responding for so long that the supervision timeout triggers, you will get the event &lt;strong&gt;BLE_GAP_EVT_DISCONNECTED&lt;/strong&gt; with reason &lt;strong&gt;BLE_HCI_CONNECTION_TIMEOUT&lt;/strong&gt; (0x08). You will not get the event BLE_GAP_EVT_TIMEOUT.&lt;/p&gt;
&lt;p&gt;If you are using the advertising module in the SDK, ble_advertising.c, the default behavior is to start advertising again after a disconnect. This happens in the function on_disconnected(). If you start advertising again, this will typically consume 30&amp;micro;A+ (depending on advertising interval)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>