<?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>Overwriting bond information reliably</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15155/overwriting-bond-information-reliably</link><description>Hi, 
 I have a situation where our central device needs to be paired atmost with 1 peripheral. I can put a central device into repairing mode for 3 minutes. Within this time if another peripheral is found it shud connect and store bond information. If</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 10 Aug 2016 12:47:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15155/overwriting-bond-information-reliably" /><item><title>RE: Overwriting bond information reliably</title><link>https://devzone.nordicsemi.com/thread/57866?ContentTypeID=1</link><pubDate>Wed, 10 Aug 2016 12:47:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ed2a578-965c-4c05-8bd8-17f208d7fbd7</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;You will have to use &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk51.v10.0.0/group__dm__cntxt__mgmt__api.html#gaf267e34f237c41665fd9df15dd32c531"&gt;dm_device_delete&lt;/a&gt; or &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk51.v10.0.0/group__dm__cntxt__mgmt__api.html#ga677524b3230bd620c91a83e4f68e3e01"&gt;dm_device_delete_all&lt;/a&gt; to delete the old bonding information, then wait for the &lt;code&gt;DM_EVT_DEVICE_CONTEXT_DELETED&lt;/code&gt; event and then call &lt;code&gt;dm_security_setup_req()&lt;/code&gt; to to bond with the new device.&lt;/p&gt;
&lt;p&gt;Alternatively, you could increase &lt;code&gt;DEVICE_MANAGER_MAX_BONDS&lt;/code&gt; to 2 so that you can bond to both devices. After the new device has bonded successfully you can delete the bonding information to the old device. This requires some “bookkeeping” as you will have to make sure that you only allow two devices to be bonded to the central when it’s in “repair-mode” and only one when it’s in its normal operating mode.&lt;/p&gt;
&lt;p&gt;I suggest that you take a look at &lt;a href="https://github.com/NordicSemiconductor/nRF51-ble-peripheral-bond-handling"&gt;this&lt;/a&gt; GitHub repo, it contains an example on how to delete the oldest bond information.&lt;/p&gt;
&lt;p&gt;-Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>