<?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>nRF5340 BLE Filter scan required(whitelist) dose not working...</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/99675/nrf5340-ble-filter-scan-required-whitelist-dose-not-working</link><description>Hi, This is Taron. 
 
 I&amp;#39;m trying to use whitelist with filter scan required mode in Advertising. 
 
 But it dose not working.. 
 
 *BT_LE_ADV_OPT_FILTER_CONN mode is working 
 
 I share attachment main.c and prj.conf file. 
 
 Please check it and give</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 18 May 2023 00:46:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/99675/nrf5340-ble-filter-scan-required-whitelist-dose-not-working" /><item><title>RE: nRF5340 BLE Filter scan required(whitelist) dose not working...</title><link>https://devzone.nordicsemi.com/thread/426105?ContentTypeID=1</link><pubDate>Thu, 18 May 2023 00:46:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c164143c-a735-416a-b74c-eda0cd05b00d</guid><dc:creator>Taron</dc:creator><description>&lt;p&gt;I solved it. thank you so much~&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 BLE Filter scan required(whitelist) dose not working...</title><link>https://devzone.nordicsemi.com/thread/426011?ContentTypeID=1</link><pubDate>Wed, 17 May 2023 00:16:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6722321e-1063-4694-bcfc-c6586a69ef14</guid><dc:creator>Taron</dc:creator><description>&lt;p&gt;Then how many address can i advertise with directed mode?&lt;/p&gt;
&lt;p&gt;all bonded address is possible?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 BLE Filter scan required(whitelist) dose not working...</title><link>https://devzone.nordicsemi.com/thread/425895?ContentTypeID=1</link><pubDate>Tue, 16 May 2023 13:54:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1aca5f74-e4e2-4b07-b16f-d0bec9f45404</guid><dc:creator>Einar Thorsrud</dc:creator><description>[quote user="Taron"]2. only bonded device can connect without scan[/quote]
&lt;p&gt;It is impossible to connect without scanning. In order to connect, the peripheral must advertise, and the central must scan. Then, it can connect aver receiving a advertising packet. This is how Bluetooth LE works. However, using filter accept list, only devices in the accept list (which in practice normally means bonded devices), will be allowed to connect.&lt;/p&gt;
[quote user="Taron"]when some device scan, it shouldn&amp;#39;t be found any information.[/quote]
&lt;p&gt;As mentioned before, this is only possible with directed advertising. But if the key is to not leak information to other bluetooth devices that are scanning, it would be better to simply not include information you don&amp;#39;t want other than the bonded peer(s) to know in the advertising packet. After all, a sniffer will be able to pick up all also directed advertising packets).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 BLE Filter scan required(whitelist) dose not working...</title><link>https://devzone.nordicsemi.com/thread/425786?ContentTypeID=1</link><pubDate>Tue, 16 May 2023 08:13:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b32cc2c3-c4c5-4eec-a5a7-4ad6cf35c95e</guid><dc:creator>Taron</dc:creator><description>&lt;p&gt;Yep, i applied this function.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and i checked BT_LE_ADV_OPT_DIR_ADDR_RPA mode.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;i want to make to like ble of car.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1. bonding central device&lt;/p&gt;
&lt;p&gt;-&amp;gt; i got the bonded device list with&amp;nbsp;&lt;span&gt;bt_foreach_bond()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;2. only bonded device can connect without scan, when some device scan, it shouldn&amp;#39;t be found any information.&lt;/p&gt;
&lt;p&gt;-&amp;gt; when i use&amp;nbsp;&lt;span&gt;BT_LE_ADV_OPT_DIR_ADDR_RPA&amp;nbsp;mode, only 1 device can connect without other bonded device.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do you have any idea?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I attached other files.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please help me..&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/5127.prj.conf"&gt;devzone.nordicsemi.com/.../5127.prj.conf&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/76581.main.c"&gt;devzone.nordicsemi.com/.../76581.main.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 BLE Filter scan required(whitelist) dose not working...</title><link>https://devzone.nordicsemi.com/thread/425539?ContentTypeID=1</link><pubDate>Mon, 15 May 2023 09:15:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fc8fcab-48ac-4fd5-860c-8b101a0abfe1</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Like you do in the code you posted in the original code, where you use&amp;nbsp;&lt;code&gt;bt_foreach_bond()&lt;/code&gt; to iterate through all bonds. There you also get the address. Specifically, this is the callback in the code you posted:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void add_bonded_addr_to_filter_list(const struct bt_bond_info *info, void *data)
{
	char addr_str[BT_ADDR_LE_STR_LEN];

	bt_le_filter_accept_list_add(&amp;amp;info-&amp;gt;addr);
	bt_addr_le_to_str(&amp;amp;info-&amp;gt;addr, addr_str, sizeof(addr_str));
	printk(&amp;quot;Added %s to advertising accept filter list\n&amp;quot;, addr_str);
	bond_count++;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And here you get the address of the bonded device as&amp;nbsp;&lt;code&gt;&amp;amp;info-&amp;gt;addr&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 BLE Filter scan required(whitelist) dose not working...</title><link>https://devzone.nordicsemi.com/thread/425538?ContentTypeID=1</link><pubDate>Mon, 15 May 2023 09:10:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8dd03bc-ecd0-4bd5-b791-0f1f92b7bbb7</guid><dc:creator>Taron</dc:creator><description>&lt;p&gt;I&amp;#39;m so sorry, i have last question.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;how can i get the bonded device address?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 BLE Filter scan required(whitelist) dose not working...</title><link>https://devzone.nordicsemi.com/thread/425533?ContentTypeID=1</link><pubDate>Mon, 15 May 2023 08:51:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04c64153-f15b-45e6-91b9-a9e1b19369e1</guid><dc:creator>Taron</dc:creator><description>&lt;p&gt;Okay, i understand it. Thank you so much~&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 BLE Filter scan required(whitelist) dose not working...</title><link>https://devzone.nordicsemi.com/thread/425532?ContentTypeID=1</link><pubDate>Mon, 15 May 2023 08:46:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5fa8f1a9-acfb-4eef-9fd6-d7efdd38c589</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Taron"]Oh i see. I got it, that mean filter accept list affect only connecting right?[/quote]
&lt;p&gt;Yes. When advertising with filter accept list, any connection attempts by centrals not in the list will simply be ignored.&lt;/p&gt;
[quote user="Taron"]when peripheral device stop advertising, can bonded device connect to peripheral device?[/quote]
&lt;p&gt;No, the peripheral listens for connections in a very short time right after sending an advertising packet, and that is the only time. It is not possible for a central to connect to a peripheral that is not advertising.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 BLE Filter scan required(whitelist) dose not working...</title><link>https://devzone.nordicsemi.com/thread/425521?ContentTypeID=1</link><pubDate>Mon, 15 May 2023 08:22:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4cdde74-8eac-4c7e-9b7f-c23687a5403f</guid><dc:creator>Taron</dc:creator><description>&lt;p&gt;I have more question.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;when peripheral device stop advertising, can bonded device connect to peripheral device?&lt;/p&gt;
&lt;p&gt;if you have any solution, can you tell me?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 BLE Filter scan required(whitelist) dose not working...</title><link>https://devzone.nordicsemi.com/thread/425509?ContentTypeID=1</link><pubDate>Mon, 15 May 2023 07:49:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb8282ab-e4c7-489a-a5b6-5fd85142bbcb</guid><dc:creator>Taron</dc:creator><description>&lt;p&gt;Oh i see. I got it, that mean filter accept list affect only connecting right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 BLE Filter scan required(whitelist) dose not working...</title><link>https://devzone.nordicsemi.com/thread/425505?ContentTypeID=1</link><pubDate>Mon, 15 May 2023 07:41:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61a59057-01b6-45f8-8159-c1e8d3b08df1</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Any central can still scan the peripheral when you use filter accept list. However, only devices in the filter list (previously called whitelist) are allowed to connect.&lt;/p&gt;
&lt;p&gt;The only way you can prevent other centrals from scanning a peripheral is to use directed advertising, where you explicitly advertise specifically to a central. That is generally not recommended though, and for instance Apple writes this in the &lt;a href="https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf"&gt;Accessory Design Guidelines for Apple Devices&lt;/a&gt;:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;ADV_DIRECT_IND should not be used.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Also, note that a sniffer can still read the packets, it is just that the&amp;nbsp;Bluetooth stacks of the central will filter out directed advertising packets that are intended for other devices. That said, if you really need this, then you can take a look at the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.3.0/zephyr/samples/bluetooth/direct_adv/README.html"&gt;Bluetooth: Direct Advertising sample&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 BLE Filter scan required(whitelist) dose not working...</title><link>https://devzone.nordicsemi.com/thread/425465?ContentTypeID=1</link><pubDate>Mon, 15 May 2023 00:07:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e047d07-0687-4034-a124-7c190dc40d48</guid><dc:creator>Taron</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I understand bt_foreach_bond fuction.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Actually i want to the center device can&amp;#39;t scan my advertising without bonded device(whitelist adding device).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But&amp;nbsp; When i change the advertising option&amp;nbsp;BT_LE_ADV_OPT_FILTER_SCAN_REQ, then it&amp;#39;s not working.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I mean every device can scan my advertising.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s my problem.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340 BLE Filter scan required(whitelist) dose not working...</title><link>https://devzone.nordicsemi.com/thread/425314?ContentTypeID=1</link><pubDate>Fri, 12 May 2023 12:02:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e08b53a1-d152-4fe8-b804-48a09a450a27</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;In what way does this not work?&lt;/p&gt;
&lt;p&gt;Looking at your main.c that is one thing that sticks out. You have a&amp;nbsp;bond_count variable set to 0, and this is always 0. The reason is that you have this line:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;	bt_foreach_bond(BT_ID_DEFAULT, add_bonded_addr_to_filter_list, NULL);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;which probably should change to this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;	bt_foreach_bond(BT_ID_DEFAULT, add_bonded_addr_to_filter_list, &amp;amp;bond_count);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can see more about how to use the filter accept list in &lt;a href="https://academy.nordicsemi.com/topic/blefund-lesson-5-exercise-2/"&gt;Exercise 2 in Lesson 5&lt;/a&gt;&amp;nbsp;of the &lt;a href="https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/"&gt;Bluetooth Low Energy Fundamentals course&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>