<?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 advertising) nRF automatically connect to my phone and prevent it from other device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85510/ble-advertising-nrf-automatically-connect-to-my-phone-and-prevent-it-from-other-device</link><description>Hi, I&amp;#39;m build an application that my nRF advertising and my phone (I can call it is phone A), and my friend&amp;#39;s phone (phone B) 1. phone A and phone B can connect automaticially to nRF when nRF start advertising and phone A and B turn on Bluetooth. 
 2</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 07 Mar 2022 14:30:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85510/ble-advertising-nrf-automatically-connect-to-my-phone-and-prevent-it-from-other-device" /><item><title>RE: (BLE advertising) nRF automatically connect to my phone and prevent it from other device</title><link>https://devzone.nordicsemi.com/thread/356659?ContentTypeID=1</link><pubDate>Mon, 07 Mar 2022 14:30:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:185caa6d-51d0-4b37-b35d-1df7d4e7b7db</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Tam,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The most common way of adding such feature as you described is to use a whitelist.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When a device advertises in whitelist, it won&amp;#39;t allow the connect request from the centrals that are outside of the whitelist.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So in your case if A and B is in the whitelist but not C and D then it would work exactly as you described.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Some of our examples (e.g ble_app_ancs_c, mouse, keyboard etc ) supporta whitelist by default. A device is automatically added to whitelist after it&amp;#39;s bonded.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, the difference here is that we defined a button (BSP_EVENT_WHITELIST_OFF) to turn off the whitelist. So if you want to add a new device to the whitelist, you need to press the button to allow &amp;quot;normal&amp;quot; advertising. This will make it possible for C and D to connect and join the whitelist.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;We currently don&amp;#39;t have the code to allow adding C and D via A and B. You would need to make your own mechanism to send the data about C and D from A/B down to the node and update the whitelist. The advertising module has an event that request the application to provide the whitelist , have a look &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_ble_advertising.html?cp=8_1_3_2_1_2#interaction"&gt;here&lt;/a&gt;&amp;nbsp;and please refer to the examples I mentioned above.&amp;nbsp;&lt;br /&gt;Your task is to find a way to send either address of C/D or their IRK to the node to update to the whitelist.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>