<?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>[S110][nrf51822] Device Manager getting bonded devices</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/11093/s110-nrf51822-device-manager-getting-bonded-devices</link><description>How can I read list of bonded devices from flash with using Device Manager ?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Jan 2016 13:59:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/11093/s110-nrf51822-device-manager-getting-bonded-devices" /><item><title>RE: [S110][nrf51822] Device Manager getting bonded devices</title><link>https://devzone.nordicsemi.com/thread/41515?ContentTypeID=1</link><pubDate>Mon, 11 Jan 2016 13:59:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b48e36f-6e4a-4847-a0f0-13ad083ff2b1</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;dm_peer_addr_get() is normally used when you want to do get one address to do directed advertising, not with whitelisting, and will only return device address, not IRK. What kind of devices have bonded to? I suspect you have bonded to devices with private resolvable addresses, so the device addresses are not relevant, but the IRKs are. I&amp;#39;m not sure why you get 0 IRKs. Could you use the debugger to see what is happening inside dm_whitelist_create()? And for deletion of the oldest bond please have a look at &lt;a href="https://github.com/NordicSemiconductor/nRF51-ble-peripheral-bond-handling"&gt;this&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [S110][nrf51822] Device Manager getting bonded devices</title><link>https://devzone.nordicsemi.com/thread/41517?ContentTypeID=1</link><pubDate>Sun, 10 Jan 2016 15:40:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca6ba506-571a-4b18-ad2f-77a576707a47</guid><dc:creator>paulus</dc:creator><description>&lt;p&gt;I&amp;#39;m using SDK 10 (nRF51_SDK_10.0.0_dc26b5e)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [S110][nrf51822] Device Manager getting bonded devices</title><link>https://devzone.nordicsemi.com/thread/41516?ContentTypeID=1</link><pubDate>Sun, 10 Jan 2016 13:27:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f2b44df-6f78-44de-ada9-f79de09628b3</guid><dc:creator>wlgrd</dc:creator><description>&lt;p&gt;I know this is done in the reference designs for desktop and remote, so it should be doable without messing with the SDK internals. What SDK version do you use?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [S110][nrf51822] Device Manager getting bonded devices</title><link>https://devzone.nordicsemi.com/thread/41514?ContentTypeID=1</link><pubDate>Sat, 09 Jan 2016 15:16:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4174f1d6-751c-4aac-a5e1-d3ee599b14aa</guid><dc:creator>paulus</dc:creator><description>&lt;p&gt;Unfortunatelly it does not work. I have 3 bonded devices but this function returns 0 for fields pp_addrs and pp_irks.
This is my code located in function &lt;strong&gt;device_manager_evt_handler&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    if (p_event-&amp;gt;event_id ==  DM_EVT_DEVICE_CONTEXT_LOADED)
    {
	   ble_gap_addr_t    *pp_addrs[DEVICE_MANAGER_MAX_BONDS]; 
      ble_gap_irk_t       *pp_irks[DEVICE_MANAGER_MAX_BONDS];

   ble_gap_whitelist_t  whitelist;
   memset(&amp;amp;whitelist, 0, sizeof(whitelist));
   whitelist.pp_addrs = pp_addrs;
   whitelist.pp_irks = pp_irks;

   err_code = dm_whitelist_create(&amp;amp;m_app_handle, &amp;amp;whitelist);
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Also I was trying to do this by using &lt;strong&gt;dm_peer_addr_get&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;for (int i=0; i&amp;lt; DEVICE_MANAGER_MAX_BONDS; i++)
{
	dm_handle_t dHandle;
	dHandle.appl_id = 1;
	dHandle.device_id = i;
	dHandle.connection_id = 0;
	
	ble_gap_addr_t gapAddr;
	err_code = dm_peer_addr_get(&amp;amp;dHandle,  &amp;amp;gapAddr);
	
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And I&amp;#39;ve found the issue inside &lt;strong&gt;dm_peer_addr_get&lt;/strong&gt;
For all bonded devices I have id_bitmap = 0xFE, ADDR_ENTRY = 0x02 and in result below block is never beeing executed.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    if ((m_peer_table[p_handle-&amp;gt;device_id].id_bitmap &amp;amp; ADDR_ENTRY) == 0)
    {
        DM_TRC(&amp;quot;[DM]:[DI 0x%02X]: Address get for bonded device.\r\n&amp;quot;,
               p_handle-&amp;gt;device_id);

        (*p_addr) = m_peer_table[p_handle-&amp;gt;device_id].peer_id.id_addr_info;
        err_code  = NRF_SUCCESS;
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/4428.watch.png" alt="image description" /&gt;&lt;/p&gt;
&lt;p&gt;I can make a list of devices by making changes in device_manager_peripheral.c file. But I don&amp;#39;t want to touch SDK files. My goal is to count bonded devices. Because I want to make something like circular bonding. For example during bonding 5th device I want to delete the oldest one.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [S110][nrf51822] Device Manager getting bonded devices</title><link>https://devzone.nordicsemi.com/thread/41513?ContentTypeID=1</link><pubDate>Mon, 04 Jan 2016 14:33:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc4d63a3-8c0d-4ccf-aa2f-5f0ffa2b444a</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;You can use dm_whitelist_create() to get a list of addresses and IRKs to currently bonded devices.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>