<?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>scan with UUID filter</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111220/scan-with-uuid-filter</link><description>My project is developed on nRF52840, it needs to communication with a mobile device through BLE, nRF52840 is as central. The mobile device starts BLE advertising, then, nRF52840 starts scanning, I only want to connect with that mobile device, I added</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 22 May 2024 09:51:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111220/scan-with-uuid-filter" /><item><title>RE: scan with UUID filter</title><link>https://devzone.nordicsemi.com/thread/485350?ContentTypeID=1</link><pubDate>Wed, 22 May 2024 09:51:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e8463f9-cdb3-440d-88d0-3db49bbf5f1e</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi Mark,&lt;/p&gt;
&lt;p&gt;Apologies for the long response time. There has been 5 days of holidays/weekend here in Norway since my last reply.&lt;/p&gt;
[quote user="mark.zhang"]&lt;p&gt;All samples in that course only implement BLE peripheral on Nordic board, but, I need to use the Nordic board as BLE central, it scans for BLE device with UUID filter, when the mobile device with that service UUID is found, it will connect to it, then, exchange data.&lt;/p&gt;
&lt;p&gt;could you provide an sample to implement a BLE central on nRF52840 with Zephry.&lt;/p&gt;[/quote]
&lt;p&gt;As for samples that showcases how to scan for a certain UUID from a centrals perspective, you can have a look at the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/bluetooth/central_uart/README.html"&gt;Central_UART&lt;/a&gt;&amp;nbsp;sample where it starts to scan for the UUID of the Nordic UART Service:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/831e3627aa67890791794ef82588a2d68ce17c0b/samples/bluetooth/central_uart/src/main.c#L488"&gt;https://github.com/nrfconnect/sdk-nrf/blob/831e3627aa67890791794ef82588a2d68ce17c0b/samples/bluetooth/central_uart/src/main.c#L488&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
[quote user="mark.zhang"]The issue was solved, the UUID data order should be reversed.[/quote]
&lt;p&gt;Noted, could you also clarify if this means that your entire inquery has been resolved? If not please let me know if you have any remaining questions&amp;nbsp;not answered!&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: scan with UUID filter</title><link>https://devzone.nordicsemi.com/thread/484853?ContentTypeID=1</link><pubDate>Fri, 17 May 2024 22:15:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af3a9ba0-fe0b-4f8f-9e79-bc689889509b</guid><dc:creator>mark.zhang</dc:creator><description>&lt;p&gt;The issue was solved, the UUID data order should be reversed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: scan with UUID filter</title><link>https://devzone.nordicsemi.com/thread/484852?ContentTypeID=1</link><pubDate>Fri, 17 May 2024 22:02:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19895539-5f10-4f3f-b049-4fddc0d9ffe4</guid><dc:creator>mark.zhang</dc:creator><description>&lt;p&gt;I may scan my mobile device by filter with name in initialization:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;static&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;int&lt;/span&gt;&lt;span&gt; scan_init(&lt;/span&gt;&lt;span&gt;void&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;int&lt;/span&gt;&lt;span&gt; err;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; bt_scan_init_param scan_init = {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .connect_if_match = &lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; bt_scan_init(&amp;amp;scan_init);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; bt_scan_cb_register(&amp;amp;scan_cb);&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; err = bt_scan_filter_add(&lt;/span&gt;&lt;span&gt;BT_SCAN_FILTER_TYPE_NAME&lt;/span&gt;&lt;span&gt;&lt;span&gt;,&amp;quot;MobileID&amp;quot;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;if&lt;/span&gt;&lt;span&gt; (err) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;return&lt;/span&gt;&lt;span&gt; err;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; err = bt_scan_filter_enable(&lt;/span&gt;&lt;span&gt;BT_SCAN_NAME_FILTER&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;false&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;if&lt;/span&gt;&lt;span&gt; (err) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;return&lt;/span&gt;&lt;span&gt; err;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;return&lt;/span&gt;&lt;span&gt; err;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;But, if I change the filter to UUID, no match was found.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I could&amp;nbsp;scan the mobile device with nRF Connect App, the UUID is shown: &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;00005300-5a07-4768-b762-7394cc35863a.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I used UUID generated as:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#define &lt;/span&gt;&lt;span&gt;MOBILEID_SERVICE_UUID&lt;/span&gt;&lt;span&gt; &amp;nbsp; &lt;/span&gt;&lt;span&gt;BT_UUID_DECLARE_128&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;0x00&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0x00&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0x53&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0x00&lt;/span&gt;&lt;span&gt;, \&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;0x5a&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0x07&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0x47&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0x68&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0xb7&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0x62&lt;/span&gt;&lt;span&gt;, \&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;0x73&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0x94&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0xcc&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0x35&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0x86&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0x3a&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;err = bt_scan_filter_add(BT_SCAN_FILTER_TYPE_UUID, MOBILEID_SERVICE_UUID);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;please help.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;mark,&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: scan with UUID filter</title><link>https://devzone.nordicsemi.com/thread/484788?ContentTypeID=1</link><pubDate>Thu, 16 May 2024 22:45:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:277cd0ef-9b1d-4e1e-a103-d7ea756facdd</guid><dc:creator>mark.zhang</dc:creator><description>&lt;p&gt;All samples in that course only implement BLE peripheral on Nordic board, but, I need to use the Nordic board as BLE central, it scans for BLE device with UUID filter, when the mobile device with that service UUID is found, it will connect to it, then, exchange data.&lt;/p&gt;
&lt;p&gt;could you provide an sample to implement a BLE central on nRF52840 with Zephry.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Mark,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: scan with UUID filter</title><link>https://devzone.nordicsemi.com/thread/484659?ContentTypeID=1</link><pubDate>Thu, 16 May 2024 11:36:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84327c6b-6135-42d3-9af1-76f8f6aef59f</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I recommend that you go through the Bluetooth Low Energy Fundamentals course at our academy pages to learn more about the scanning procedure as well as general BLE theory and development:&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals"&gt;https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals&lt;/a&gt;/. This course should show you how to scan with UUID filter.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>