<?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>Not able to bond a BLE thermoter with a random passkey</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79912/not-able-to-bond-a-ble-thermoter-with-a-random-passkey</link><description>Hello all, 
 Currently I&amp;#180;m developing a code to be load to the SDK to act as a master in a BLE communication. The peripheral is a BLE thermoter that, in order to preform bonding, displays a random pin to be entered. When the event BLE_GAP_EVT_AUTH_KEY_REQUEST</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Sep 2021 13:32:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79912/not-able-to-bond-a-ble-thermoter-with-a-random-passkey" /><item><title>RE: Not able to bond a BLE thermoter with a random passkey</title><link>https://devzone.nordicsemi.com/thread/331746?ContentTypeID=1</link><pubDate>Wed, 29 Sep 2021 13:32:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:942b2218-8b82-4af8-8311-ce66d21d66f0</guid><dc:creator>Daniela_A</dc:creator><description>&lt;p&gt;That&amp;acute;s it! It works.Thank you so very much for your help and your time :D&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to bond a BLE thermoter with a random passkey</title><link>https://devzone.nordicsemi.com/thread/331636?ContentTypeID=1</link><pubDate>Wed, 29 Sep 2021 08:25:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3066d65-8e4f-47a1-9eff-7b64fc8e2b91</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Take a look&amp;nbsp;ble_app_hrs on how to handle &lt;span&gt;the current connection&lt;/span&gt;. You can&amp;nbsp;&lt;span&gt;declare a global variable to handle of the current connection as&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/276941_5F00_1.PNG" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Then,&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; m_conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to bond a BLE thermoter with a random passkey</title><link>https://devzone.nordicsemi.com/thread/331585?ContentTypeID=1</link><pubDate>Tue, 28 Sep 2021 20:52:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86562381-1db2-48b4-b2e9-b12fd8522861</guid><dc:creator>Daniela_A</dc:creator><description>&lt;p&gt;By the way. I just realized that I have a warning in that line:&amp;nbsp;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2465.warning.png" /&gt;&lt;/p&gt;
&lt;p&gt;Could that be the problem?&lt;br /&gt;&lt;br /&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to bond a BLE thermoter with a random passkey</title><link>https://devzone.nordicsemi.com/thread/331583?ContentTypeID=1</link><pubDate>Tue, 28 Sep 2021 20:44:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a847463d-f22d-430e-9e05-4ada22bae538</guid><dc:creator>Daniela_A</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Now I understand what you are telling me. &lt;br /&gt;&lt;br /&gt;Since I need to use the conn_handle of the ble_evt in the main, what I do is that I am declaring a global variable in the first lines of the program like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ble_evt_t * g_p_ble_evt;  &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Later, when the event triggers, I&amp;acute;m passing the information of the p_ble_evt to g_p_ble_evt&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="c_cpp"&gt; case BLE_GAP_EVT_AUTH_KEY_REQUEST:
            NRF_LOG_INFO(&amp;quot;BLE_GAP_EVT_AUTH_KEY_REQUEST&amp;quot;);
            f_pin = true;
            g_p_ble_evt=p_ble_evt;
            break;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to bond a BLE thermoter with a random passkey</title><link>https://devzone.nordicsemi.com/thread/331533?ContentTypeID=1</link><pubDate>Tue, 28 Sep 2021 13:32:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55d4585b-40ea-43ad-84da-6e1b91d71dbd</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;yes, You need to check the input&amp;nbsp;&lt;em&gt;conn_handle&lt;/em&gt;&lt;span&gt;&amp;nbsp;of&amp;nbsp;&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html#ga01e04f368c8e7b3aaa31740dbd53bd12"&gt;sd_ble_gap_auth_key_reply&lt;/a&gt;() because the error code indicates&amp;nbsp;BLE_ERROR_INVALID_CONN_HANDLE.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to bond a BLE thermoter with a random passkey</title><link>https://devzone.nordicsemi.com/thread/331529?ContentTypeID=1</link><pubDate>Tue, 28 Sep 2021 13:21:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:efc85df3-39ad-4711-995d-782183a85be4</guid><dc:creator>Daniela_A</dc:creator><description>&lt;p&gt;Yes, it is returned by the function. What do you mean by how do I set&amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;quot;g_p_ble_evt-&amp;gt;evt.gap_evt.conn_handle&amp;quot;?&lt;br /&gt;&lt;br /&gt;PS: Thank you for your help&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to bond a BLE thermoter with a random passkey</title><link>https://devzone.nordicsemi.com/thread/331513?ContentTypeID=1</link><pubDate>Tue, 28 Sep 2021 12:45:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1edad598-6cd2-4566-a227-b825406c2fb9</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The error code 0x3002 corersponds to BLE_ERROR_INVALID_CONN_HANDLE. Is it returned by &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.0.1/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html#ga01e04f368c8e7b3aaa31740dbd53bd12"&gt;sd_ble_gap_auth_key_reply&lt;/a&gt;()&lt;/span&gt;&amp;nbsp;function? If so,&amp;nbsp;How you set this, &amp;quot;g_p_ble_evt-&amp;gt;evt.gap_evt.conn_handle&amp;quot;?&lt;/p&gt;
&lt;p&gt;-Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to bond a BLE thermoter with a random passkey</title><link>https://devzone.nordicsemi.com/thread/331155?ContentTypeID=1</link><pubDate>Fri, 24 Sep 2021 18:21:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b28c817-b95a-42d5-9b1d-59b1780d2e34</guid><dc:creator>Daniela_A</dc:creator><description>&lt;p&gt;I tried doing that too. The problem is that when the event happens, an interruption triggers and the part of receiving the key via UART doesn&amp;acute;t work&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to bond a BLE thermoter with a random passkey</title><link>https://devzone.nordicsemi.com/thread/331101?ContentTypeID=1</link><pubDate>Fri, 24 Sep 2021 13:11:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a40518cc-0bcd-4ad1-919b-ac3210e8eca1</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Try to reply to the key in the&amp;nbsp;BLE_GAP_EVT_AUTH_KEY_REQUEST event instead of the main loop.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>