<?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>BLE connect state to adv state</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/126841/ble-connect-state-to-adv-state</link><description>I use the nRF5 SDK for BLE peripheral development based on a keyboard example. After the peripheral connects and bonds with a central device, I can detect button presses. I want pressing a button to switch the peripheral back to advertising mode. How</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 11 Feb 2026 11:56:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/126841/ble-connect-state-to-adv-state" /><item><title>RE: BLE connect state to adv state</title><link>https://devzone.nordicsemi.com/thread/560899?ContentTypeID=1</link><pubDate>Wed, 11 Feb 2026 11:56:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a13dc51b-e1b9-4dd2-a3b4-5ee900855116</guid><dc:creator>Samruddhi Jadhav</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Apologies for the delay. The solution here would be to keep advertising without use of whitelist. Then when the device connects, check its Bluetooth address. If the device is the one you want to block, disconnect it right away. By doing this, one host gets blocked and the other Windows/MAC/iOS/ Android devices can pair normally. It is not possible to read the whitelist of any Windows or MAC device as it is private to the host and due to this it can&amp;#39;t be accessed by a BLE peripheral and you can&amp;#39;t design your own whitelist to match the host&amp;#39;s whitelist or to decide which hosts are allowed.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Samruddhi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connect state to adv state</title><link>https://devzone.nordicsemi.com/thread/560602?ContentTypeID=1</link><pubDate>Mon, 09 Feb 2026 03:36:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aae505f6-cde4-420e-a3dc-0adaae5919ae</guid><dc:creator>Liny</dc:creator><description>&lt;div class="ybc-p"&gt;&amp;ldquo;&amp;rdquo;&lt;span&gt;Our docs only mention whitelist advertising and disconnecting after connect so there&amp;#39;s no mentioned way to inspect and reject a connection. You have to let the connection happen and call sd_ble_gap_disconnect() for dropping it. The only way you can block one specific host is by using peer manger in order to manage bonded peers. Then build a whitelist which does not contain that host&amp;#39;s peer ID. After that, enable whitelist advertising.&amp;nbsp;&lt;/span&gt;&amp;ldquo;&amp;rdquo;&lt;br /&gt;Thank you. You mentioned that if I want to pair a new device while blocking connection requests from the host that still has this slave device on its whitelist, I should enable whitelist broadcasting, remove this device from the whitelist, and include the new device instead. My question is, how can I determine the whitelist of the peer device I want to pair with? Since the peer device could be any Windows or Mac computer, I&amp;rsquo;m unsure how to define the scope of my whitelist while also excluding devices I don&amp;rsquo;t want to reconnect to.&lt;/div&gt;
&lt;div class="host-lopnbnfpjmgpbppclhclehhgafnifija" style="position:relative;"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connect state to adv state</title><link>https://devzone.nordicsemi.com/thread/560558?ContentTypeID=1</link><pubDate>Fri, 06 Feb 2026 14:47:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0e9d043-9e02-4762-9d86-6a1c0d73e36c</guid><dc:creator>Samruddhi Jadhav</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;For the third question, use a whitelist during advertising and control which bonded devices are allowed. So yes, it limits the scope of who can connect.&lt;/p&gt;
&lt;p&gt;What the whitelist does:&lt;/p&gt;
&lt;p&gt;When a phone/PC first bonds with your device, the Peer Manager stores it and its given a peer ID. From these, you build the whitelist by using pm_whitelist_set(peer_ids, n_peer_ids).&lt;/p&gt;
&lt;p&gt;Then, when advertising uses the whitelist, only devices in this list can connect in fast/slow advertising modes. This works for Windows, iOS, Android, Mac. To combine &amp;quot;pair with any device&amp;quot; + whitelist, there are 2 modes you can use: Normal mode (Whitelist ON) and Pairing Mode. In normal mode, build a whitelist from all peer IDs you want to allow. when advertising module sends BLE_ADV_EVT_WHITELIST_REQUEST, you can then call pm_whitelist_get() and then ble_advertising_whitelist_reply() in order to apply it. This way, only&amp;nbsp;bonded devices are able to reconnect. In pairing mode, you can temporarily turn off whitelist for one connection when you want to pair with a new phone/PC. This way, any Windows/iOS /Android/Mac device will be able to connect and bond once. Advertising automatically will go back to using whitelist after connection ends. When you enter &amp;quot;pairing mode&amp;quot;, you can pair with any mainstream OS. Each device after bonding gets a peerID and can be allowed in the whitelist or blocked out.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Question about alternative approach:&lt;/p&gt;
&lt;p&gt;Our docs only mention whitelist advertising and disconnecting after connect so there&amp;#39;s no mentioned way to inspect and reject a connection. You have to let the connection happen and call sd_ble_gap_disconnect() for dropping it. The only way you can block one specific host is by using peer manger in order to manage bonded peers. Then build a whitelist which does not contain that host&amp;#39;s peer ID. After that, enable whitelist advertising.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Samruddhi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connect state to adv state</title><link>https://devzone.nordicsemi.com/thread/560344?ContentTypeID=1</link><pubDate>Wed, 04 Feb 2026 13:22:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0abb33e-d9c3-44ca-9533-e74106d90fcd</guid><dc:creator>Liny</dc:creator><description>&lt;div class="ybc-p"&gt;If the above method doesn&amp;#39;t work, is there any alternative approach? For example, when the peripheral receives a connection request from the host or detects an error like err4102, it could reply by rejecting the connection or something similar, so that the host won&amp;#39;t keep attempting to reconnect repeatedly.&lt;/div&gt;
&lt;div class="ybc-p"&gt;Alternatively, if I set the peripheral to broadcast in non-whitelist mode, will the host still be able to discover my device and try to reconnect?&lt;/div&gt;
&lt;div class="host-lopnbnfpjmgpbppclhclehhgafnifija" style="position:relative;"&gt;&lt;/div&gt;
&lt;div class="host-lopnbnfpjmgpbppclhclehhgafnifija" style="position:relative;"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connect state to adv state</title><link>https://devzone.nordicsemi.com/thread/560341?ContentTypeID=1</link><pubDate>Wed, 04 Feb 2026 13:14:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92df17f6-39ca-40ff-b415-fe4923fcbebf</guid><dc:creator>Liny</dc:creator><description>&lt;div class="ybc-p"&gt;According to your method, the first one has been achieved. Thank you!&lt;/div&gt;
&lt;div class="ybc-p"&gt;As for the third question, I&amp;rsquo;d like to ask: Do you mean using a whitelist for broadcasting and limiting the scope of the whitelist? Is that correct?&lt;/div&gt;
&lt;div class="ybc-p"&gt;What I want to know is, if I want to pair with most mainstream Windows, iOS, Android, and Mac devices on the market, how should I configure the scope of the whitelist? In other words, if the whitelist for the new host devices I want to pair with isn&amp;rsquo;t specific, is your method still effective? And if it is effective, could you provide more detailed guidance? Thank you!&lt;/div&gt;
&lt;div class="host-lopnbnfpjmgpbppclhclehhgafnifija" style="position:relative;"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connect state to adv state</title><link>https://devzone.nordicsemi.com/thread/560332?ContentTypeID=1</link><pubDate>Wed, 04 Feb 2026 12:29:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3de38fe-566a-463a-bafa-c44b891783e7</guid><dc:creator>Samruddhi Jadhav</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1) I can suggest a few steps. In order to make the device advertise again when button is pressed, ask the SoftDevice first to disconnect. This you can do by using sd_ble_gap_disconnect(...). Then, when you get the disconnected event in the BLE handler, start advertising.&lt;/p&gt;
&lt;p&gt;advertising_init() is called once at the start. After that, you can use advertising_start() again after disconnect.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2) The reason why the central keeps reconnecting is because it remembers the bonding info between your peripheral and central. The peripheral still advertises in a mode that accepts it. Then you advertised normally, so the central tried using the old bond to connect. When the connection fails, it tries again which causes a loop where it connects and disconnects.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;3) If you want to only block that central, you can try to use PeerManager and build a whitelist of peers which you want to allow. When advertising module asks for a whitelist, to get the addresses for those peerIDs, you can call pm_whitelist_get(...). These can then be passed to ble_advertising_whitelist_reply(...). So, don&amp;#39;t include the central&amp;#39;s peer ID in the list passed to pm_whitelist_set().&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Let me know if you have any further questions.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Samruddhi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connect state to adv state</title><link>https://devzone.nordicsemi.com/thread/560318?ContentTypeID=1</link><pubDate>Wed, 04 Feb 2026 10:30:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0ff3656-dee4-486a-b213-57667ba0c1fc</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Bad design. A device that exposes HID service will always see aggressive connection attempts from host OS that has a pairing/bonding active. For good reason: Disconnected mouse/keyboard is VERY annoying.&lt;/p&gt;
&lt;p&gt;The only good solution is to change the device MAC address dynamically. This is how my BTLE mouse here can support up to 3 different hosts. It has a extra button and status LEDs for this function.&lt;/p&gt;
&lt;p&gt;No idea how to do this in either NCS or the old NRF5 SDK though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connect state to adv state</title><link>https://devzone.nordicsemi.com/thread/560303?ContentTypeID=1</link><pubDate>Wed, 04 Feb 2026 08:35:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df7c4236-a19a-4816-b102-09204b8cfc66</guid><dc:creator>Liny</dc:creator><description>&lt;p&gt;I am encountering an issue: as a peripheral, after bonding with a central device, I unilaterally cleared the whitelist. However, when the peripheral re-enters pairing mode, the central device keeps attempting to connect and bond, causing the peripheral to repeatedly connect and then disconnect. How can I avoid this problem? The desired outcome is to prevent connection attempts from this specific central device while still allowing other central devices to scan and connect to the device.&lt;/p&gt;
&lt;div class="host-lopnbnfpjmgpbppclhclehhgafnifija" style="position:relative;"&gt;&lt;/div&gt;
&lt;div class="host-lopnbnfpjmgpbppclhclehhgafnifija" style="position:relative;"&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>