<?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>Peer manager issue: bond, rank &amp;amp; delete</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/48310/peer-manager-issue-bond-rank-delete</link><description>Hi, I&amp;#39;m using SDK15.3 on a NRF52840 chip and have some questions wrt to the peer manager and its ranking system. Once we bond with a peer, we print the full list of peers using: 
 Each time, we get a new device to be bonded, we rank this peer ID as highest</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Jun 2019 08:03:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/48310/peer-manager-issue-bond-rank-delete" /><item><title>RE: Peer manager issue: bond, rank &amp; delete</title><link>https://devzone.nordicsemi.com/thread/193083?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2019 08:03:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9cfcce7a-98e0-4bd2-8d9d-3ead737c748a</guid><dc:creator>RoyCreemers</dc:creator><description>&lt;p&gt;Thanks for the quick reply. I verified the fix and it indeed solves the issue!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peer manager issue: bond, rank &amp; delete</title><link>https://devzone.nordicsemi.com/thread/193073?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2019 07:42:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c6c144d-c8f2-41c9-9ee1-9a9b5b6819b7</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Here is the fix:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Inside rank_vars_update() in peer_manager.c&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt; if (err_code == NRF_ERROR_NOT_FOUND)
    {
        m_highest_ranked_peer = PM_PEER_ID_INVALID;
        m_current_highest_peer_rank = 0;
    }&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peer manager issue: bond, rank &amp; delete</title><link>https://devzone.nordicsemi.com/thread/192965?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2019 14:27:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e45d152-9b1a-4032-b1c0-76e07535298c</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;It seems to be a bug. I have reported this and we are looking into it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peer manager issue: bond, rank &amp; delete</title><link>https://devzone.nordicsemi.com/thread/192942?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2019 13:27:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22388a9f-443d-4276-82c4-1eb231e0392e</guid><dc:creator>RoyCreemers</dc:creator><description>&lt;p&gt;Till now we did not, but I added this in code, and it returns NRF_ERROR_NOT_FOUND. Is it expected that data is stored without the ranking information?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peer manager issue: bond, rank &amp; delete</title><link>https://devzone.nordicsemi.com/thread/192935?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2019 13:05:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:caee895d-d691-482b-a281-5710b4ec92c1</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Could you check the return value of pm_peer_data_load()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peer manager issue: bond, rank &amp; delete</title><link>https://devzone.nordicsemi.com/thread/192318?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 10:54:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9013ebb3-184c-4e8f-a77a-f1119a5075ba</guid><dc:creator>oguzcan oguz</dc:creator><description>&lt;p&gt;Hello, i am answering on behalf of my colleague Roy,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It happens with any peer, not necessarily the same. We observe that the very first peer to bond after deleting all the bonds is assigned with rank with an unexpected value. If we restart the device after deleting all the bonds and then bond with a peer, then we don&amp;#39;t observe the issue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;pm_peers_delete returns success and after that we&amp;nbsp;see the following SDK logs(for 2 bonds):&lt;/span&gt;&lt;/p&gt;
&lt;p style="font-family:Calibri;font-size:11.0pt;margin:0in;"&gt;NRF_LOG: &amp;lt;info&amp;gt; peer_manager_handler: Peer deleted successfully: peer_id: 0&lt;/p&gt;
&lt;p style="font-family:Calibri;font-size:11.0pt;margin:0in;"&gt;NRF_LOG: &amp;lt;info&amp;gt; peer_manager_handler: Peer deleted successfully: peer_id: 1&lt;/p&gt;
&lt;p style="font-family:Calibri;font-size:11.0pt;margin:0in;"&gt;NRF_LOG: &amp;lt;info&amp;gt; peer_manager_handler: All peers deleted.&lt;/p&gt;
&lt;p style="font-family:Calibri;font-size:11.0pt;margin:0in;"&gt;NRF_LOG: &amp;lt;info&amp;gt; peer_manager_handler: Peer deleted successfully: peer_id: 1&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Peer manager issue: bond, rank &amp; delete</title><link>https://devzone.nordicsemi.com/thread/192288?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 09:10:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d24916a-d7bc-4742-9500-1240b332ebe3</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It seems to be correct the way you do it. Have you tried bond with another peer after you delete all peers? Does the same issue occur? Does it only happen when you bond with the same peer after deleting?&lt;/p&gt;
&lt;p&gt;Does&amp;nbsp;&lt;span&gt;pm_peers_delete return success?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>