<?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>Static / programmable whitelist</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/30432/static-programmable-whitelist</link><description>Hi, 
 
 Is it possible to add a static bluetooth address to the whitelist? 
 
 I am using SDK 14.2.0, device is nrf52832 + peer manager. 
 
 BR 
 bjarke</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 26 Aug 2019 22:36:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/30432/static-programmable-whitelist" /><item><title>RE: Static / programmable whitelist</title><link>https://devzone.nordicsemi.com/thread/206201?ContentTypeID=1</link><pubDate>Mon, 26 Aug 2019 22:36:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c39a036-c05d-4426-855a-a537a71081b5</guid><dc:creator>Kraig</dc:creator><description>&lt;p&gt;Figured I would add my thoughts for anyone looking to do the same and came across this.&amp;nbsp; I believe tesc&amp;#39;s (Terje) answer is correct.&amp;nbsp; The reason it didn&amp;#39;t work here is because the BLE address looks to be from a Samsung tablet, according to the comment.&amp;nbsp; Smartphones, tablets, ... do not use their static address.&amp;nbsp; Instead they use an IRK (Identity Resolving Key).&amp;nbsp; This is why there was no error code setting the whitelist yet it would not connect.&amp;nbsp; The IRK isn&amp;#39;t easy to get, and generally it looks like they discourage you from doing this.&amp;nbsp; I have come across posts in the past saying it is possible though ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Static / programmable whitelist</title><link>https://devzone.nordicsemi.com/thread/129153?ContentTypeID=1</link><pubDate>Fri, 20 Apr 2018 12:58:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:991fd263-feee-4aa5-9bfa-b4ea27097217</guid><dc:creator>Comodo</dc:creator><description>&lt;p&gt;Hi I am also trying to the same but I dont get it run with static address. It would be nice to have a solution for that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Static / programmable whitelist</title><link>https://devzone.nordicsemi.com/thread/128426?ContentTypeID=1</link><pubDate>Mon, 16 Apr 2018 10:38:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36eca11d-fb12-477c-b35a-1ad90ac92a1b</guid><dc:creator>Bjarke</dc:creator><description>&lt;p&gt;How is the progress?&lt;/p&gt;
&lt;p&gt;It have been a month now...&lt;/p&gt;
&lt;p&gt;BR&lt;/p&gt;
&lt;p&gt;bjarke&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Static / programmable whitelist</title><link>https://devzone.nordicsemi.com/thread/124772?ContentTypeID=1</link><pubDate>Fri, 16 Mar 2018 12:58:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17d4117a-e86d-4975-b255-7720acf8d733</guid><dc:creator>Bjarke</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Ok thanks. I will be waiting.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Br&lt;/p&gt;
&lt;p&gt;Bjarke&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Static / programmable whitelist</title><link>https://devzone.nordicsemi.com/thread/124240?ContentTypeID=1</link><pubDate>Tue, 13 Mar 2018 19:25:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48a98979-9224-4a71-b000-fba7228309c2</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am very sorry for not getting back to you previously. I was out-of-office for some time lately.&lt;/p&gt;
&lt;p&gt;Sadly it looks like Peer Manager is not designed to work together with a custom whitelist. From &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v14.2.0%2Flib_pm_functionality.html&amp;amp;anchor=lib_pm_functionality_whitelist"&gt;Peer Manager documentation&lt;/a&gt;: &amp;quot;Note that if you include the Peer Manager in an application and want to use whitelisting, the whitelist must be created by the Peer Manager.&amp;quot; I will do some investigation into what is possible, and see if the whitelist functionality within Peer Manager can be altered or disabled, or if there is some way to get Peer Manager to accept a non-peer address for the whitelist. I should have a clear answer within a couple of days, and hopefully a working example.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Static / programmable whitelist</title><link>https://devzone.nordicsemi.com/thread/121632?ContentTypeID=1</link><pubDate>Thu, 22 Feb 2018 09:33:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e36eaa3-f1e1-413e-bcac-875d8f07e3b6</guid><dc:creator>Bjarke</dc:creator><description>&lt;p&gt;Hi Terje,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t get it to work with SDK 14 and softdevice 5. It seems that whitelist depends on peer manager and the creation of a peer ID. But I cant get a static address set and whitelisted.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Bjarke&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Static / programmable whitelist</title><link>https://devzone.nordicsemi.com/thread/120967?ContentTypeID=1</link><pubDate>Thu, 15 Feb 2018 12:06:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43c8fd2a-a00d-4f47-89cb-f4f0cac75643</guid><dc:creator>Bjarke</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have been looking at ble_advertising.c, and can see that for Softdevice &amp;gt;2, the adresses are not used in the ble_advertising_whitelist_reply(...&lt;/p&gt;
&lt;p&gt;from ble_advertising.c:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint32_t ble_advertising_whitelist_reply(ble_advertising_t * const p_advertising,
                                         ble_gap_addr_t    const * p_gap_addrs,
                                         uint32_t               addr_cnt,
                                         ble_gap_irk_t  const * p_gap_irks,
                                         uint32_t               irk_cnt)
{
    if (!p_advertising-&amp;gt;whitelist_reply_expected)
    {
        return NRF_ERROR_INVALID_STATE;
    }

    p_advertising-&amp;gt;whitelist_reply_expected = false;

    #if (NRF_SD_BLE_API_VERSION &amp;lt;= 2)

        p_advertising-&amp;gt;whitelist.addr_count = addr_cnt;
        p_advertising-&amp;gt;whitelist.irk_count  = irk_cnt;

        for (uint32_t i = 0; i &amp;lt; addr_cnt; i++)
        {
            *p_advertising-&amp;gt;whitelist.pp_addrs[i] = p_gap_addrs[i];
        }

        for (uint32_t i = 0; i &amp;lt; irk_cnt; i++)
        {
            *p_advertising-&amp;gt;whitelist.pp_irks[i] = p_gap_irks[i];
        }

    #else

        p_advertising-&amp;gt;whitelist_in_use = ((addr_cnt &amp;gt; 0) || (irk_cnt &amp;gt; 0));

    #endif

    return NRF_SUCCESS;
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Any ideas?&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Static / programmable whitelist</title><link>https://devzone.nordicsemi.com/thread/120946?ContentTypeID=1</link><pubDate>Thu, 15 Feb 2018 10:06:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:157d6988-c9ff-4a40-bf65-b8192bdf69b8</guid><dc:creator>Bjarke</dc:creator><description>&lt;p&gt;Hi again,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Look at similar problem&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/18463/setting-up-whitelist-in-sdk-v12-2-0"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/18463/setting-up-whitelist-in-sdk-v12-2-0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I tried to reproduce...&lt;/p&gt;
&lt;p&gt;If I use&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;ble_gap_addr_t whitelist_addr = {1, BLE_GAP_ADDR_TYPE_PUBLIC, {0x8d,0xaa,0xa4,0x2d,0x65,0x94}};
const ble_gap_addr_t      *p_whitelist_addr[] = {&amp;amp;whitelist_addr};
err_code = sd_ble_gap_whitelist_set(p_whitelist_addr, 1);

APP_ERROR_CHECK(err_code);
err_code = ble_advertising_whitelist_reply(&amp;amp;m_advertising,
								p_whitelist_addr[0],
								1,
								NULL,
								0);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I do get fast advertising with whitelist, but somehow the address?(I suppose) is wrong, cause I cannot connect.&lt;/p&gt;
&lt;p&gt;Changing p_whitelist_addr[0] to NULL does not do anything.&lt;/p&gt;
&lt;p&gt;BR&lt;/p&gt;
&lt;p&gt;bjarke&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Static / programmable whitelist</title><link>https://devzone.nordicsemi.com/thread/120934?ContentTypeID=1</link><pubDate>Thu, 15 Feb 2018 08:30:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:133b531c-95b9-4b6b-8985-883e4af02762</guid><dc:creator>Bjarke</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have tried to send a static address using the&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v14.2.0%2Fgroup__ble__advertising.html&amp;amp;anchor=ga4c1be1a7b547102c4147e524e6c80925"&gt;ble_advertising_whitelist_reply()&lt;/a&gt;, However I can&amp;#39;t get it to work.&lt;/p&gt;
&lt;p&gt;Setting up static addr:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;ble_gap_addr_t public_device[1] = {{
    .addr_type = BLE_GAP_ADDR_TYPE_PUBLIC,
    .addr = {0x8d, 0xaa, 0xa4, 0x2d, 0x65, 0x94}, // samsung tablet
}};

ble_gap_addr_t const * whitelist_addrs = &amp;amp;public_device;

irk_cnt = 0;
addr_cnt = 1;

err_code = ble_advertising_whitelist_reply(&amp;amp;m_advertising,
    &amp;amp;whitelist_addrs,
    addr_cnt,
    whitelist_irks,
    irk_cnt);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;err_code return is 0&lt;/p&gt;
&lt;p&gt;However advertising never starts.&lt;/p&gt;
&lt;p&gt;If I replace the static addr with the&amp;nbsp;pm_whitelist_get(whitelist_addr, &amp;amp;addr_cnt, whitelist_irks,&amp;nbsp; &amp;amp;irk_cnt); it works.&lt;/p&gt;
&lt;p&gt;Is there a connection between whitelist, advertising and peer manager behind the scene?&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Bjarke&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Static / programmable whitelist</title><link>https://devzone.nordicsemi.com/thread/120897?ContentTypeID=1</link><pubDate>Wed, 14 Feb 2018 17:54:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:986f5e74-512f-4ed3-9670-9a58630020cd</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Whitelist can be used both by peripheral (to filter which centrals can connect) and by central (to filter what peripherals to connect to.) I assume that you need this for a peripheral.&lt;/p&gt;
&lt;p&gt;If you use the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v16.0.0%2Flib_ble_advertising.html&amp;amp;cp=5_1_3_2_1"&gt;Advertising Module&lt;/a&gt; then it is your responsibility to provide a whitelist on the BLE_ADV_EVT_WHITELIST_REQUEST event.&lt;/p&gt;
&lt;p&gt;You may then choose to fetch a whitelist from peer manager using &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v16.0.0%2Flib_pm_usage.html&amp;amp;cp=5_1_3_2_7_2_4&amp;amp;anchor=lib_pm_usage_whitelist"&gt;pm_whitelist_get()&lt;/a&gt;, as is done for instance in the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v16.0.0%2Fble_sdk_app_hids_mouse.html&amp;amp;cp=5_1_4_2_2_16"&gt;HID Mouse Application example&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Or, in your case, you may make a whitelist manually using any Bluetooth addresses that you would like. The whitelist is an array of &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v7.0.1%2Fstructble__gap__addr__t.html&amp;amp;cp=3_5_2_1_2_1_6_3"&gt;ble_gap_addr_t&lt;/a&gt; structures and an array of ble_gap_irk_t structures. (The IRK structure is only needed for resolvable addresses, not for static ones.)&lt;/p&gt;
&lt;p&gt;In any case you must reply to the whitelist request event with a call to &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v14.2.0%2Fgroup__ble__advertising.html&amp;amp;anchor=ga4c1be1a7b547102c4147e524e6c80925"&gt;ble_advertising_whitelist_reply()&lt;/a&gt;, where you provide the whitelist.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>