<?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>[NRF52840 - pc-ble-driver-py] - Disconnection/reconnection issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53157/nrf52840---pc-ble-driver-py---disconnection-reconnection-issue</link><description>Hello, I am developing a Python script (Windows 10, Python 2.7.16, pc-ble-driver-py 0.12.0) to use a NRF52840 board to simulate the BLE part of an application running on a smartphone. The smartphone connects on a device, then executes bonding with passkey</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 28 Feb 2020 08:58:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53157/nrf52840---pc-ble-driver-py---disconnection-reconnection-issue" /><item><title>RE: [NRF52840 - pc-ble-driver-py] - Disconnection/reconnection issue</title><link>https://devzone.nordicsemi.com/thread/237059?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2020 08:58:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7319fec1-0d6a-4369-9bdb-af6a04150524</guid><dc:creator>mattfavre</dc:creator><description>&lt;p&gt;Hi Christophe@,&lt;/p&gt;
&lt;p&gt;Thanks for the reply, it worked for me.&lt;/p&gt;
&lt;p&gt;Matt&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [NRF52840 - pc-ble-driver-py] - Disconnection/reconnection issue</title><link>https://devzone.nordicsemi.com/thread/235821?ContentTypeID=1</link><pubDate>Sat, 22 Feb 2020 13:54:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbc60876-f13e-4179-95a4-790481023b04</guid><dc:creator>Christophe@</dc:creator><description>&lt;p&gt;Hi Matt,&lt;/p&gt;
&lt;p&gt;After bonding, you have to get the keyset. In ble_adapter.py, I used the code of authenticate function to write my code:&lt;/p&gt;
&lt;p&gt;keyset = BLEGapSecKeyset.from_c(self.adapter.driver._keyset)&lt;/p&gt;
&lt;p&gt;Then, from keyset, you can get ediv, rand, ltk (ble_driver.py):&lt;/p&gt;
&lt;p&gt;self.ediv = keyset.keys_own.enc_key.master_id.ediv&lt;br /&gt;self.rand = keyset.keys_own.enc_key.master_id.rand&lt;br /&gt;self.ltk = keyset.keys_own.enc_key.enc_info.ltk&lt;/p&gt;
&lt;p&gt;You can proceed to encryption with:&lt;/p&gt;
&lt;p&gt;self.adapter.encrypt(self.conn_handle, self.ediv, self.rand, self.ltk)&lt;/p&gt;
&lt;p&gt;After a disconnection, when you reconnect, you have to call encrypt&amp;nbsp; again.&lt;/p&gt;
&lt;p&gt;I hope that will help you.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Christophe&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [NRF52840 - pc-ble-driver-py] - Disconnection/reconnection issue</title><link>https://devzone.nordicsemi.com/thread/235079?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2020 08:26:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0de2ba7e-7ce1-4cd2-9658-8468dead70a1</guid><dc:creator>mattfavre</dc:creator><description>&lt;p&gt;Hi Christophe@,&lt;/p&gt;
&lt;p&gt;Your question is very relevant.&lt;/p&gt;
&lt;p&gt;Could you post an example of your final code?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Matt&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [NRF52840 - pc-ble-driver-py] - Disconnection/reconnection issue</title><link>https://devzone.nordicsemi.com/thread/217767?ContentTypeID=1</link><pubDate>Thu, 31 Oct 2019 12:53:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f748db5-fa24-48aa-9e6b-646a9f550fa1</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am happy to hear that you solved the issue, and wish you good luck with the rest of the project.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [NRF52840 - pc-ble-driver-py] - Disconnection/reconnection issue</title><link>https://devzone.nordicsemi.com/thread/217591?ContentTypeID=1</link><pubDate>Wed, 30 Oct 2019 15:57:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63d36222-5096-4242-933d-43583706fa9d</guid><dc:creator>Christophe@</dc:creator><description>&lt;p&gt;Hello Terje,&lt;/p&gt;
&lt;p&gt;I succeeded to do this reconnection. I got ediv, rand and ltk from keyset using last part of code of method authenticate in ble_adapter.py&amp;nbsp; and I used encrypt method to establish encryption.&lt;/p&gt;
&lt;p&gt;That issue is fixed. Thanks again for your support.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Christophe&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [NRF52840 - pc-ble-driver-py] - Disconnection/reconnection issue</title><link>https://devzone.nordicsemi.com/thread/215582?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2019 16:13:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34dd91e8-d099-4808-a17f-8b8d3297a894</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You need to add procedures for reestablishing encryption, using stored keys (ediv, rand, LTK) for the bond. I.e. &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.1.1/group___b_l_e___g_a_p___c_e_n_t_r_a_l___e_n_c___m_s_c.html"&gt;Encryption Establishment using stored keys&lt;/a&gt;. Either always after connection, or when you get a security request as in &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.1.1/group___b_l_e___g_a_p___c_e_n_t_r_a_l___s_e_c___r_e_q___m_s_c.html"&gt;Security Request Reception&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The keys can be fetched from the SoftDevice as part of the bonding procedure, from the [in,out] parameter p_sec_keyset in &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v6.1.1%2Fgroup___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=ga7b23027c97b3df21f6cbc23170e55663"&gt;sd_ble_gap_sec_params_reply()&lt;/a&gt;. See the API documentation for sd_ble_gap_sec_params_reply() for details.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [NRF52840 - pc-ble-driver-py] - Disconnection/reconnection issue</title><link>https://devzone.nordicsemi.com/thread/215124?ContentTypeID=1</link><pubDate>Tue, 15 Oct 2019 14:42:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34c95113-0d2f-4f40-9bf9-99c42592e842</guid><dc:creator>Christophe@</dc:creator><description>&lt;p&gt;Hello Terje,&lt;/p&gt;
&lt;p&gt;Thank you for your answer. There are a lot of workflows available in&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v6.1.1%2Fgroup___b_l_e___g_a_p___c_e_n_t_r_a_l___s_e_c___m_s_c.html"&gt;Central Security Procedures&lt;/a&gt;. Which one should I use to fit my needs?&lt;/p&gt;
&lt;p&gt;Currently, I use &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v6.1.1%2Fgroup___b_l_e___g_a_p___c_e_n_t_r_a_l___l_e_g_a_c_y___m_s_c.html"&gt;Bonding: Passkey Entry, User Inputs on Central or OOB&lt;/a&gt;. Can I keep it or should I replace it with another procedure?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Christophe&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [NRF52840 - pc-ble-driver-py] - Disconnection/reconnection issue</title><link>https://devzone.nordicsemi.com/thread/214791?ContentTypeID=1</link><pubDate>Mon, 14 Oct 2019 10:48:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25112f60-366e-4529-8a61-79dec8f2cead</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;pc-ble-criver (and pc-ble-driver-py) is serialization of the SoftDevice, and the SoftDevice does not store bonding data internally. That means, in order to keep the bond on the pc side you must store that data yourself. This is what for instance the Peer Manager library in the nRF5 SDK does. See e.g. the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.1.1/group___b_l_e___g_a_p___c_e_n_t_r_a_l___s_e_c___m_s_c.html"&gt;Central Security Procedures&lt;/a&gt; in the SoftDevice API documentation.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>