<?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>nRF Desktop - Restart advertising as peripheral &amp;amp; In-range detection</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/106966/nrf-desktop---restart-advertising-as-peripheral-in-range-detection</link><description>Hi there, I&amp;#39;m using ncs2.4.2 with the nrf52840dk_nrf52840 configuration of nrf desktop. 
 We have modified nRF desktop to be a bt peripheral composite mouse and keyboard. 
 
 1. Once connected to a central, I would like to restart advertising. Once advertising</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 31 Dec 2023 19:51:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/106966/nrf-desktop---restart-advertising-as-peripheral-in-range-detection" /><item><title>RE: nRF Desktop - Restart advertising as peripheral &amp; In-range detection</title><link>https://devzone.nordicsemi.com/thread/462158?ContentTypeID=1</link><pubDate>Sun, 31 Dec 2023 19:51:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b209b353-1295-435c-9673-e429040f18d2</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hello mrd,&lt;/p&gt;
&lt;p&gt;I am glad to hear that&amp;nbsp;things have worked out for you. From your reply, it seems like you have also understood how the identities are handled in the ble_bond module.&lt;/p&gt;
&lt;p&gt;I will go ahead and close this case then &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Desktop - Restart advertising as peripheral &amp; In-range detection</title><link>https://devzone.nordicsemi.com/thread/462151?ContentTypeID=1</link><pubDate>Sun, 31 Dec 2023 17:55:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47ee0d37-7805-4b94-9621-91ab62e62e67</guid><dc:creator>mrd</dc:creator><description>&lt;p&gt;Hello Hieu,&lt;/p&gt;
&lt;p&gt;I have the first part of the application working.&lt;/p&gt;
&lt;p&gt;As you described, I increased&amp;nbsp;&lt;span&gt;CONFIG_BT_MAX_PAIRED&lt;/span&gt;&lt;span&gt;=4 and&amp;nbsp;&lt;/span&gt;&lt;span&gt;CONFIG_BT_ID_MAX&lt;/span&gt;&lt;span&gt;=5.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now I have 3 &amp;quot;user&amp;quot; bonds to play around with.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I send click events to the module to select different peers and advertise in empty slots with the&amp;nbsp;&amp;nbsp;&lt;/span&gt;CONFIG_DESKTOP_BLE_PEER_SELECT functions, and I erase bonds with the&amp;nbsp;CONFIG_DESKTOP_BLE_PEER_ERASE functions.&lt;/p&gt;
&lt;p&gt;One of the most confusing parts is that ble_bond.c uses it&amp;#39;s own identities which are then mapped to bt identities, but bt_foreach_bond() iterates through bt identities only. To iterate through the user profiles, you must do this. Note&amp;nbsp;&lt;span&gt;get_bt_stack_peer_id(), which maps between the ble_bond identity i and the bt stack id&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;for&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;size_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;; &lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;MAX_USER_BT_CONNS&lt;/span&gt;&lt;span&gt;; &lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt;++&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;bt_foreach_bond&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;get_bt_stack_peer_id&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt;), &lt;/span&gt;&lt;span&gt;your_function&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;your_data&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;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for all your help. Consider this case closed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Desktop - Restart advertising as peripheral &amp; In-range detection</title><link>https://devzone.nordicsemi.com/thread/462128?ContentTypeID=1</link><pubDate>Fri, 29 Dec 2023 20:44:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4865bf34-e2de-474b-b94c-a37c84619fc3</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi mrd,&lt;/p&gt;
&lt;p&gt;I think one point here that we need to remember is that the central is the device that decides when a connection happens in BLE.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="mrd"]I was thinking this was a basic bluetooth use case. Connect to&amp;nbsp;a central. Advertise again and connect to a second central.&amp;nbsp;Disconnect from first central. Remember&amp;nbsp;both centrals.[/quote]
&lt;p&gt;I see. I think this is more similar to how Bluetooth audio devices work. If you want your product to work this way, then&amp;nbsp;you might need to modify the existing states of the BLE Bond module or create new ones.&lt;/p&gt;
&lt;p&gt;The state machine of the BLE Bond module, including all the state definitions, is completely internal to that module, so changing it should not conflict with other modules in the CAF.&lt;/p&gt;
[quote user="mrd"]What I would like to do is bond to the new device but still remember devices that we connected to in the past, instead of forgetting.[/quote]
&lt;p&gt;My apology. I previously misunderstood that you want the old bond forgotten. This is also perfectly possible.&lt;/p&gt;
&lt;p&gt;If you want multiple bonds remembered on the same identity, then you should also look at these Kconfigs:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/kconfig/index.html#CONFIG_CAF_BLE_STATE_MAX_LOCAL_ID_BONDS"&gt;CONFIG_CAF_BLE_STATE_MAX_LOCAL_ID_BONDS&lt;/a&gt;&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/kconfig/index.html#CONFIG_BT_MAX_PAIRED"&gt;CONFIG_BT_MAX_PAIRED&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That is on top of a modified BLE Bond state machine.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;I understand your requirement here and think it would work fine. However, just in case there is any misunderstanding about the nRF Desktop application, I would like to visit its approach to manage new peers.&lt;/p&gt;
&lt;p&gt;Refer again to &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/applications/nrf_desktop/README.html#bluetooth-le-peer-control"&gt;the Peer Control feature&lt;/a&gt; docs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Short-press to initialize the peer selection. (The LED1 changes color and starts blinking.) During the peer selection:
&lt;ul&gt;
&lt;li&gt;Short-press to toggle between available peers. The LED1 changes color for each peer and keeps blinking.&lt;/li&gt;
&lt;li&gt;Double-press to confirm the peer selection. The peer is changed after the confirmation. LED1 stops blinking.&lt;br /&gt;When it rotates to an identity that has yet had a bond, the application will&amp;nbsp;be open to form a new bond with a new central.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As you can see, this solution also allows for multiple bonds remembered at the same time.&lt;/p&gt;
&lt;p&gt;The behavior here is also the exact same as how my Bluetooth mice work. I personally find it more convenient&amp;nbsp;for keyboard and mouse device. But again, you know your product best, so&amp;nbsp;it&amp;#39;s your call.&lt;/p&gt;
[quote user="mrd"]For 2, this would be from peripheral perspective. In my understanding, the nRF Desktop peripheral has a list of devices it has previously connected to (aka bonded with?). I would like to query each device in the list and see if they are available to connect to. I have found a functions in ble_bond.c (bt_foreach_bond) which I might be able to use to query each one, but I&amp;#39;m not quite sure how to to do the querying part.[/quote]
&lt;p&gt;A peripheral can perform Directed Advertising to a bonded peer. If the central is scanning&amp;nbsp;and detects that advertisement, it can send a connection establishment packet, or a Scan Request. Upon receiving those packets, the peripheral would know the central is available.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There are a few points to notice:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The central is completely free to choose what to do when it receives the Directed Advertising packet.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;I&amp;nbsp;didn&amp;#39;t have the chance to look up the Bluetooth Specification thoroughly, so I am not sure if there are any required behavior for a central device upon receiving a Directed Advertising packet.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Note that Apple&amp;#39;s Accessory Design Guidelines recommend against the use of Directed Advertising. They don&amp;#39;t explain and I am not sure why.&lt;br /&gt;What this means is that we cannot be sure that Apple devices will automatically connect to Directed Advertisements.&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1703879698555v1.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The central has to be scanning.&lt;/li&gt;
&lt;/ul&gt;
[quote user="mrd"]Thank you for the addtional address information. I expect we would use a random static address so that our device can be easily be found again.[/quote]
&lt;p&gt;If the device should be found again by a bonded central, then Random Private Address should also make it easy. A bonded central would have the IRK, Identity Resolving Key, to decrypt the Random Private Address into an identifiable address.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Desktop - Restart advertising as peripheral &amp; In-range detection</title><link>https://devzone.nordicsemi.com/thread/462026?ContentTypeID=1</link><pubDate>Fri, 29 Dec 2023 01:13:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8ef9bc9-e545-4f70-8c3a-4e04f44fb0a0</guid><dc:creator>mrd</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;Thank you for the detailed response!&lt;/p&gt;
&lt;p&gt;A few points of clarification.&lt;/p&gt;
&lt;p&gt;For 1, my understanding of how nRF Desktop works is that (as peripheral) when it bonds to the new device, it assumes a new identity and forgets previous bonds. This is shown in the state_switch table you linked to: there is only IDLE, ERASE_ADV, and STATE_ERASE_PEER.&amp;nbsp;The state I&amp;#39;m looking for in state_switch is ADV, but it doesn&amp;#39;t exist. No connection deleting should take place until we reach the maximum number of ble devices the device can save.&lt;/p&gt;
&lt;p&gt;The functional flow of my app is:&amp;nbsp;Connect to&amp;nbsp;a central. Trigger advertising again and have a second central connect.&amp;nbsp;Disconnect from first central. Remember&amp;nbsp;both centrals.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I see&amp;nbsp;ble_adv_start_undirected in ble_adv.c - it does what I want, but I don&amp;#39;t want to break expected ble_adv states by calling functions out of sync&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For 2, this would be from peripheral perspective. In my understanding, the nRF Desktop peripheral has a list of devices it has previously connected to (aka bonded with?). I would like to query each device in the list and see if they are available to connect to. I have found a functions in ble_bond.c (bt_foreach_bond) which I might be able to use to query each one, but I&amp;#39;m not quite sure how to to do the querying part.&lt;/p&gt;
&lt;p&gt;Thank you for the addtional address information. I expect we would use a random static address so that our device can be easily be found again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Desktop - Restart advertising as peripheral &amp; In-range detection</title><link>https://devzone.nordicsemi.com/thread/462024?ContentTypeID=1</link><pubDate>Fri, 29 Dec 2023 00:55:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1cab4ca5-9d04-42e6-8973-f4ffc30bb303</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi mrd,&lt;/p&gt;
[quote user=""]1. Once connected to a central, I would like to restart advertising. Once advertising, if there is an incoming pairing request, we would like to connect to the incoming pairing request and unpair from&amp;nbsp;the previously active connection. I am struggling to figure out how to&amp;nbsp;do this within the nRF Desktop framework. I guess I could just do independent API calls in my own threads, but I would like to keep the nRF Desktop bt infrastructure properly synchronized.[/quote]
&lt;p&gt;The nRF Desktop application is based on &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/libraries/caf/caf_overview.html"&gt;the Common Application Framework&lt;/a&gt;, which in turn is based on &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/libraries/others/app_event_manager.html"&gt;the Application Event Manager&lt;/a&gt;. In this setup, ever modules communicate with each other&amp;nbsp;by sending events. I think all of the events are defined here:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/tree/v2.5.0/include/caf/events"&gt;https://github.com/nrfconnect/sdk-nrf/tree/v2.5.0/include/caf/events&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The nRF Desktop application already has a Peer Control feature that has a lot in common with your requirement. I find it easier to understand the code and documentation&amp;nbsp;after reading the feature &amp;quot;manual&amp;quot; for&amp;nbsp;the Gaming Mouse; this&amp;nbsp;section, in particular:&lt;/p&gt;
[quote]Long-press to initialize the peer erase. When LED1 starts blinking rapidly, double-press to confirm the operation. After the confirmation, Bluetooth advertising using a new local identity is started. When a new Bluetooth Central device successfully connects and bonds, the old bond is removed and the new bond is used instead. If the new peer does not connect in the predefined period of time, the advertising ends and the application switches back to the old peer.&lt;br /&gt;&lt;br /&gt;You can cancel the ongoing peer operation with a standard button press.[/quote]
&lt;p&gt;Next, we will want to look into the modules involved with the management of BLE in nRF Desktop. I will list my findings on what is of interest for your requirement.&lt;/p&gt;
&lt;p&gt;BLE Bond module.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;The default implementation in CAF is &lt;strong&gt;not&lt;/strong&gt; used. An implementation specific to nRF Desktop is used. The documentation is &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/applications/nrf_desktop/doc/ble_bond.html#nrf-desktop-ble-bond"&gt;here&lt;/a&gt;, and the source code is &lt;a href="https://github.com/nrfconnect/sdk-nrf/tree/v2.5.0/applications/nrf_desktop/src/modules"&gt;here&lt;/a&gt; (ble_bond.c and Kconfig.ble_bond).&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;We can find the peer erase control flow in&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/applications/nrf_desktop/doc/ble_bond.html#module-states"&gt;the Module State section&lt;/a&gt; of the docs.&amp;nbsp;The flow starts with transition to the STATE_ERASE_PEER upon a long click event, then to STATE_ERASE_ADV, and back to STATE_IDLE.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;From that, we can see in the implementation that the state transitions are defined in &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.5.0/applications/nrf_desktop/src/modules/ble_bond.c#L73-L102"&gt;the state_switch table&lt;/a&gt;. The relevant event handlings are in&amp;nbsp;app_event_handler()&amp;nbsp;and handle_click().&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Notice that upon erasing a bond, the local identity associated with it is also reset. This&amp;nbsp;seem to be not what you want; but perhaps you could consider to keep.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Based on that, you can update the logic to have&amp;nbsp;new state transitions, or perhaps new states as needed.&lt;/p&gt;
&lt;p&gt;BLE State module&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;The default implementation in CAF &lt;strong&gt;is&lt;/strong&gt; used. &lt;br /&gt;The&amp;nbsp;CAF documentation is&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/libraries/caf/ble_state.html"&gt;here&lt;/a&gt;, but there are some additional details in &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/applications/nrf_desktop/doc/ble_state.html"&gt;the nRF Desktop docs&lt;/a&gt;.&amp;nbsp;&lt;br /&gt;The source code is &lt;a href="https://github.com/nrfconnect/sdk-nrf/tree/v2.5.0/applications/nrf_desktop/src/modules"&gt;here&lt;/a&gt; (ble_state.c and Kconfig.ble_state).&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Notice in &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/libraries/caf/ble_state.html#connection-state-change"&gt;the Connection State Change section&lt;/a&gt; of the docs,&amp;nbsp;a disconnection can be triggered by the regular Zephyr API bt_conn_disconnect().&lt;/p&gt;
&lt;p&gt;BLE Advertising module&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;The default implementation in CAF &lt;strong&gt;is&lt;/strong&gt; used.&lt;br /&gt;The CAF documentation is &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/libraries/caf/ble_adv.html"&gt;here&lt;/a&gt;, but there are some additional details in &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/applications/nrf_desktop/doc/ble_adv.html"&gt;the nRF Desktop docs&lt;/a&gt;. &lt;br /&gt;T&lt;span&gt;he source code is&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/tree/v2.5.0/applications/nrf_desktop/src/modules"&gt;here&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;(ble_adv.c and Kconfig.ble_adv).&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;There don&amp;#39;t seem to be anything particular about this module. Without using CAF, normally, advertising is automatically restarted if the maximum number of connections allows.&amp;nbsp;&lt;br /&gt;I expect it to work similarly even when this module is in used. You can check by increasing&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/kconfig/index.html#CONFIG_BT_MAX_CONN"&gt;CONFIG_BT_MAX_CONN&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/kconfig/index.html#CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT"&gt;CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT&lt;/a&gt;&amp;nbsp;to 2, then see&amp;nbsp;if advertising is restarted&amp;nbsp;normally after a connection is established.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Besides those, if you want to reconfigure these Kconfigs:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/kconfig/index.html#CONFIG_CAF_BLE_STATE_MAX_LOCAL_ID_BONDS"&gt;CONFIG_CAF_BLE_STATE_MAX_LOCAL_ID_BONDS&lt;br /&gt;&lt;/a&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/kconfig/index.html#CONFIG_CAF_BLE_STATE_MAX_LOCAL_ID_BONDS"&gt;CONFIG_CAF_BLE_ADV_FILTER_ACCEPT_LIST&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;
[quote user=""]2. The other thing I am not sure how to implement (perhaps due to my unfamiliarity with bluetooth) is to scan (discover?) previously bonded connections, and give some feedback on whether they are in range or not. I was imagining testing RSSI to a specific BT address. Is this how you would recommend implementing this?[/quote]
&lt;p&gt;Do you want to realize the feature above for the central device or the&amp;nbsp;peripheral device?&lt;/p&gt;
&lt;p&gt;Only a central/observer&amp;nbsp;device can&amp;nbsp;scan for advertisement.&amp;nbsp;In our case, that means only the central devices can&amp;nbsp;detect the presence of previously bonded peer.&lt;/p&gt;
&lt;p&gt;As noted above, the local identity is reset when a bond is erased. That means that the device will not advertise with the same identity again. Therefore, even if the central device tries to look for a previously bonded peer, it will not succeed.&lt;/p&gt;
&lt;p&gt;If you change the implementation to not reset the identity upon bond deletion, then&amp;nbsp;it depends on the kind of advertisement. &lt;br /&gt;If the device advertises with a Public Address or Random Static Address, it can be found again for sure. &lt;br /&gt;If the device advertises with a Random Private Address, it depends on if the IRK is reused.&lt;/p&gt;
&lt;p&gt;If you need more information about the address types,&amp;nbsp;you can refer to &lt;a href="https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-2-bluetooth-le-advertising/topic/bluetooth-address"&gt;Lesson 2 of our Bluetooth Low Energy Fundamentals course&lt;/a&gt;.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;I will be out of office next week, but please don&amp;#39;t hesitate to reply if you have any further questions. Unless someone from the community have helped you, another engineer will continue to support you.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;
&lt;p&gt;---&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Due to&amp;nbsp;the ongoing Christmas - New Year holiday season, we are severely understaffed, and there would be delays in responses. The situation should start improving next week. Our apologies for the inconveniences.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>