<?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>Deleting peers</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/68662/deleting-peers</link><description>Hi 
 I have a question about peers deleting. 
 It is saying in documentation about pm_peer_delete: 
 &amp;quot;Warning Use this function only when not connected to or connectable for the peer that is being deleted. If the peer is or becomes connected or data is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 Jan 2021 07:53:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/68662/deleting-peers" /><item><title>RE: Deleting peers</title><link>https://devzone.nordicsemi.com/thread/289621?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2021 07:53:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b0410dc-b509-43eb-a560-dedfe73849d6</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t notice that it&amp;#39;s the same file_id that&amp;#39;s deleted, but that&amp;#39;s strange indeed. I also see that you start scanning&amp;nbsp;&lt;strong&gt;before&lt;/strong&gt; the peers are deleted successfully. Can you please try waiting to start the radio until the PM_EVT_PEER_DELETE_SUCCEEDED event has occurred to avoid the undefined state I mentioned.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deleting peers</title><link>https://devzone.nordicsemi.com/thread/289381?ContentTypeID=1</link><pubDate>Fri, 15 Jan 2021 10:21:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b9a379b-3b45-41ca-a264-9afff724b336</guid><dc:creator>DmitrySol</dc:creator><description>&lt;p&gt;Hi. Simon.&lt;/p&gt;
&lt;p&gt;DEBUG was added already for logs above.&lt;br /&gt;Deleted file id&amp;#39;s are the same.&lt;br /&gt;Is it not strange?&lt;br /&gt;(Deleted File_id=0x5500 - in both deleting cases.)&lt;br /&gt;Hanging up is strange too.&lt;/p&gt;
&lt;p&gt;BR.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deleting peers</title><link>https://devzone.nordicsemi.com/thread/289373?ContentTypeID=1</link><pubDate>Fri, 15 Jan 2021 10:06:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62225ca5-0778-4705-9326-6b49463c6d17</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Can you also add the debug log here by adding DEBUG to your preprocessor definitions? From this log it seems like you successfully delete two peers, so it is strange if only one of them were deleted.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deleting peers</title><link>https://devzone.nordicsemi.com/thread/289256?ContentTypeID=1</link><pubDate>Thu, 14 Jan 2021 14:34:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b12cabd-4789-4b4c-9cb4-9c271d5ec9e3</guid><dc:creator>DmitrySol</dc:creator><description>&lt;p&gt;After restart was seen one peer was deleted another was not deleted.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deleting peers</title><link>https://devzone.nordicsemi.com/thread/289254?ContentTypeID=1</link><pubDate>Thu, 14 Jan 2021 14:31:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7eca77b8-6b82-4ede-9b34-ec9562d563cf</guid><dc:creator>DmitrySol</dc:creator><description>&lt;p&gt;Log below shows how system hangs up.&lt;/p&gt;
&lt;p&gt;Firstly were connected two devices.&lt;br /&gt;Disconnections were performed.&lt;br /&gt;pm_peers_delete was executed.&lt;br /&gt;After that system is in hang up state.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app: BLE_GAP_EVT_RSSI_CHANGED: 1 rssi=--63dBm ch_index=0x6
&amp;lt;info&amp;gt; app: BLE_GAP_EVT_RSSI_CHANGED: 0 rssi=--56dBm ch_index=0x6

&amp;lt;info&amp;gt; app: sd_ble_gap_disconnect result 0
&amp;lt;info&amp;gt; app: BLE_GAP_EVT_RSSI_CHANGED: 0 rssi=--50dBm ch_index=0x29
&amp;lt;info&amp;gt; app: ble_nus_c_evt_handler(): conn_handle=0x2000, evt_type=0x2
&amp;lt;info&amp;gt; app: Scanning start
&amp;lt;info&amp;gt; app: BLE_GAP_EVT_DISCONNECTED: 0 , reason=0x16

&amp;lt;info&amp;gt; app: sd_ble_gap_disconnect result 0
&amp;lt;info&amp;gt; app: Scanning start
&amp;lt;info&amp;gt; app: BLE_GAP_EVT_ADV_REPORT peer_id=0x0
&amp;lt;info&amp;gt; app: Start_connection for Bonded peer
&amp;lt;info&amp;gt; app: BLE_GAP_EVT_RSSI_CHANGED: 1 rssi=--62dBm ch_index=0x6
&amp;lt;info&amp;gt; app: ble_nus_c_evt_handler(): conn_handle=0x2000, evt_type=0x2
&amp;lt;info&amp;gt; app: Scanning start
&amp;lt;info&amp;gt; app: BLE_GAP_EVT_DISCONNECTED: 1 , reason=0x16

&amp;lt;info&amp;gt; app: pm_peers_delete result 0
&amp;lt;info&amp;gt; app: Scanning start
&amp;lt;error&amp;gt; peer_manager_handler: Peer deleted successfully: peer_id: 0
&amp;lt;info&amp;gt; app: PM_EVT_PEER_DELETE_SUCCEEDED: peer_id=0x0
&amp;lt;info&amp;gt; app: Deleted File_id=0x5500
&amp;lt;info&amp;gt; app: Event: FDS_EVT_DEL_FILE received (FDS_SUCCESS)
&amp;lt;error&amp;gt; peer_manager_handler: Peer deleted successfully: peer_id: 0
&amp;lt;info&amp;gt; app: PM_EVT_PEER_DELETE_SUCCEEDED: peer_id=0x0
&amp;lt;info&amp;gt; app: Deleted File_id=0x5500
&amp;lt;info&amp;gt; app: Event: FDS_EVT_DEL_FILE received (FDS_SUCCESS)
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deleting peers</title><link>https://devzone.nordicsemi.com/thread/289135?ContentTypeID=1</link><pubDate>Thu, 14 Jan 2021 10:37:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b35b8661-fdf4-435a-a598-5255fa394def</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Can you please specify where exactly the system &amp;quot;hangs up&amp;quot;? Do you get any error in return when trying to debug this? Please make sure you are not connected to any of the peer devices you&amp;#39;re trying to delete as there&amp;#39;s a chance you end up in an undefined state if you&amp;#39;re trying to delete the bonding information of a connected device.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deleting peers</title><link>https://devzone.nordicsemi.com/thread/289128?ContentTypeID=1</link><pubDate>Thu, 14 Jan 2021 10:22:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc842ec9-7a44-4275-953f-b3fca907725d</guid><dc:creator>DmitrySol</dc:creator><description>&lt;p&gt;Deleting one by one device is working (pm_peers_delete()).&lt;br /&gt;But deleting all devices by pm_peers_delete() hangs up all system without any logs.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deleting peers</title><link>https://devzone.nordicsemi.com/thread/281900?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2020 17:20:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81db8d68-bb11-4359-a570-21caaa218545</guid><dc:creator>Ivan Herrera</dc:creator><description>&lt;p&gt;Yes, you need to wait before the actual disconnected event before you can delete the bond. You should be able to run&amp;nbsp;sd_ble_gap_disconnect in rapid succession for all your current handles without any issue, but you should always verify the return code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deleting peers</title><link>https://devzone.nordicsemi.com/thread/281827?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2020 13:50:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:827dc6ca-1e62-40b2-a0ff-fc9ed53d894e</guid><dc:creator>DmitrySol</dc:creator><description>&lt;p&gt;Hello!&lt;/p&gt;
&lt;p&gt;Thanks for replay.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt; if (m_conn_handle != BLE_CONN_HANDLE_INVALID)
                {
                    err_code = sd_ble_gap_disconnect(m_conn_handle, 0x13);
                    APPL_LOG(&amp;quot;sd_ble_gap_disconnect result %08lX&amp;quot;, err_code);
                }
                else
                {
                    APPL_LOG(&amp;quot;No physical link exists with peer&amp;quot;);
                }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;do I need to wait event of disconnecting before delete ?&lt;/p&gt;
&lt;p&gt;could i run ten times this sd_ble_gap_disconnect(m_conn_handle, 0x13) for ten connected handles in central simultaenously ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deleting peers</title><link>https://devzone.nordicsemi.com/thread/281700?ContentTypeID=1</link><pubDate>Wed, 25 Nov 2020 06:57:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76f1b889-bcc7-4867-b03d-8a22a4f1b595</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;An example on how to disconnect using button 4 on the DK can be seen in the ble_app_ipsp_initiator example. Please see the button_event_handler() function, more specifically the BSP_BUTTON_3. I have also added the snippet below. It will also return a log message &amp;quot;No physical link exits with peer&amp;quot; if there are no current connections.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Function for handling button events.
 *
 * @param[in]   pin_no         The pin number of the button pressed.
 * @param[in]   button_action  The action performed on button.
 */
static void button_event_handler(uint8_t pin_no, uint8_t button_action)
{
    uint32_t err_code;
    if (button_action == APP_BUTTON_PUSH)
    {
        switch (pin_no)
        {
            case BSP_BUTTON_0:
            {
                if (m_conn_handle == BLE_CONN_HANDLE_INVALID)
                {
                    err_code = sd_ble_gap_connect(&amp;amp;m_peer_addr,
                                                  &amp;amp;m_scan_param,
                                                  &amp;amp;m_connection_param,
                                                  APP_IPSP_TAG);

                    if (err_code != NRF_SUCCESS)
                    {
                        APPL_LOG(&amp;quot;Connection Request Failed, reason 0x%08lX&amp;quot;, err_code);
                    }
                    APP_ERROR_CHECK(err_code);
                }
                else
                {
                     APPL_LOG(&amp;quot;Connection exists with peer&amp;quot;);
                }

                break;
            }
            case BSP_BUTTON_1:
            {
                if (m_conn_handle != BLE_CONN_HANDLE_INVALID)
                {
                    ble_ipsp_handle_t ipsp_handle;
                    ipsp_handle.conn_handle = m_conn_handle;
                    err_code = ble_ipsp_connect(&amp;amp;ipsp_handle);
                    APP_ERROR_CHECK_BOOL((err_code == NRF_SUCCESS) ||
                                         (err_code == NRF_ERROR_BLE_IPSP_CHANNEL_ALREADY_EXISTS));
                }
                else
                {
                     APPL_LOG(&amp;quot;No physical link exists with peer&amp;quot;);
                }
                break;
            }
            case BSP_BUTTON_2:
            {
                err_code = ble_ipsp_disconnect(&amp;amp;m_handle);
                APPL_LOG(&amp;quot;ble_ipsp_disconnect result %08lX&amp;quot;, err_code);
                break;
            }
            case BSP_BUTTON_3:
            {
                if (m_conn_handle != BLE_CONN_HANDLE_INVALID)
                {
                    err_code = sd_ble_gap_disconnect(m_conn_handle, 0x13);
                    APPL_LOG(&amp;quot;sd_ble_gap_disconnect result %08lX&amp;quot;, err_code);
                }
                else
                {
                    APPL_LOG(&amp;quot;No physical link exists with peer&amp;quot;);
                }
                break;
            }
            default:
                break;
        }
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deleting peers</title><link>https://devzone.nordicsemi.com/thread/281448?ContentTypeID=1</link><pubDate>Tue, 24 Nov 2020 07:51:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:545fc459-b8d5-42d2-a636-86d9922624b9</guid><dc:creator>DmitrySol</dc:creator><description>&lt;p&gt;Good day!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Could you show example how to disconnect all peripherals from central.&lt;/p&gt;
&lt;p&gt;Before using pm_peers_delete().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deleting peers</title><link>https://devzone.nordicsemi.com/thread/281438?ContentTypeID=1</link><pubDate>Tue, 24 Nov 2020 07:11:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48191b4f-a5be-48a5-bace-12bb6faaec25</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;As Ivan says, &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Fgroup__peer__manager.html&amp;amp;anchor=gaa99779ab5b8b4cfde65974bdf75a1e7c"&gt;pm_peers_delete()&lt;/a&gt; is a function deleting all data stored for all peers. As for the disconnections, you do this however you like, for example by calling a &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v7.2.0%2Fgroup___b_l_e___g_a_p___e_n_u_m_e_r_a_t_i_o_n_s.html&amp;amp;anchor=ggae39030093ebca17966d1896533d1b556a58d418671daee4179d9a2cce944de1f9"&gt;sd_ble_gap_disconnect &lt;/a&gt;event.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deleting peers</title><link>https://devzone.nordicsemi.com/thread/281342?ContentTypeID=1</link><pubDate>Mon, 23 Nov 2020 14:04:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71acde34-24d6-4555-9bb3-05ebed3e21de</guid><dc:creator>DmitrySol</dc:creator><description>&lt;p&gt;is any simple way to disconnect all connected to central devices?&lt;/p&gt;
&lt;p&gt;and to guaranty disabling of connecting?&lt;/p&gt;
&lt;p&gt;disabling ble operating for some time at all for example...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deleting peers</title><link>https://devzone.nordicsemi.com/thread/281337?ContentTypeID=1</link><pubDate>Mon, 23 Nov 2020 13:57:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4856cff0-5216-4ebb-95c5-21c5eb248b2b</guid><dc:creator>Ivan Herrera</dc:creator><description>&lt;p&gt;You need to be disconnected from any peers you want to delete, and make sure they aren&amp;#39;t able to connect during the small time-period you are deleting the bonds. You can remove all bonds on the device by running&amp;nbsp;&lt;span&gt;pm_peers_delete(), but the same warning applies to this function.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>