<?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>advertisment directed/discoverable</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12425/advertisment-directed-discoverable</link><description>Two questions about advertisement (i&amp;#39;m reading ble_advertising.c code) 
 
 
 I failed to see what is making transition from BLE_ADV_MODE_DIRECTED to BLE_ADV_MODE_DIRECTED_SLOW as adv_params.timeout is set to 0 (for BLE_ADV_MODE_DIRECTED) and transition</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Mar 2016 09:25:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12425/advertisment-directed-discoverable" /><item><title>RE: advertisment directed/discoverable</title><link>https://devzone.nordicsemi.com/thread/47026?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2016 09:25:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8296bb2f-a41c-4207-9b29-bff64ce542be</guid><dc:creator>H&amp;#229;vard</dc:creator><description>&lt;p&gt;Thanks Stephane D&amp;#39;Alu and Kristin. A fix was added for the upcoming SDK release.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: advertisment directed/discoverable</title><link>https://devzone.nordicsemi.com/thread/47025?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2016 12:52:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f32c5cfa-c8a4-4e3c-8f25-d3fd74e7db37</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;&lt;strong&gt;Directed advertising&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For directed advertising with high duty cycle the timeout is 1.28 s.&lt;/p&gt;
&lt;p&gt;For directed advertising with high duty cycle, the min/max advertising interval settings are being ignored:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;For high duty cycle directed advertising, i.e. when Advertising_Type is 0x01
(ADV_DIRECT_IND, high duty cycle), the Advertising_Interval_Min and
Advertising_Interval_Max parameters are not used and shall be ignored.&amp;quot;&lt;/em&gt; (Bluetooth Core Specification, Vol 2, Part E, chapter 7.8.5)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Bluetooth Core Specification, Vol 6, Part B, chapter 4.4.2.4 says the following about high and low duty cycle directed advertising:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Connectable &lt;strong&gt;low duty cycle directed advertising&lt;/strong&gt; is designed
for cases where reconnection with a specific device is required, but time is not
of the essence or it is not known if the central device is in range or not. &lt;strong&gt;High
duty cycle directed advertising&lt;/strong&gt; is designed for cases in which fast Link Layer
connection setup is essential (for example, a reconnection). Note that high duty
cycle directed advertising is a power and bandwidth intensive advertising
scheme that should only be used when fast connection setup is required.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Advertising flags&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Advertising with whitelist: According to the Bluetooth Core Specification, only the flag BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED should be set when advertising with whitelist.&lt;/p&gt;
&lt;p&gt;The flags BLE_GAP_ADV_FLAG_LE_LIMITED_DISC_MODE and BLE_GAP_ADV_FLAG_LE_GENERAL_DISC_MODE should only be used when the advertising device will accept connection request from any device::&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The Host shall set the advertising filter policy to ‘process scan and
connection requests from all devices’.&lt;/em&gt; (Bluetooth Core Specification Vol 3, Part C, chapter 9.4.2 and 9.4.3 )&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I think it is a bug in the advertising module that the advertising flag is not set back to the &amp;quot;normal&amp;quot; one (BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE or BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE) when disabling whitelist.
From what I can see in the code, the flag should be &amp;quot;re-set&amp;quot; in ble_advertising_start(..)  (not tested):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t ble_advertising_start(ble_adv_mode_t advertising_mode)
{
...
...
// Set advertising parameters and events according to selected advertising mode.
    switch (m_adv_mode_current)
    {
...
 case BLE_ADV_MODE_FAST:
            adv_params.timeout  = m_adv_modes_config.ble_adv_fast_timeout;
            adv_params.interval = m_adv_modes_config.ble_adv_fast_interval;

            if (   whitelist_has_entries(&amp;amp;m_whitelist)
                &amp;amp;&amp;amp; m_adv_modes_config.ble_adv_whitelist_enabled
                &amp;amp;&amp;amp; !m_whitelist_temporarily_disabled)
            {
                adv_params.fp          = BLE_GAP_ADV_FP_FILTER_CONNREQ;
                adv_params.p_whitelist = &amp;amp;m_whitelist;
                m_advdata.flags        = BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED;
                err_code               = ble_advdata_set(&amp;amp;m_advdata, NULL);
                if(err_code != NRF_SUCCESS)
                {
                    return err_code;
                }

                m_adv_evt = BLE_ADV_EVT_FAST_WHITELIST;
                LOG(&amp;quot;[ADV]: Starting fast advertisement with whitelist.\r\n&amp;quot;);
            }
            else
            {
                m_adv_evt = BLE_ADV_EVT_FAST;
                 // Add advertising flag here.
                LOG(&amp;quot;[ADV]: Starting fast advertisement.\r\n&amp;quot;);
            }
            break;

        case BLE_ADV_MODE_SLOW:
            adv_params.interval = m_adv_modes_config.ble_adv_slow_interval;
            adv_params.timeout  = m_adv_modes_config.ble_adv_slow_timeout;

            if (   whitelist_has_entries(&amp;amp;m_whitelist)
                &amp;amp;&amp;amp; m_adv_modes_config.ble_adv_whitelist_enabled
                &amp;amp;&amp;amp; !m_whitelist_temporarily_disabled)
            {
                adv_params.fp          = BLE_GAP_ADV_FP_FILTER_CONNREQ;
                adv_params.p_whitelist = &amp;amp;m_whitelist;
                m_advdata.flags        = BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED;
                err_code               = ble_advdata_set(&amp;amp;m_advdata, NULL);
                if(err_code != NRF_SUCCESS)
                {
                    return err_code;
                }

                m_adv_evt = BLE_ADV_EVT_SLOW_WHITELIST;
                LOG(&amp;quot;[ADV]: Starting slow advertisement with whitelist.\r\n&amp;quot;);
            }
            else
            {
                m_adv_evt = BLE_ADV_EVT_SLOW;
                // Add advertising flag here.
                LOG(&amp;quot;[ADV]: Starting slow advertisement.\r\n&amp;quot;);
            }
            break;
...
...
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>