<?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>Search a BLE device by MAC address</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54143/search-a-ble-device-by-mac-address</link><description>Hello, 
 
 I have 2 pieces of Sparkfun nrf52840 mini boards. On the first board, I uploaded the code from &amp;#39;\nRF5_SDK_15.0.0_a53641a\examples\ble_central\ble_app_multilink_central\&amp;#39; and on the second board, the code from &amp;#39;nRF5_SDK_15.0.0_a53641a\examples</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Nov 2019 14:21:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54143/search-a-ble-device-by-mac-address" /><item><title>RE: Search a BLE device by MAC address</title><link>https://devzone.nordicsemi.com/thread/219707?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2019 14:21:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c806cfe-68a8-41ba-a695-d6d200a7482e</guid><dc:creator>BMG</dc:creator><description>&lt;p&gt;Thank you, Amanda. I solved my problem by modifying the &amp;#39;nRF5_SDK_15.3.0_59ac345\examples\ble_central\ble_app_multilink_central\sparkfun_nrf52840_mini\s140\config\sdk_config.h&amp;#39; parameter&amp;nbsp;NRF_BLE_SCAN_ADDRESS_CNT to 1 instead of 0 as it was.&lt;/p&gt;
&lt;p&gt;I got the reset because there is a check in nrf_ble_scan.c file, nrf_ble_scan_filter_set function:&amp;nbsp;&lt;span&gt;NRF_BLE_SCAN_ADDRESS_CNT&amp;nbsp;&amp;gt;0 and this was the problem.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Now everything works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Search a BLE device by MAC address</title><link>https://devzone.nordicsemi.com/thread/219658?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2019 12:51:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:458e4921-4adb-47ac-b67a-6700b8b2161c</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
[quote user="BMG"].addr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;{0x1C,&amp;nbsp;0xC6,&amp;nbsp;0x75,&amp;nbsp;0xED,&amp;nbsp;0xE8,&amp;nbsp;0xC1}&amp;nbsp;//&amp;nbsp;This&amp;nbsp;matches&amp;nbsp;what&amp;nbsp;nRF&amp;nbsp;Connect&amp;nbsp;shows&amp;nbsp;via&amp;nbsp;Scan,&amp;nbsp;for&amp;nbsp;peripheral[/quote]
&lt;p&gt;If the mac address is C1:E8:ED:75:C6:1C, the order in .addr is correct.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It seems &lt;span&gt;scan_init()&lt;/span&gt; lost the scan parameters. Could you try to add them? You could refer to the&amp;nbsp;scan_init() inside of&amp;nbsp; &amp;lt;nRF5_SDK&amp;gt;\examples\ble_central\ble_app_hrs_c&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Search a BLE device by MAC address</title><link>https://devzone.nordicsemi.com/thread/219524?ContentTypeID=1</link><pubDate>Mon, 11 Nov 2019 15:30:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8df7e27b-3498-458e-a304-980a3a42e20c</guid><dc:creator>BMG</dc:creator><description>&lt;p&gt;Thank you for the answer. I&amp;#39;ve done the changes&amp;nbsp;written in the post above, but the central device doesn&amp;#39;t find the peripheral device. I&amp;#39;ve tried with the flipped order of the MAC address and also with the normal order. Nothing works.&lt;/p&gt;
&lt;p&gt;I think it&amp;#39;s something wrong with this code:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;static&amp;nbsp;ble_gap_addr_t&amp;nbsp;m_target_periph_addr&amp;nbsp;=&lt;/div&gt;
&lt;div&gt;{&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.addr_type&amp;nbsp;=&amp;nbsp;BLE_GAP_ADDR_TYPE_RANDOM_STATIC,&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.addr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;{0x1C,&amp;nbsp;0xC6,&amp;nbsp;0x75,&amp;nbsp;0xED,&amp;nbsp;0xE8,&amp;nbsp;0xC1}&amp;nbsp;//&amp;nbsp;This&amp;nbsp;matches&amp;nbsp;what&amp;nbsp;nRF&amp;nbsp;Connect&amp;nbsp;shows&amp;nbsp;via&amp;nbsp;Scan,&amp;nbsp;for&amp;nbsp;peripheral&lt;/div&gt;
&lt;div&gt;};&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;...&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;static&amp;nbsp;void&amp;nbsp;scan_init(void)&lt;/div&gt;
&lt;div&gt;{&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ret_code_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;err_code;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nrf_ble_scan_init_t&amp;nbsp;init_scan;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;memset(&amp;amp;init_scan,&amp;nbsp;0,&amp;nbsp;sizeof(init_scan));&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;init_scan.connect_if_match&amp;nbsp;=&amp;nbsp;true;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;init_scan.conn_cfg_tag&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;APP_BLE_CONN_CFG_TAG;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;err_code&amp;nbsp;=&amp;nbsp;nrf_ble_scan_init(&amp;amp;m_scan,&amp;nbsp;&amp;amp;init_scan,&amp;nbsp;scan_evt_handler);&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;APP_ERROR_CHECK(err_code);&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;err_code&amp;nbsp;=&amp;nbsp;nrf_ble_scan_filter_set(&amp;amp;m_scan,SCAN_ADDR_FILTER,m_target_periph_addr.addr);&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;APP_ERROR_CHECK(err_code);&lt;/div&gt;
&lt;div&gt;****&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;err_code&amp;nbsp;=&amp;nbsp;nrf_ble_scan_filters_enable(&amp;amp;m_scan,&amp;nbsp;NRF_BLE_SCAN_ADDR_FILTER,&amp;nbsp;false);&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;APP_ERROR_CHECK(err_code);&lt;/div&gt;
&lt;br /&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;After line ****, the blue led is blinking. I don&amp;#39;t know if it&amp;#39;s a reset or not.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Search a BLE device by MAC address</title><link>https://devzone.nordicsemi.com/thread/219102?ContentTypeID=1</link><pubDate>Thu, 07 Nov 2019 14:31:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:692c6a69-c7cb-4768-b960-3ac6f0892e31</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Yes, as&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/tomws"&gt;Thomas Studwell&lt;/a&gt;&amp;#39;s&amp;nbsp;suggestion.&amp;nbsp;Please also be aware of the mac address display order as this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/44332/sdk-15-2---scan_addr_filter/173846#173846"&gt;post&lt;/a&gt;&amp;nbsp;described.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Search a BLE device by MAC address</title><link>https://devzone.nordicsemi.com/thread/219083?ContentTypeID=1</link><pubDate>Thu, 07 Nov 2019 14:03:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23fe51db-3fc3-43e3-b856-fa0877e5264b</guid><dc:creator>TomWS</dc:creator><description>&lt;p&gt;I believe you want to change ...SCAN_NAME_FILTER to ...SCAN_ADDR_FILTER in two places. See nrf_ble_scan.h.&lt;/p&gt;
&lt;p&gt;Also, add a new variable with the target MAC as a &lt;span style="font-family:courier new, courier;"&gt;ble_gap_addr_t&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;UPDATED: corrected target MAC type per Amanda Hsieh&amp;#39;s reference below.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>