<?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>nrf51822 restarting after wrong passkey from an iOS device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15854/nrf51822-restarting-after-wrong-passkey-from-an-ios-device</link><description>Hi! 
 We are having problems with pairing &amp;amp; bonding procedures with iOS devices. 
 On the peripheral side we are using a nrf51822 BLE module on which we are testing pairing/bonding with the ble_app_gls example. We are using the example from the 8.0</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 19 Aug 2016 12:53:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15854/nrf51822-restarting-after-wrong-passkey-from-an-ios-device" /><item><title>RE: nrf51822 restarting after wrong passkey from an iOS device</title><link>https://devzone.nordicsemi.com/thread/60518?ContentTypeID=1</link><pubDate>Fri, 19 Aug 2016 12:53:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92152c97-857d-42d8-83af-f20e44c4c558</guid><dc:creator>J&amp;#248;rgen Kvalvaag</dc:creator><description>&lt;p&gt;No, that would not be a good solution. I was answering for the use of the DEBUG flag on a general basis. As for the application in question, I am not sure if the wrong_key_entered-&amp;gt;assert-&amp;gt;reset is intentional or not, as this is a single-link example i guess it could be a working but not-very-clean solution. A working solution for your case could be to handle this case in some way, eg check the &lt;code&gt;event_result&lt;/code&gt; for BLE_GAP_SEC_STATUS_CONFIRM_VALUE and perform a disconnect in this case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 restarting after wrong passkey from an iOS device</title><link>https://devzone.nordicsemi.com/thread/60517?ContentTypeID=1</link><pubDate>Fri, 19 Aug 2016 12:08:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c32feb30-f7db-43ab-bac3-ba0d7ab753ba</guid><dc:creator>KlevioRok</dc:creator><description>&lt;p&gt;So the normal mode of operation is that the device resets everytime any user that is trying to connect enters the wrong key? Or am I missing something? What if other users are connceted and are recieving some data for instance. What to do in these cases?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 restarting after wrong passkey from an iOS device</title><link>https://devzone.nordicsemi.com/thread/60516?ContentTypeID=1</link><pubDate>Fri, 19 Aug 2016 11:56:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ef48f14-a163-4e6a-92dd-b004e2245310</guid><dc:creator>J&amp;#248;rgen Kvalvaag</dc:creator><description>&lt;p&gt;The general idea is that during your product development cycle, you will have the DEBUG flag set, and all errors will cause the app to stop, so you can inspect/debug. But when it&amp;#39;s time to make the released product the debug flag is removed. Whenever an assert is encountered in a product at your customer, the only safe thing to do is reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 restarting after wrong passkey from an iOS device</title><link>https://devzone.nordicsemi.com/thread/60515?ContentTypeID=1</link><pubDate>Fri, 19 Aug 2016 10:54:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6926650-a7eb-4115-87e3-24df4fde685c</guid><dc:creator>KlevioRok</dc:creator><description>&lt;p&gt;Thank you for the fast response. It was very helpful.&lt;/p&gt;
&lt;p&gt;The error happens here:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    static uint32_t device_manager_evt_handler(dm_handle_t const    * p_handle,
                                               dm_event_t const     * p_event,
                                               ret_code_t        event_result)
    {
        uint32_t err_code = NRF_SUCCESS;
    
        m_dm_handle = *p_handle;
--&amp;gt;    APP_ERROR_CHECK(event_result);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The error is BLE_GAP_SEC_STATUS_CONFIRM_VALUE, which is, as I understand it, as expected.&lt;/p&gt;
&lt;p&gt;Can you give me any thoughts on what is usually done to prevent the resets in these cases?
Should we expand the APP_ERROR_CHECK macro to support this cases or avoid using it when this error occurs. Thank you very much for your help.&lt;/p&gt;
&lt;p&gt;Kind regards, Rok from Klevio&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 restarting after wrong passkey from an iOS device</title><link>https://devzone.nordicsemi.com/thread/60514?ContentTypeID=1</link><pubDate>Fri, 19 Aug 2016 09:36:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b399cf10-0c54-4fea-90ea-c56f8b7044f8</guid><dc:creator>J&amp;#248;rgen Kvalvaag</dc:creator><description>&lt;p&gt;On SDK 8, I believe the default behaviour on any error/assert is to perform a reset.&lt;/p&gt;
&lt;p&gt;If you add the compile flag DEBUG it should halt in the assert handler, where you can see file&amp;amp;line number where the assert occurred. You could also set a breakpoint in the assert handler and see if it hits.&lt;/p&gt;
&lt;p&gt;There should not, to my knowledge, be any other reason for going into reset in this case.&lt;/p&gt;
&lt;p&gt;SDK 11 will halt in the reset handler by default. If you want to try SDK11 there is also gcc makefiles included.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>