<?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>Connecting and disconnecting to various peripherals</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86863/connecting-and-disconnecting-to-various-peripherals</link><description>Hello everyone, Right now I am working on a demo showing some functionalities of 2 smartwatches: Colmi P8B and PineTime. I am using nRF52840 for that purpose. I had the idea the following idea: 
 
 When BSP_EVENT_KEY _1 is pressed, a name filter is set</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Apr 2022 14:07:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86863/connecting-and-disconnecting-to-various-peripherals" /><item><title>RE: Connecting and disconnecting to various peripherals</title><link>https://devzone.nordicsemi.com/thread/363055?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2022 14:07:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35da3590-6055-49f8-bcb4-60822be2343a</guid><dc:creator>Daniela_A</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;br /&gt;&lt;br /&gt;Thank you for taking some time to reply. This is also an interesting approach. I will try it out too.&lt;br /&gt;&lt;br /&gt;Happy Easter!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connecting and disconnecting to various peripherals</title><link>https://devzone.nordicsemi.com/thread/363053?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2022 14:03:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fc10029-6c02-4ab0-89a6-f7e6cf179bf0</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;Please note that we are very short staffed here in Norway due to Easter Holidays this week (and Monday next week). This will lead to a longer than usual response time. I am sorry for the inconvenience.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I guess I would recommend you to implement this filter yourself in the ble_evt_handler. You can add the event&amp;nbsp;BLE_GAP_EVT_ADV_REPORT in your ble_evt_handler(), and then, based on what you do in the bsp event handler, you can search for different devices in the advertising reports, and then select whether you want to connect to it using sd_ble_gap_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><item><title>RE: Connecting and disconnecting to various peripherals</title><link>https://devzone.nordicsemi.com/thread/363051?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2022 14:01:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9bf9c552-b835-4735-aa52-516e05d02d3d</guid><dc:creator>Daniela_A</dc:creator><description>&lt;p&gt;I actually found a solution for it. In the case of &lt;em&gt;&lt;strong&gt;BSP_EVENT_KEY_3&lt;/strong&gt;&lt;/em&gt; (when a smartwatch disconnects), I added a function to remove all the filters for the scan (&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.3.0%2Fgroup__nrf__ble__scan.html" rel="noopener noreferrer" target="_blank"&gt;nrf_ble_scan_all_filter_remove&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Later, the name filter is set again when either the key 1 or 2 is pressed. &lt;br /&gt;&lt;br /&gt;With that strategy, the code is running smoothly and in the way I want.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>