<?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>SDK15 paring problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37837/sdk15-paring-problem</link><description>Hi nordic, 
 
 I am using SDK15.0 (NRF52840) to design a watch producation which needs pairing. I have a problem that if NRF52840 (peripheral ) has been paired with a smartphone (central), and then I remove the bonded deivce on smartphone side and try</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 14 Feb 2020 20:09:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37837/sdk15-paring-problem" /><item><title>RE: SDK15 paring problem</title><link>https://devzone.nordicsemi.com/thread/234501?ContentTypeID=1</link><pubDate>Fri, 14 Feb 2020 20:09:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0350bfed-4c47-43b8-bae5-5b77e08796d1</guid><dc:creator>RTMerkel</dc:creator><description>&lt;p&gt;Einar,&lt;/p&gt;
&lt;p&gt;How would this (not allowing re-pairing)&amp;nbsp;work in the field? For example&amp;nbsp;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Customer has paired and bounded their phone to with a device&amp;hellip; all is right with the world.&lt;/li&gt;
&lt;li&gt;Customer accidently tells their phone to &amp;ldquo;forget&amp;rdquo; the device, now the mobile application can no longer talk to the handle. Customer is not amused.&lt;/li&gt;
&lt;li&gt;I suppose that the App might be able to detect a connection error and tell the user to do something that would clear all the bounding data on the handle, like putting the handle on a charger, and pressing a button 10 times... but yuck.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Suggestions?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15 paring problem</title><link>https://devzone.nordicsemi.com/thread/145875?ContentTypeID=1</link><pubDate>Mon, 27 Aug 2018 09:29:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f975ce12-f070-4b97-844a-04f69e168a34</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1. A bond is typically about 38 words (152 bytes), but it can be a bit higher with multiple CCCDs.&lt;/p&gt;
&lt;p&gt;2. The Peer manager will replace the existing bond in this case.&lt;/p&gt;
&lt;p&gt;3. The application will get a&amp;nbsp;&lt;code&gt;PM_EVT_STORAGE_FULL&lt;/code&gt; event from the peer manager if it is unable to store a bond due to full FDS. The examples will do a FDS garbage collection at that point, but it will only free space if some data has already been marked as deleted. You can free more space by deleting the oldest peer first. (Generally managing bonds is up to the application, but the peer manager provides the necessary tools with &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.1.0/group__peer__manager.html?cp=4_0_0_6_2_15"&gt;API functions&lt;/a&gt; like&amp;nbsp;&lt;code&gt;pm_peer_count()&lt;/code&gt;,&amp;nbsp;&lt;code&gt;pm_peer_ranks_get()&lt;/code&gt;, &lt;code&gt;pm_peer_delete()&lt;/code&gt; etc.)&lt;/p&gt;
&lt;p&gt;4. Yes, you can delete a specific bond as you suggest. However, there are no API for searching for peers with a specific BT address or similar. You could implement that yourself though (but I fail to see the typical use case for such a feature). Typically you would want to delete the oldest peer (longest time since it was connected) if you run out of storage for bonding information. This is handled by ranking peers by when they were last seen, as is done in the SDK examples.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15 paring problem</title><link>https://devzone.nordicsemi.com/thread/145858?ContentTypeID=1</link><pubDate>Mon, 27 Aug 2018 08:55:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86185042-e190-4370-a5e9-69dc6e4e0f44</guid><dc:creator>Bing</dc:creator><description>&lt;p&gt;Thanks for your reply. The anwsers&amp;nbsp;are very helpful for me.&amp;nbsp; I checked the default configuration for&amp;nbsp;&lt;span&gt;FDS_VIRTUAL_PAGES is 3. And one of the virtual page is used for&amp;nbsp;garbage collection by system. So there is just 2 virtual pages can store bonding information.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I want to know more:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1 How many bytes a bond is? If FDS is just used to store bonding information? How many bonds can be stored?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2 If I set the pm_conn_sec_config_t::allow_repairing to true, when repairing, will the peer manager allocate a new postion or search the original postion for this bond?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3 If stored bonds arrive the maximum number, when the next peer device pairs with this deivce, what will happen?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;4 Whether I can delete a specified bond by call&amp;nbsp;pm_peer_delete(pm_peer_id_t peer_id)? And I want to know how to obtain the peer_id for all of the bonds stored or a specified bonds identified by something (for example, bt address)?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15 paring problem</title><link>https://devzone.nordicsemi.com/thread/145821?ContentTypeID=1</link><pubDate>Mon, 27 Aug 2018 07:43:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c69fa332-c689-4921-85e8-d9c454460ce2</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Wang,&lt;/p&gt;
&lt;p&gt;The Peer manager in SDK 15 does not allow re-pairing by default. This means that it will reject a pairing request from an already bonded peer, which is what you are seeing.&lt;/p&gt;
&lt;p&gt;1. You can allow repairing by setting&amp;nbsp;&lt;code&gt;allow_repairing&lt;/code&gt;&amp;nbsp;to&amp;nbsp;&lt;code&gt;true&lt;/code&gt;&amp;nbsp;in the&amp;nbsp;&lt;code&gt;pm_conn_sec_config_t&lt;/code&gt;&amp;nbsp;that you pass to&amp;nbsp;&lt;code&gt;pm_conn_sec_config_reply&lt;/code&gt;&amp;nbsp;in the handling of the&amp;nbsp;&lt;code&gt;PM_EVT_CONN_SEC_CONFIG_REQ&lt;/code&gt;&amp;nbsp;event. For&amp;nbsp;instance&amp;nbsp;like this (Modified from rom the ble_app_hrs example in SDK 15.0):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        case PM_EVT_CONN_SEC_CONFIG_REQ:
        {
            // Reject pairing request from an already bonded peer.
            pm_conn_sec_config_t conn_sec_config = {.allow_repairing = true};
            pm_conn_sec_config_reply(p_evt-&amp;gt;conn_handle, &amp;amp;conn_sec_config);
        } break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;2. The bond manager and peer manager are different in many ways (totally different libraries, though both handle paring and bonding). The relevant difference in this case is that the examples in SDK 15 don&amp;#39;t allow re-pairing by default in order to be more secure, but this can be changed by the application developer if needed (as above) if user friendliness is more important than security (which it often is in practice).&lt;/p&gt;
&lt;p&gt;3. The Peer manager does not have a fixed maximum number of bonds. However, it will be limited by the available space in FDS (flash), which you can configure by setting&amp;nbsp;&lt;code&gt;FDS_VIRTUAL_PAGES&lt;/code&gt;&amp;nbsp;in&amp;nbsp;&lt;code&gt;sdk_config.h&lt;/code&gt;. You can achieve a fixed number if you like by checking the number of peer using&amp;nbsp;&lt;code&gt;pm_peer_count()&lt;/code&gt;&amp;nbsp;every time a new bond is made, and delete the oldest pair if the number is higher than the limit you would like.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>