<?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>How to pair between central/peripheral in lesc mode?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70781/how-to-pair-between-central-peripheral-in-lesc-mode</link><description>Thanks in advanced. Both platforms are: nrf52832, sdk17.0.2. The peripheral is based on ble_app_gls and I set static passkey 123456, the central is based on ble_app_hrs_c, so both sides have peer manager mechanism, I set sec_param.lesc=1 on both sides</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 25 Jan 2021 10:24:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70781/how-to-pair-between-central-peripheral-in-lesc-mode" /><item><title>RE: How to pair between central/peripheral in lesc mode?</title><link>https://devzone.nordicsemi.com/thread/290977?ContentTypeID=1</link><pubDate>Mon, 25 Jan 2021 10:24:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98a79fc5-baa1-4b3c-8808-177c00ab9c60</guid><dc:creator>Edvin</dc:creator><description>[quote user="faithself"]&lt;p&gt;About my custom central, I see&amp;nbsp;this event:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;0&amp;gt; &amp;lt;info&amp;gt; nrf_ble_lesc: Calling sd_ble_gap_lesc_dhkey_reply on conn_handle: 0&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;dhkey implies that this is a Diffie Hellman key, which is not what you are trying to implement. The DHKey is used in LESC, while your 6-digit passkey is something else.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I believe what you are looking for is the event BLE_GAP_EVT_AUTH_KEY_REQUEST, where you are expected to reply with sd_ble_gap_auth_key_reply(), which takes the conn_handle, the key type (@ref BLE_GAP_AUTH_KEY_TYPES, where&amp;nbsp;BLE_GAP_AUTH_KEY_TYPE_PASSKEY is the parameter for passkey), and *p_key, which is a pointer to where this key is stored in ascii, much like you did in the peripheral when you store the static key.&lt;/p&gt;
&lt;p&gt;I agree that the log says DHKEY_REQUEST, but are you sure this is the event that is also generated when you connect with your other peripherals using the static passkey?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to pair between central/peripheral in lesc mode?</title><link>https://devzone.nordicsemi.com/thread/290854?ContentTypeID=1</link><pubDate>Sat, 23 Jan 2021 13:31:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd5a8c57-ec5b-4f33-a98b-ae1bf41663dc</guid><dc:creator>faithself</dc:creator><description>&lt;p&gt;Add prints of peripheral when pairing/bonding:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;0&amp;gt; &amp;lt;info&amp;gt; app_timer: RTC: initialized.
 0&amp;gt; &amp;lt;info&amp;gt; app: 6-axis sensor started.
 0&amp;gt; &amp;lt;info&amp;gt; app: Fast advertising
 0&amp;gt; &amp;lt;info&amp;gt; app: TWI device detected at address 0x69
 0&amp;gt; &amp;lt;info&amp;gt; app: MPU6050 init success.
 0&amp;gt; &amp;lt;info&amp;gt; app: MPU6050 reg MPU_REG_WHO_AM_I value: 0x68.
 0&amp;gt; &amp;lt;info&amp;gt; app: Health Thermometer Service is scanned out.
 0&amp;gt; &amp;lt;info&amp;gt; app: Tx power level service is scanned out.
 0&amp;gt; &amp;lt;info&amp;gt; app: Custom service is scanned out.
 0&amp;gt; &amp;lt;info&amp;gt; app: Connected
 0&amp;gt; &amp;lt;info&amp;gt; app: BLE_GAP_EVT_LESC_DHKEY_REQUEST
 0&amp;gt; &amp;lt;info&amp;gt; nrf_ble_lesc: Calling sd_ble_gap_lesc_dhkey_reply on conn_handle: 0
 0&amp;gt; &amp;lt;info&amp;gt; peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 0, procedure: Bonding
 0&amp;gt; &amp;lt;info&amp;gt; app: Collector did not use MITM, disconnecting
 0&amp;gt; &amp;lt;info&amp;gt; app: BLE_GAP_EVT_AUTH_STATUS: status=0x0 bond=0x1 lv4: 0 kdist_own:0x3 kdist_peer:0x2
 0&amp;gt; &amp;lt;info&amp;gt; app: Pair success!
 0&amp;gt; &amp;lt;info&amp;gt; peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Bonding data, action: Update
 0&amp;gt; &amp;lt;info&amp;gt; peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update
 0&amp;gt; &amp;lt;info&amp;gt; app: Fast advertising
 0&amp;gt; &amp;lt;info&amp;gt; app: Tx power level service disconnected.
 0&amp;gt; &amp;lt;info&amp;gt; app: Custom service disconnected.
 0&amp;gt; &amp;lt;info&amp;gt; app: Disconnected
 0&amp;gt; &amp;lt;error&amp;gt; peer_manager_handler: Peer deleted successfully: peer_id: 0
 0&amp;gt; &amp;lt;info&amp;gt; app: Health Thermometer Service is scanned out.
 0&amp;gt; &amp;lt;info&amp;gt; app: Tx power level service is scanned out.
 0&amp;gt; &amp;lt;info&amp;gt; app: Custom service is scanned out.
 0&amp;gt; &amp;lt;info&amp;gt; app: Connected
 0&amp;gt; &amp;lt;info&amp;gt; peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Encryption, error: 4102
 0&amp;gt; &amp;lt;warning&amp;gt; peer_manager_handler: Disconnecting conn_handle 0.
 0&amp;gt; &amp;lt;info&amp;gt; app: Fast advertising
 0&amp;gt; &amp;lt;info&amp;gt; app: Disconnected
 ......&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to pair between central/peripheral in lesc mode?</title><link>https://devzone.nordicsemi.com/thread/290811?ContentTypeID=1</link><pubDate>Fri, 22 Jan 2021 15:58:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b87ca61-f65c-4f9a-a63b-0725b76300d4</guid><dc:creator>faithself</dc:creator><description>&lt;p&gt;Thanks for reply, I can 100% ensure that the peripheral static passkey works normally with other central devices. About my custom central, I see&amp;nbsp;this event:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;0&amp;gt; &amp;lt;info&amp;gt; nrf_ble_lesc: Calling sd_ble_gap_lesc_dhkey_reply on conn_handle: 0&lt;/p&gt;
&lt;p&gt;I think passkey should be input here, but I don&amp;#39;t know how. And traces followed even show bonding pass without key......I&amp;nbsp;even flash rom again and still get the result.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;0&amp;gt; &amp;lt;info&amp;gt; peer_manager_handler: Connection secured: role: Central, conn_handle: 0, procedure: Bonding&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: BLE_GAP_EVT_AUTH_STATUS: status=0x0 bond=0x1 lv4: 0 kdist_own:0x3 kdist_peer:0x2&lt;/p&gt;
&lt;p&gt;My peer manager params are same on peripheral and central:&lt;/p&gt;
&lt;p&gt;sec_param.bond = 1;&lt;br /&gt; sec_param.mitm = 1;&lt;br /&gt; sec_param.lesc = 1;&lt;br /&gt; sec_param.keypress = 0;&lt;br /&gt; sec_param.io_caps = BLE_GAP_IO_CAPS_DISPLAY_ONLY;&lt;br /&gt; sec_param.oob = 0;&lt;br /&gt; sec_param.min_key_size = 7;&lt;br /&gt; sec_param.max_key_size = 16;&lt;br /&gt; sec_param.kdist_own.enc = 1;&lt;br /&gt; sec_param.kdist_own.id = 1;&lt;br /&gt; sec_param.kdist_peer.enc = 1;&lt;br /&gt; sec_param.kdist_peer.id = 1;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to pair between central/peripheral in lesc mode?</title><link>https://devzone.nordicsemi.com/thread/290803?ContentTypeID=1</link><pubDate>Fri, 22 Jan 2021 15:35:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c5b6ae0-8f8e-4442-9c8a-7c636f11af75</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Have you been able to use the static passkey that you set while using another central, such as nRF Connect for Desktop? Did the passkey work?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now, on your custom central, do you see any events when you try to bond? Do you initiate bonding? If not, please look at how ble_app_hrs_c does this. (It doesn&amp;#39;t use a passkey, but look at what events you receive when you initiate bonding).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>