<?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>Keyboard example got reset after disconnect</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/6756/keyboard-example-got-reset-after-disconnect</link><description>Hi there, 
 When i disconnect the keyboard, the nrf51822 will restart advertising in directed mode. 
 And then on_adv_evt() will receive BLE_ADV_EVT_PEER_ADDR_REQUEST event to getting a peer&amp;#39;s device address. 
 But dm_peer_addr_get() return an error</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Apr 2015 02:55:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/6756/keyboard-example-got-reset-after-disconnect" /><item><title>RE: Keyboard example got reset after disconnect</title><link>https://devzone.nordicsemi.com/thread/23726?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2015 02:55:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ea5d1e8-f2ed-4256-89a3-cc9c44e2a56c</guid><dc:creator>harry.jiang</dc:creator><description>&lt;p&gt;Thanks for your help. It is good for me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Keyboard example got reset after disconnect</title><link>https://devzone.nordicsemi.com/thread/23725?ContentTypeID=1</link><pubDate>Tue, 28 Apr 2015 08:47:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff054df3-6315-492a-9100-298529369649</guid><dc:creator>H&amp;#229;vard</dc:creator><description>&lt;p&gt;In the unaltered keyboard example, a failed attempt to fetch the peer address is followed by a
&lt;code&gt;APP_ERROR_CHECK(err_code);&lt;/code&gt;
This will assert on any error. Have you tried changing it so that a failed attempt to retrieve the peer address will just ignore the reply instead of asserting?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;            err_code = dm_peer_addr_get(&amp;amp;m_bonded_peer_handle, &amp;amp;peer_address);
            if(err_code == NRF_SUCCESS)
            {
                err_code = ble_advertising_peer_addr_reply(&amp;amp;peer_address);
                APP_ERROR_CHECK(err_code);
            }
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>