<?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>nRF52832 SDK15.3.0 how to force paring/bonding after connection</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/48441/nrf52832-sdk15-3-0-how-to-force-paring-bonding-after-connection</link><description>nRF52832 
 SDK15.3.0 
 ble_app_gls 
 
 ble_app_gls( SDK15.3.0 ) works perfectly and I want to port this &amp;quot;request pairing immediately feature&amp;quot; to my own project. 
 I referred a project from ble_app_uart_bonding_static_passkey_SDK_15.2.0 as my own project</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 13 Jun 2019 10:29:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/48441/nrf52832-sdk15-3-0-how-to-force-paring-bonding-after-connection" /><item><title>RE: nRF52832 SDK15.3.0 how to force paring/bonding after connection</title><link>https://devzone.nordicsemi.com/thread/192628?ContentTypeID=1</link><pubDate>Thu, 13 Jun 2019 10:29:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ee44a72-4af8-47d3-8d9d-36375a116212</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am glad to hear you resolved the original issue.&lt;/p&gt;
&lt;p&gt;You can build with DEBUG defined (for instance by selecting the Debug to build in SES) to see exactly where the error was reported. This should let you know what you need. LESC needs nrf_crypto for the ECDH key exchange, so you definitely need that. I recommend you look at an example that has LESC enabled (such as the GLS example) to see what you need.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SDK15.3.0 how to force paring/bonding after connection</title><link>https://devzone.nordicsemi.com/thread/192314?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 10:21:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50fda0f0-deb5-48dd-b59a-394587867fea</guid><dc:creator>breaker</dc:creator><description>&lt;p&gt;thank you for your suggestion. I will do more test to see if there is any side effect on current implementation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SDK15.3.0 how to force paring/bonding after connection</title><link>https://devzone.nordicsemi.com/thread/192313?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 10:16:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9cc120f8-e91f-442b-9b1e-cd5b40a24c93</guid><dc:creator>breaker</dc:creator><description>&lt;p&gt;Hi Einar, Thank you for your response.&lt;/p&gt;
&lt;p&gt;I think I resolved this request. In short words: I copied all related code from&amp;nbsp;ble_app_gls, including pm_evt_handler() ble_evt_handler() peer_manager_init().&lt;/p&gt;
&lt;p&gt;Now&amp;nbsp;ble_app_uart works just like&amp;nbsp;ble_app_gls, will start a pairing request after connection immediately. And I will look at these handlers deeply.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now another question comes out:&lt;/p&gt;
&lt;p&gt;I am working on how to enable&amp;nbsp;SEC_PARAM_LESC 1. If I simply set&amp;nbsp;SEC_PARAM_LESC as 1, pairing result in a fetal error. I think this is about ECDH public key or crypto things.&amp;nbsp;&lt;a title="similar ticket" href="https://devzone.nordicsemi.com/f/nordic-q-a/43400/peer_manager_sm-could-not-perform-security-procedure-smd_params_reply-or-smd_link_secure-returned-nrf_error_invalid_addr" rel="noopener noreferrer" target="_blank"&gt;similar ticket&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Do you have any suggestions? or should I open a new ticket?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SDK15.3.0 how to force paring/bonding after connection</title><link>https://devzone.nordicsemi.com/thread/192227?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 07:33:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f206c36-bd00-49f4-ac4a-828a502e2498</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see.&lt;/p&gt;
&lt;p&gt;[quote user="breakersun"][/quote]&lt;/p&gt;
&lt;p&gt;I try at my own project to modify&amp;nbsp;&amp;nbsp;ble_app_uart in&amp;nbsp;ble_nus_init(), I modified all read/write/cccd_write access to SEC_SEC_MITM. It only pops out pairing indication at the phone after I read/write NUS characteristics.&lt;/p&gt;
&lt;p&gt;(which means, it never pops out pairing indication after connection if I don&amp;#39;t access characteristics).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is expected and is also how iOS handles things (to an even larger extent). There normal approach when accessing GATT characteristics is to try to read or write, and see if it is allowed. If it is not allowed due to a too low security level, then&amp;nbsp;the central will typically initiate pairing.&lt;/p&gt;
[quote user="breakersun"]So I want to find out what I missed in my project. meanwhile, I want to find out how does&amp;nbsp;ble_app_gls start a pairing/bonding request just after connection even before I try to access any characteristics.[/quote]
&lt;p&gt;I suspect that the reason for the Android phone to pair with the GLS example initially is that it uses a standard profile with standard services, and Android is implemented so that it will automatically pair after service discovery if a certain service is present. This is still something that is decided by the Android (central) device though and cannot be dictated by the peripheral.&lt;/p&gt;
&lt;p&gt;It is generally not advised for the peripheral to initiate peering, as described in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/43221/how-to-make-pairing-mandatory/172496#172496"&gt;this post&lt;/a&gt;. However, the peripheral can send a security request to the central at any time, but it is up to the central to decide whether it will initiate pairing or ignore the request. See &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v6.1.1/group___b_l_e___g_a_p___p_e_r_i_p_h___s_e_c___r_e_q___m_s_c.html?cp=3_4_1_1_2_1_3_10_8"&gt;Peripheral Security Request MSC&lt;/a&gt;&amp;nbsp;for details. If you want to do this, then in practice you should use &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__peer__manager.html?cp=5_1_6_2_15_38#ga46dfaf46c0aa94fc15017d42b3a2e514"&gt;pm_conn_secure()&lt;/a&gt;&amp;nbsp;in most cases, which in turn calls &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s312.api.v6.1.1/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html?cp=3_4_4_0_2_2_2_9#ga609617ead17f7c32cd6b27e63d96fe3a"&gt;sd_ble_gap_authenticate()&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SDK15.3.0 how to force paring/bonding after connection</title><link>https://devzone.nordicsemi.com/thread/192183?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 00:46:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:727da0da-d8c8-4efd-9928-862a0526278c</guid><dc:creator>breaker</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;More details:&lt;/p&gt;
&lt;p&gt;Android 9, with nRFconnect4.22.3&lt;/p&gt;
&lt;p&gt;I try at my own project to modify&amp;nbsp;&amp;nbsp;ble_app_uart in&amp;nbsp;ble_nus_init(), I modified all read/write/cccd_write access to SEC_SEC_MITM. It only pops out pairing indication at the phone after I read/write NUS characteristics.&lt;/p&gt;
&lt;p&gt;(which means, it never pops out pairing indication after connection if I don&amp;#39;t access characteristics).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But the behavior of&amp;nbsp;ble_app_gls is: It always pops out pairing indication at phone immediately just after connection established.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So I want to find out what I missed in my project. meanwhile, I want to find out how does&amp;nbsp;ble_app_gls start a pairing/bonding request just after connection even before I try to access any characteristics.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SDK15.3.0 how to force paring/bonding after connection</title><link>https://devzone.nordicsemi.com/thread/192182?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 00:16:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b50040c-e462-4021-b443-10958cdc4c85</guid><dc:creator>breaker</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;My goal is: force rapid paring/bonding after connection. and&amp;nbsp;&lt;span&gt;ble_app_gls works just like what I want.&amp;nbsp;I tried to implement the same QUICK pairing/bonding behavior on my own project.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My question is: but my own project&amp;nbsp;does not pairing/bonding immediately after connection. I need to find out why?&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 SDK15.3.0 how to force paring/bonding after connection</title><link>https://devzone.nordicsemi.com/thread/192058?ContentTypeID=1</link><pubDate>Tue, 11 Jun 2019 12:13:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:060567ee-5202-450a-9d62-325c7879d352</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Reding your question I am a bit confused about what the goal is. At the beginning of the question, it seems like you want to somehow force a rapid pairing/bonding after connection. Reading furhter it looks like you don&amp;#39;t want to pair at all. Can you clarify what you want to achieve&lt;/p&gt;
&lt;p&gt;Generally, it is always central who initiates pairing by issuing a pairing request. The peripheral can support pairing or not and support a subset of features (MITM depending on I/O capabilities, LESC, etc.). It can also require pairing for certain characteristics, like when you use&amp;nbsp;&lt;span&gt;SEC_JUST_WORKS&amp;nbsp;or&amp;nbsp;SEC_OPEN. This will limit if the peer can access the characteristics, depending on the security level. However, it is still the central who actually initiates the pairing. (For instance, iOS will only initiate pairing after getting access&amp;nbsp; denied one a characteristic).&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>