<?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>NRF51-ble-peripheral-bond-handling example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8326/nrf51-ble-peripheral-bond-handling-example</link><description>When i setup DEVICE_MANAGER_MAX_BONDS in 2 and trying to connect third device the nRF 51422 (10028) is freezing and all LED&amp;#39;s light up. Why the algorithm in &amp;quot;device_manager_evt_handler&amp;quot; does&amp;#39;t work?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 08 Nov 2015 05:02:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8326/nrf51-ble-peripheral-bond-handling-example" /><item><title>RE: NRF51-ble-peripheral-bond-handling example</title><link>https://devzone.nordicsemi.com/thread/30147?ContentTypeID=1</link><pubDate>Sun, 08 Nov 2015 05:02:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f18a7bfb-e4ed-4d9d-a066-b734018af691</guid><dc:creator>GEO</dc:creator><description>&lt;p&gt;Thanks Vidar, i attach the code to line 679 and it work good.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51-ble-peripheral-bond-handling example</title><link>https://devzone.nordicsemi.com/thread/30151?ContentTypeID=1</link><pubDate>Thu, 23 Jul 2015 14:06:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22541f36-9d6f-4e74-9623-4dfaf0a3271a</guid><dc:creator>GEO</dc:creator><description>&lt;p&gt;I am reinstalled SDK, download NRF51-ble-peripheral-bond-handling example and copying to the ble_peripheral examples folder, then opened project in arm5_no_packs (Keil 5.15), set DEVICE_MANAGER_MAX_BONDS == 2 (was 8) in  device_manager_cnfg.h  start debug mode and connect device -&amp;gt; called the device_manager_evt_handler() with DM_EVT_DEVICE_CONTEXT_STORED event...  In normal operation mode (without debug) the application freeze when i connect third device&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51-ble-peripheral-bond-handling example</title><link>https://devzone.nordicsemi.com/thread/30150?ContentTypeID=1</link><pubDate>Thu, 23 Jul 2015 12:36:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fadc17f-ef29-42c9-a75d-e0dc92c81648</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for the update. The error you are seeing originates from app_bond.c at line 78 and indicates that an invalid address is supplied to dm_application_context_set(). That is , p_handle-&amp;gt;device_id does not exist in the bond table.&lt;/p&gt;
&lt;p&gt;Are you doing anything different in you app compared to the one posted on Github?  Is the app_bond_update_context();  for instance called on DM_EVT_DEVICE_CONTEXT_STORED event?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51-ble-peripheral-bond-handling example</title><link>https://devzone.nordicsemi.com/thread/30149?ContentTypeID=1</link><pubDate>Thu, 23 Jul 2015 12:11:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d66dd8e-1acb-4da8-b968-f8c3b67a0107</guid><dc:creator>GEO</dc:creator><description>&lt;p&gt;m_error_code == 0x00008010;
m_line_num == 0x0000004E;
m_p_file_name == 0x00018D94 &amp;quot;...\app_bond.c&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51-ble-peripheral-bond-handling example</title><link>https://devzone.nordicsemi.com/thread/30148?ContentTypeID=1</link><pubDate>Thu, 23 Jul 2015 10:21:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:115aeb12-c51a-4169-b17c-676a8827ef13</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I meant to say the values passed to the app_error_handler: uint32_t error_code, uint32_t line_num and const uint8_t * p_file_name.&lt;/p&gt;
&lt;p&gt;Just right click on the variables and add to watch while debugging like shown in the screenshot below.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0488.debug.PNG" alt="debug" /&gt;&lt;/p&gt;
&lt;p&gt;UPDATE 24.07.2015 #1&lt;/p&gt;
&lt;p&gt;I have not been able to recreate the problem on my end. Please try with the application that I compiled here where max bonds is set to &amp;#39;2&amp;#39; and see if it still asserts: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/3644.nrf51422_5F00_xxac_5F00_s110.hex"&gt;nrf51422_xxac_s110.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can use nrfgo studio to program it. First, make sure to do a full erase first to clear any existing bonds, then program s110 v.8.0.0 and then the attached application.&lt;/p&gt;
&lt;p&gt;UPDATE 24.07.2015 #2&lt;/p&gt;
&lt;p&gt;Ok, was able to recreate the issue now. I have been using iOS devices when testing the code here which  use private resolvable addresses as opposed to static ones with  older versions of Android.&lt;/p&gt;
&lt;p&gt;Please try to replace &amp;#39;table_index.mr_cnt_val++;&amp;#39;  at line ~679 in main.c with the following lines:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    if(table_index.mr_index != p_handle-&amp;gt;device_id)
    {
        //Increment counter variable for last bond for the new device
        table_index.mr_cnt_val++;
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;UPDATE 25.07.2015&lt;/p&gt;
&lt;p&gt;Uploaded fix to &lt;a href="https://github.com/NordicSemiconductor/nRF51-ble-peripheral-bond-handling"&gt;nRF51-ble-peripheral-bond-handling&lt;/a&gt; on Github which  should work for more than two bonds as well.&lt;/p&gt;
&lt;p&gt;The other error you got is actually an event result from the DM telling the application that pairing failed with 0x00000081 (BLE_GAP_SEC_STATUS_PASSKEY_ENTRY_FAILED). In other words, it seems like iOS may require MITM protection if you do bonding in settings-&amp;gt;Bluetooth rather than doing it in the nRFtoolbox app.To avoid this you can use nRFtoolbox instead. Just make sure to clear the existing bond Bluetooth settings reboot the phone first to stop it from reconnecting outside the app.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51-ble-peripheral-bond-handling example</title><link>https://devzone.nordicsemi.com/thread/30146?ContentTypeID=1</link><pubDate>Thu, 23 Jul 2015 09:33:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b39465a3-ed3f-4924-81e0-20378234c9cb</guid><dc:creator>GEO</dc:creator><description>&lt;p&gt;Thank you very much for you good support...For enhancement this example i want to write in bond table devices which i want (for example, when the button is pressed before the connecting/bonding with needed device) only. Other devices should not storing in my device (without press the button), how it possible with this example?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51-ble-peripheral-bond-handling example</title><link>https://devzone.nordicsemi.com/thread/30145?ContentTypeID=1</link><pubDate>Wed, 22 Jul 2015 16:16:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34fa7ff8-7563-46b0-8de7-113e6c79d3dd</guid><dc:creator>GEO</dc:creator><description>&lt;p&gt;\SDK\components\libraries\util\app_error.c in line 84 (while(loop))&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51-ble-peripheral-bond-handling example</title><link>https://devzone.nordicsemi.com/thread/30144?ContentTypeID=1</link><pubDate>Wed, 22 Jul 2015 15:08:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72ea5e48-5f2c-4a44-94f0-f2b6a8561ec8</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi, please read out the line number and file name as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51-ble-peripheral-bond-handling example</title><link>https://devzone.nordicsemi.com/thread/30143?ContentTypeID=1</link><pubDate>Wed, 22 Jul 2015 15:01:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ab413d5-d341-4249-9890-615376de427c</guid><dc:creator>GEO</dc:creator><description>&lt;p&gt;After bonding third device nRF51422 stoped on &amp;quot;while(loop)&amp;quot; in function &amp;quot;__WEAK void app_error_handler()&amp;quot; in app_error.c files with the m_error_code == 0x00008010 in the debuging mode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51-ble-peripheral-bond-handling example</title><link>https://devzone.nordicsemi.com/thread/30142?ContentTypeID=1</link><pubDate>Wed, 22 Jul 2015 12:06:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8622729-b18b-45e8-904e-c12d111f0afe</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;What error code are you getting?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>