<?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>Get resolvable private address on Android app when CONFIG_BT_PRIVACY=y configuration is used</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/75684/get-resolvable-private-address-on-android-app-when-config_bt_privacy-y-configuration-is-used</link><description>Hello, 
 I am in a project using nRF52 board where I develop and Android app. 
 The application is using Android stock BLuetoothLeScanner to scan for devices. After that the app is using the BluetoothDevice instance returned by the BluetoothLeScanner</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Jun 2021 07:31:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/75684/get-resolvable-private-address-on-android-app-when-config_bt_privacy-y-configuration-is-used" /><item><title>RE: Get resolvable private address on Android app when CONFIG_BT_PRIVACY=y configuration is used</title><link>https://devzone.nordicsemi.com/thread/313278?ContentTypeID=1</link><pubDate>Thu, 03 Jun 2021 07:31:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c643f2f-db27-447c-b715-6936d3a4926c</guid><dc:creator>Cornel Gligan</dc:creator><description>&lt;p&gt;Hello Aleksander,&lt;/p&gt;
[quote userid="3284" url="~/f/nordic-q-a/75684/get-resolvable-private-address-on-android-app-when-config_bt_privacy-y-configuration-is-used/312307#312307"]I can try to experiment with scanning for bonded devices using resolvable address and check which address is given to apps[/quote]
&lt;p&gt;That would be great to get more info about it.&lt;/p&gt;
[quote userid="3284" url="~/f/nordic-q-a/75684/get-resolvable-private-address-on-android-app-when-config_bt_privacy-y-configuration-is-used/312307#312307"]Answering your question, there&amp;#39;s no any API on Android that could resolve the address for you if that does not work out of the box.[/quote]
&lt;p&gt;Thanks a lot for confirmation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get resolvable private address on Android app when CONFIG_BT_PRIVACY=y configuration is used</title><link>https://devzone.nordicsemi.com/thread/312307?ContentTypeID=1</link><pubDate>Fri, 28 May 2021 08:53:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0286e65c-3c01-432c-b8b0-d5915872c2c2</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Does your device support multiple bonding, or is removing the bond information when bonded to a new device (or to the same phone for the second time)? I thought that the device address is updated to the resolved one in case of bonded devices using resolvable address, but I never actually tried it.&lt;/p&gt;
&lt;p&gt;Perhaps your device, when already bonded and connected, is using random address for advertising, not a private resolvable. It would only use the IRK and resolvable when not connected and trying to reach the bonded phone. But then, when connected to it, it could start using some random addresses to allow other devices to bond to it, and therefore Android cannot resolve them. I&amp;#39;m not an expert on embedded, so that&amp;#39;s more a question for Hung. What is the default behavior in this case in our SDKs?&lt;/p&gt;
&lt;p&gt;I can try to experiment with scanning for bonded devices using resolvable address and check which address is given to apps. Answering your question, there&amp;#39;s no any API on Android that could resolve the address for you if that does not work out of the box.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get resolvable private address on Android app when CONFIG_BT_PRIVACY=y configuration is used</title><link>https://devzone.nordicsemi.com/thread/312282?ContentTypeID=1</link><pubDate>Fri, 28 May 2021 07:30:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05a368d6-3d3a-4756-93ca-22f943514a95</guid><dc:creator>Cornel Gligan</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;Thank you for answering.&lt;/p&gt;
&lt;p&gt;In the application we keep an internal list of the already bonded devices so the app can easy re-connect to them.&lt;/p&gt;
&lt;p&gt;Also in the application we have a wizard to &amp;quot;onboard&amp;quot; new devices.&lt;/p&gt;
&lt;p&gt;So whenever when the app is scanning for BLE devices, the devices already bonded are found by the Android LE scanner as new devices with different bluetooth address. In this case the app will wrongly try to &amp;quot;onboard&amp;quot; an already bonded device.&lt;/p&gt;
&lt;p&gt;So this is what I want: a way to detect that the devices found by Android LE scanner are already bonded so to skip them and allow new devices to &amp;quot;onboard&amp;quot;.&lt;/p&gt;
&lt;p&gt;I am afraid that there is no way in Android app development APIs to resolve the resolvable private address.&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get resolvable private address on Android app when CONFIG_BT_PRIVACY=y configuration is used</title><link>https://devzone.nordicsemi.com/thread/312149?ContentTypeID=1</link><pubDate>Thu, 27 May 2021 13:57:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9e34f05-a786-4d31-af63-3f052b2f4993</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Cornel,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As you may already know when you turn on the&amp;nbsp;&lt;span&gt;CONFIG_BT_PRIVACY=y, the peripheral will advertise using random resolvable address. This address can be resolved using an IRK key.&amp;nbsp;&lt;br /&gt;&lt;/span&gt;Usually the central would be able to recognize the peripheral even if the peripheral change the address, if they have bonded before and the IRK key of the peripheral is exchanged to the central. This is called whitelisting.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But in your case you are doing the opposite, correct ? You want to avoid reconnect to the peripheral that you already bonded before.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not an expert in Android app development, but if you can scan and detect the device in the whitelist (address resolved), you can update it current address and avoid connecting to it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If getting active whitelisted device is not possible, you may need to think about having some extra data in the advertising packet that you can use to recognize if a device is connected to the phone prior or not. Or find away to send the IRK of the device to the app on the phone (after bonding) then the app can use the IRK to resolve the address on the app and can detect if it has connected to such peripheral before or not.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>