<?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>Allowing connections, then switching to connection-less.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/33932/allowing-connections-then-switching-to-connection-less</link><description>I need to allow BLE connections for a period of time after restart, then prevent connections (unless a button is pressed). Is this functionality as simple as re-configuring the advertising parameters to use ( BLE_GAP_ADV_TYPE_ADV_NONCONN_IND ). 
 Also</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 02 May 2018 13:45:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/33932/allowing-connections-then-switching-to-connection-less" /><item><title>RE: Allowing connections, then switching to connection-less.</title><link>https://devzone.nordicsemi.com/thread/130600?ContentTypeID=1</link><pubDate>Wed, 02 May 2018 13:45:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9f83b91-39ff-4c64-bddf-d534a48ca40a</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Yes, but what it looks like depends on what SDK you use.&lt;/p&gt;
&lt;p&gt;If you look at the beacon example in&amp;nbsp;SDK 15 for example, it is configured like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void advertising_init(void)
{
    ....

    // Initialize advertising parameters (used when starting advertising).
    memset(&amp;amp;m_adv_params, 0, sizeof(m_adv_params));

    m_adv_params.properties.type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED;
    m_adv_params.p_peer_addr     = NULL;    // Undirected advertisement.
    m_adv_params.filter_policy   = BLE_GAP_ADV_FP_ANY;
    m_adv_params.interval        = NON_CONNECTABLE_ADV_INTERVAL;
    m_adv_params.duration        = 0;       // Never time out.

    err_code = ble_advdata_encode(&amp;amp;advdata, m_adv_data.adv_data.p_data, &amp;amp;m_adv_data.adv_data.len);
    APP_ERROR_CHECK(err_code);

    err_code = sd_ble_gap_adv_set_configure(&amp;amp;m_adv_handle, &amp;amp;m_adv_data, &amp;amp;m_adv_params);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can see that in SDK 15 BLE_GAP_ADV_TYPE_ADV_SCAN_IND has been renamed to&amp;nbsp;BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Allowing connections, then switching to connection-less.</title><link>https://devzone.nordicsemi.com/thread/130537?ContentTypeID=1</link><pubDate>Wed, 02 May 2018 12:27:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74173f88-d1e0-496b-b1e3-7472500b11c3</guid><dc:creator>jmag999</dc:creator><description>&lt;p&gt;Thanks.&amp;nbsp; Is there an API to configure the type.&amp;nbsp; I didn&amp;#39;t see one.&amp;nbsp; If not, what is the best way to configure this so that I can switch between types?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Allowing connections, then switching to connection-less.</title><link>https://devzone.nordicsemi.com/thread/130531?ContentTypeID=1</link><pubDate>Wed, 02 May 2018 12:18:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e69f349b-d14b-4da2-a599-57a189ab1c32</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;To allow a scanner (central) to&amp;nbsp;read your scan response, but not connect, you should use&amp;nbsp;BLE_GAP_ADV_TYPE_ADV_SCAN_IND. I agree that the documentation of these defines are sparse, but if you search for&amp;nbsp;ADV_SCAN_IND in the Bluetooth Core specification you will find the information you need.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you use&amp;nbsp;ADV_NONCONN_IND the scanner will neither be able to read your scan response nor connect.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>