<?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 - BLE Pairing with timeout</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43412/nrf52840---ble-pairing-with-timeout</link><description>Hi, 
 
 I have used &amp;quot;ble_app_gl&amp;quot; example for pairing with random key and it runs great. Now i want to add push button for pairing purpose which is like..... when user enter random password during pairing process then my device need to wait for push button</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 07 Feb 2019 08:04:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43412/nrf52840---ble-pairing-with-timeout" /><item><title>RE: nRF52840 - BLE Pairing with timeout</title><link>https://devzone.nordicsemi.com/thread/169845?ContentTypeID=1</link><pubDate>Thu, 07 Feb 2019 08:04:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d92d6966-8d2d-4be2-9db6-5b95fda58241</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;If you take a look at the message sequence chart for &lt;a href="https://www.nordicsemi.com/DocLib/Content/SoftDevice_API_Doc/S140/v6-1-0/group_ble_gap_periph_lesc_bonding_pke_cd_msc"&gt;Bonding: Passkey Entry, User Inputs on Peripheral&lt;/a&gt;, you can see that you are expected to enter a passkey when you receive the event &lt;strong&gt;BLE_GAP_EVT_AUTH_KEY_REQUEST&lt;/strong&gt;. You reply the passkey with the API function &lt;a href="https://www.nordicsemi.com/DocLib/Content/SoftDevice_API_Doc/S140/v6-1-0/group_ble_gap_functions?667#ga01e04f368c8e7b3aaa31740dbd53bd12"&gt;sd_ble_gap_auth_key_reply()&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;The pairing sequence has a timeout value of 30 seconds, as you can see &lt;a href="https://www.nordicsemi.com/DocLib/Content/SoftDevice_API_Doc/S140/v6-1-0/group_ble_gap_periph_pairing_timeout_msc"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;What I suggest you do is that you add a if-statement in the event &lt;strong&gt;BLE_GAP_EVT_AUTH_KEY_REQUEST&lt;/strong&gt;, where you check if your button has been pressed.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>