<?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>How to delete the bond info when connected with 51822</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1897/how-to-delete-the-bond-info-when-connected-with-51822</link><description>Hi nordic engineer: 
 I want to know the right process to delete the bonds when the device connected.

There is a button used for bonding. When it pressing by more than 3 seconds, it should go into a bond process, no matter it was connected or not</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 28 Mar 2014 07:44:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1897/how-to-delete-the-bond-info-when-connected-with-51822" /><item><title>RE: How to delete the bond info when connected with 51822</title><link>https://devzone.nordicsemi.com/thread/8167?ContentTypeID=1</link><pubDate>Fri, 28 Mar 2014 07:44:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10355050-91ac-4ff2-8d52-9268cb1184ad</guid><dc:creator>jimlin</dc:creator><description>&lt;p&gt;Hi Morten,&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;What you said is correct.
I can&amp;#39;t find what the proper conn_handle is from the SDK document. Could you show me what value is correct?
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to delete the bond info when connected with 51822</title><link>https://devzone.nordicsemi.com/thread/8166?ContentTypeID=1</link><pubDate>Wed, 19 Mar 2014 11:19:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddc34dfa-4594-4f35-aa5c-dd0046fde282</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;I didn&amp;#39;t notice at first, but it&amp;#39;s illegal to pass BLE_CONN_HANDLE_INVALID to sd_ble_gap_disconnect(). You&amp;#39;ll most likely get a 0x3001 error code back; BLE_ERROR_INVALID_CONN_HANDLE. I therefore suspect that the HardFault you see in fact doesn&amp;#39;t come from the disconnect call itself, but from the app_error_handler. Please try passing a proper conn_handle to the disconnect function, and try fixing your error handler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to delete the bond info when connected with 51822</title><link>https://devzone.nordicsemi.com/thread/8165?ContentTypeID=1</link><pubDate>Wed, 19 Mar 2014 08:35:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96b8ed6f-5c90-4ddf-9646-7ab5d16e5f1f</guid><dc:creator>jimlin</dc:creator><description>&lt;p&gt;I set the timer interrupt as P3 which is the lowest priority, and call the BLE_GAP_DISCONNECT() when interrupt occured. But it still got the HardFault???&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to delete the bond info when connected with 51822</title><link>https://devzone.nordicsemi.com/thread/8168?ContentTypeID=1</link><pubDate>Mon, 17 Mar 2014 15:25:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd8479d5-1fa2-4ed1-90a1-efa0a30931ff</guid><dc:creator>jimlin</dc:creator><description>&lt;p&gt;OK
I will check the priority to validate it .&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to delete the bond info when connected with 51822</title><link>https://devzone.nordicsemi.com/thread/8164?ContentTypeID=1</link><pubDate>Mon, 17 Mar 2014 15:15:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98c7622f-68c0-49e8-a0a3-a8be34756af1</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;If you get a HardFault, I suspect what you see is this: &lt;a target="_blank" href="https://devzone.nordicsemi.com/index.php/how-to-redefine-ppi-tasks-inside-a-timer-interrupt" rel="nofollow"&gt;https://devzone.nordicsemi.com/index.php/how-to-redefine-ppi-tasks-inside-a-timer-interrupt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Bottom line is that you can&amp;#39;t call softdevice API functions from APP_HIGH interrupts, so you can for example use the scheduler to transfer the event to the main loop.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to delete the bond info when connected with 51822</title><link>https://devzone.nordicsemi.com/thread/8163?ContentTypeID=1</link><pubDate>Mon, 17 Mar 2014 15:00:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a512f84-594a-42a5-8ae9-1c1230ff73bc</guid><dc:creator>jimlin</dc:creator><description>&lt;p&gt;Hi    Morten,&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Thanks for your answer.

I prefer to use the second way for the ram would be cleaned while reset.

But, when call the sd_ble_gap_disconnect() as follow, it still got the HardFault by simulating.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;[i] if(bind_info_clear == true)
{
BLE_GAP_DISCONNECT();
}[/i]&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;and BLE_GAP_DISCONNECT() define as:
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;[i]#define	BLE_GAP_DISCONNECT()						&lt;br /&gt;
do																			&lt;br /&gt;
{																				&lt;br /&gt;
uint32_t	err_code;										&lt;br /&gt;
uint16_t m_conn_handle = BLE_CONN_HANDLE_INVALID;							&lt;br /&gt;
err_code = sd_ble_gap_disconnect(m_conn_handle, 							&lt;br /&gt;
BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);	&lt;br /&gt;
APP_ERROR_CHECK(err_code);						&lt;br /&gt;
}while(0)[/i]&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Is there anything wrong?
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to delete the bond info when connected with 51822</title><link>https://devzone.nordicsemi.com/thread/8162?ContentTypeID=1</link><pubDate>Mon, 17 Mar 2014 10:34:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87288f12-bf36-40cb-8c0f-19f0aa3d52c3</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;The easiest way to do this is actually to just do a reset after 3 s, check the button on power up and if it&amp;#39;s pressed, go into limited advertising mode, potentially first erasing old bond information (the latter may not be needed, as the nRF51822 is capable of having multiple bonds, but if you do, you&amp;#39;ll have to make sure to handle the situation with full bond storage properly).&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t want to reset for whatever reason, you don&amp;#39;t really have to disable the softdevice; you can just call sd_ble_gap_disconnect() and then restart advertising with whatever parameters you want when you get the BLE_GAP_EVT_DISCONNECTED event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>