<?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>Default bonded device using nRF Connect SDK.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/113735/default-bonded-device-using-nrf-connect-sdk</link><description>Hi all , 
 
 I &amp;#39;m currently developping a BLE central with Zephyr and I need to create a default bonded device at startup (I know its address + IRK ) . 
 Using previous nRF SDK , the sub -system &amp;quot;peer _manager &amp;quot; could be used for this use case . 
 
 Is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 Aug 2024 14:16:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/113735/default-bonded-device-using-nrf-connect-sdk" /><item><title>RE: Default bonded device using nRF Connect SDK.</title><link>https://devzone.nordicsemi.com/thread/497502?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2024 14:16:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6840ca5a-923b-4b93-ba32-5edf1f2e36b6</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see. So only whitlisting (but with IRK to handle resolvable random addresses), but no bonding yet. In that case you have the problem with the limited API as described in the other thread, but the appraoch in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/98066/resolve-ble-address-using-zephry/433442"&gt;this post&lt;/a&gt; in the same thead seems to make sense.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Default bonded device using nRF Connect SDK.</title><link>https://devzone.nordicsemi.com/thread/497357?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2024 14:09:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71167671-e3ce-4a24-8bcb-737f639eef4b</guid><dc:creator>Mowa</dc:creator><description>&lt;p&gt;Yes, my bad, old project was using whitelisting with peer_manager.&lt;br /&gt;&lt;br /&gt;From what I can see, here is a sample pseudo-code that old project is running to create a default bond with targeted peripherals (I&amp;#39;m not the person who developped this project):&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/* Default Bond adding in peer manager */
static pm_peer_data_bonding_t bonding_data;
memset(&amp;amp;bonding_data, 0x00, sizeof(bonding_data));

bonding_data.own_role = BLE_GAP_ROLE_CENTRAL;
bonding_data.peer_ble_id.id_addr_info.addr_type = BLE_GAP_ADDR_TYPE_RANDOM_STATIC;
memcpy(bonding_data.peer_ble_id.id_addr_info.addr, targeted_peripheral_fake_addr, 6);
memcpy(bonding_data.peer_ble_id.id_info.irk, targeted_peripheral_IRK, 16);

ret = pm_peer_new(&amp;amp;new_peer_id, &amp;amp;bonding_data, NULL);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;After the creation, whitelist is loaded and direct connection is made.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_LOG_DEBUG(&amp;quot;Whitelist ok. Direct connexion.&amp;quot;);
m_scan_params.use_whitelist = 1;
m_scan_params.adv_dir_report = 0;

ret = sd_ble_gap_connect(NULL, &amp;amp;m_scan_params, &amp;amp;m_central_connection_param, APP_BLE_CONN_CFG_TAG);
APP_ERROR_HANDLER(ret);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Navigating through the devzone forum, i noticed someone had the same problem (as far as I can see) as me : &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/98066/resolve-ble-address-using-zephry"&gt;devzone.nordicsemi.com/.../resolve-ble-address-using-zephry&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Default bonded device using nRF Connect SDK.</title><link>https://devzone.nordicsemi.com/thread/497354?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2024 13:51:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92585838-d18a-48ce-bddc-9f12e4743664</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;As you mention the peer manager I assume the devices were pre-bonded, so it was not just that&amp;nbsp; you did whitelisting? So that you also have the LTK stored? If so, I am not aware of any way to handle that with Zephyr BLE APIs. However, it should be possible in a different way. I do not have an example for this, but conceptually you could make a dummy bond with some arbitrary device, and read out the flash region used by settings. Then make a script that modifies this, overwriting the address, IRK and LTK and potentially other peer related information with the data used for thie specific peer this device should be bonded with, and program that as a separate hex file in addition to the application. This cold be scripted so it sould work alson on a production line.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Default bonded device using nRF Connect SDK.</title><link>https://devzone.nordicsemi.com/thread/497336?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2024 12:22:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:727c3e39-adb0-485f-8040-54595ce9fe88</guid><dc:creator>Mowa</dc:creator><description>&lt;p&gt;Hi, thanks for your quick response !&lt;/p&gt;
&lt;p&gt;I already checked peripheral accept list example, and it seems that it&amp;#39;s not what I&amp;#39;m trying to achieve.&lt;br /&gt;&lt;br /&gt;Actually, I have devices that uses the same IRK, and the devices adresses are random. I need to be able to connect to these peripherals when they are in reach.&lt;br /&gt;&lt;br /&gt;The previous project that was using the same devices was based on the previous nRF SDK. This project was using &amp;quot;peer_manager&amp;quot; to create a default peer (random fake addr + known irk) at startup and then launched direct connection to this peer.&lt;/p&gt;
&lt;p&gt;I need to reproduce the same process, do you know if this is feasible with Zephyr BLE stack ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Default bonded device using nRF Connect SDK.</title><link>https://devzone.nordicsemi.com/thread/497330?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2024 12:08:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:acaa1716-b6a0-40e0-b6f5-d3a6d380ee4e</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If you know the address and IRK you can use filter accept list to only allow the pre-defined device to connect, and perform bonding on the first connection. You can refer to the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/samples/bluetooth/peripheral_accept_list/README.html"&gt;Bluetooth: Peripheral Accept List &lt;/a&gt;sample to see how it can be done (this is getting the address from an existing bond, but that is not a requierment).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>