<?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>Pairing mode - Disable bonded connections and allow non-bonded only</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63504/pairing-mode---disable-bonded-connections-and-allow-non-bonded-only</link><description>Hi, 
 I’m developing an application using the SDK V16 , the nRF52DK (52832) as central, and a couple of Sparkfun nRF52832 breakout boards as peripherals (both peripherals behave the same way). 
 I have right now a central system that deletes bonds at</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 Jul 2020 21:18:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63504/pairing-mode---disable-bonded-connections-and-allow-non-bonded-only" /><item><title>RE: Pairing mode - Disable bonded connections and allow non-bonded only</title><link>https://devzone.nordicsemi.com/thread/259051?ContentTypeID=1</link><pubDate>Wed, 08 Jul 2020 21:18:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5d16112-abe3-4c52-8c4e-4ccd59ec2a76</guid><dc:creator>Ferencz Dominguez</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;I solved the problem. First I did was to disable the connect_if_match during the scan_init() function.&lt;/p&gt;
&lt;p&gt;Then I was able to use&amp;nbsp;sd_ble_gap_connect() during the&amp;nbsp;NRF_BLE_SCAN_EVT_FILTER_MATCH and&amp;nbsp;NRF_BLE_SCAN_EVT_WHITELIST_ADV_REPORT depending if I have the whitelist active or not and if the MAC address scanned is in the whitelist or not.&lt;/p&gt;
&lt;p&gt;Thanks for the help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing mode - Disable bonded connections and allow non-bonded only</title><link>https://devzone.nordicsemi.com/thread/259021?ContentTypeID=1</link><pubDate>Wed, 08 Jul 2020 14:34:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b17f249c-87bb-41be-a854-a4eba3278901</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;So what you want is basically a blacklist, right? This is not something that is part of the softdevice, but it is possible to do something like this from your application&lt;/p&gt;
&lt;p&gt;What you have to do is to disable the whitelist when you want to scan for new devices.&lt;/p&gt;
&lt;p&gt;When you scan without a whitelist, you will get all the advertising reports in the event called&amp;nbsp;BLE_GAP_EVT_ADV_REPORT. It is this event in nrf_ble_scan.c that usually decides whether or not to connect. You can see there is a lot of filter stuff in the nrf_ble_scan_on_adv_report() function called in this event. It boils down to setting&amp;nbsp;is_filter_matched = true or false.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So if you are looking for a particular UUID you can use this filter as before. Look inside the function nrf_ble_scan_connect_with_target() function. You see there is a p_scan_ctx-&amp;gt;connect_if_match. If this is set to true, it will try to connect. See if you can use this to not connect automatically, but check the address, whether it is present in the whitelist (that is currently not active) before you call sd_ble_gap_connect.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As a helper, you see that this function (nrf_ble_scan_on_adv_report()) will also generate the event&amp;nbsp;NRF_BLE_SCAN_EVT_FILTER_MATCH() that is forwarded to the p_scan_ctx-&amp;gt;evt_handler. Use this event to see only devices that has a filter match, and then decide whether you want to connect or not.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>