<?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>Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71446/pairing-passkey-cancel-pairing-on-android-side-still-give-access-to-characteristic</link><description>Hi , 
 
 I&amp;#39;m working on nrf52833, s113. 
 I have trouble to secure my system. It has no kayboard or screen, and with 6digit fixd pathkey( no other choice). 
 That&amp;#39;s mean it advertise once wake up with accelerometre. 
 I want to protect access to my 4</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 17 Feb 2021 11:25:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71446/pairing-passkey-cancel-pairing-on-android-side-still-give-access-to-characteristic" /><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/294809?ContentTypeID=1</link><pubDate>Wed, 17 Feb 2021 11:25:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f76bbaab-2d03-4e47-8512-89eb3b999277</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;Ok issue of fast connect /disconnect happens with your app, but also with mine, so may be it is linked to Android ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have implemented the reste to check for disconnexion and it works fine :).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;We are very busy now with pairing in our app. Do you know if NrfConnect i sable to get from IOs and Android the list of paired devices ?&lt;/p&gt;
&lt;p&gt;Because we scan and try to connect to a list of paired succesfully devices saved into our app when we launch it. But imagine user has unpaired with android menu. we try to connect something unpaired. So in running mode , the pop up pairing keys happens to enter 6 digit. But It is on top of our app and we have no way to give the good code to enter to the user...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/294790?ContentTypeID=1</link><pubDate>Wed, 17 Feb 2021 10:20:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c3f5d5f-8f87-4d09-860b-83c00c18f652</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Florian,&amp;nbsp;&lt;/p&gt;
[quote user="Olfox"]Hm so it is &amp;quot;normal&amp;quot; .[/quote]
&lt;p&gt;That is not normal. It is a known issue on our app.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Olfox"]&lt;p&gt;A.&lt;/p&gt;
&lt;p&gt;- use a read autorization on characteristic that should generate&amp;nbsp;BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event in&amp;nbsp;ble_on_ble_evt function, for each trial of reading. I will clear a timeout timer in this event. If timeout timer occurs, i force disconnection.&lt;/p&gt;[/quote]
&lt;p&gt;I think it&amp;#39;s a good solution.&amp;nbsp;&lt;span&gt;You could add a timeout in your application to check if you get some activity specific to the app you are using (read or writes to a specific characteristic etc).&amp;nbsp;&lt;/span&gt;See my colleague Susheel&amp;#39;s answer in this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/8988/ble-disconnect-timeout/33082#33082"&gt;post&lt;/a&gt;&amp;nbsp;for the timeout implement.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Olfox"]&lt;p&gt;&lt;span&gt;B.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Rely on the&amp;nbsp;NRF_BLE_CONN_PARAMS_MAX_SUPERVISION_TIMEOUT_DEVIATION that, if i understood should expire after a certain time of inactivity, what is not the case in my application it is set to 65535 so around 11minutes but it never generate any ble event or force disconnect. Do i understand correctly its purpose ? Is there some code to add to manage it ?&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;&lt;span&gt;All BLE connections have a supervision timeout. If there are no packets within the supervision timeout, the connection will end with the disconnect reason being &amp;quot;timeout&amp;quot;. However, the BLE connection will not end, as long as the BLE stack on the phone still works. From your log, the master (phone) still sent the ack. Therefore, it would not disconnect after a supervision timeout.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;-Amanda H.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/294571?ContentTypeID=1</link><pubDate>Tue, 16 Feb 2021 10:39:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e54cd7ca-6892-45f9-965b-909f3c2bca3f</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;Hm so it is &amp;quot;normal&amp;quot; . But impossible to let the system running this way, batterie will die very fast, so i need a mecanism to detect if nobody is really connected, else i&amp;#39;m stuck in this state for ever...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;SO i see two posibilities:&lt;/p&gt;
&lt;p&gt;A.&lt;/p&gt;
&lt;p&gt;- use a read autorization on characteristic that should generate&amp;nbsp;BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event in&amp;nbsp;ble_on_ble_evt function, for each trial of reading. I will clear a timeout timer in this event. If timeout timer occurs, i force disconnection.&lt;/p&gt;
&lt;p&gt;2 questions here:&lt;/p&gt;
&lt;p&gt;1. How to &amp;quot;reload&amp;quot; the timer dynamically when it is running. I see no API funciton to do this and i meet a lot of trouble with stop , change et start timer function when it is already running. As it count from 0 to x , should i just clear a register ot a variable ?&lt;/p&gt;
&lt;p&gt;2.&amp;nbsp;Should i call&amp;nbsp; in&amp;nbsp;&lt;span&gt;BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST&amp;nbsp; event ? According tho this schematics, i have to give&amp;nbsp;authorize by answering to Soft Device that&amp;nbsp;it can give access to peer.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1613469328221v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;B.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Rely on the&amp;nbsp;NRF_BLE_CONN_PARAMS_MAX_SUPERVISION_TIMEOUT_DEVIATION that, if i understood should expire after a certain time of inactivity, what is not the case in my application it is set to 65535 so around 11minutes but it never generate any ble event or force disconnect. Do i understand correctly its purpose ? Is there some code to add to manage it ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks a lot !&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/294549?ContentTypeID=1</link><pubDate>Tue, 16 Feb 2021 08:32:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2defaca-e8b4-4fd6-a6df-7a35468b7c19</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Florian,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As I know from other cases, if you connect and disconnect very fast, the app might not send out the&amp;nbsp;&lt;span&gt;disconnection command as expected.&amp;nbsp;&lt;/span&gt;From your sniffer log, the phone is actually still in a connection. If the app sends a disconnection command, you should see the opcode in the log as&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x20/__key/communityserver-discussions-components-files/4/57051.PNG" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/294184?ContentTypeID=1</link><pubDate>Fri, 12 Feb 2021 14:15:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a705cdb0-bfb4-435c-87c8-409f1c64b256</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;Yes , i was able to reproduce the problem( it is quiet easy unfortunatly ...) and here is the log. We see that there is no packet exchange anymore once i break the link by exiting my screen on my app.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;#define NRF_BLE_CONN_PARAMS_MAX_SUPERVISION_TIMEOUT_DEVIATION 65535&lt;/p&gt;
&lt;p&gt;what should happen after 65353 ms ( almost 11 minutes?), because i let it run in this bad deconnexion states and nothing happens.&lt;/p&gt;
&lt;p&gt;thank you !&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/links-keep-connected-on-uC-but-not-in-android-connect-lign20866.pcapng"&gt;devzone.nordicsemi.com/.../links-keep-connected-on-uC-but-not-in-android-connect-lign20866.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I can also see in my nrf console after breaking the link this :BLE_GAP_EVT_CONN_PARAM_UPDATE occurs. one time.&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/294162?ContentTypeID=1</link><pubDate>Fri, 12 Feb 2021 13:12:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2261d3a7-9c92-407e-a56a-9fec542bb1e2</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;&lt;span&gt;I think the only way to find the cause we need an on-air sniffer log. I suspect the case here may be that the phone is actually still in a connection here, or at least&amp;nbsp;the phone think it is in a connection since it may be waiting for an ack on the previous terminate link packet. If the ack is lost, then the phone will need to wait for a supervisor timeout before the next link can be established. The peer device will only send one ack when receiving the terminate link packet before disconnect, this is according to BLE spec.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/294127?ContentTypeID=1</link><pubDate>Fri, 12 Feb 2021 10:52:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:392898ca-7114-49f4-ba7e-5f621a42bf3b</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;Thanks Amanda,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have another issue, when i connect and disconnect very fast , nrf52 connect, start running timer etc .. but doesn&amp;#39;t detect the disconnexion. So my system run and consume while nobody is no more connected. The bad thing is that, there is no prossibility at the moment to detect it.&lt;/p&gt;
&lt;p&gt;Is there a way to detect a disconnexion even if the BLE _EVT_DISCONNECT has not been set ? I was thinking to use a timer that i reload after each charceteristic reading, and if it times out i force a disconnexion.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have seen a timer existing in gls example : PM_HANDLER_SEC_DELAY_MS&lt;/p&gt;
&lt;p&gt;But it seems to not manage this deconnexion missing detection&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/294094?ContentTypeID=1</link><pubDate>Fri, 12 Feb 2021 08:23:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c96f878-270c-406d-baee-1d786831e9af</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Florian,&lt;/p&gt;
[quote user="Olfox"]But is there a way to pop up 6 digit windows after connexion and not only when i try to read a characteristic ?[/quote]
&lt;p&gt;&lt;span&gt;You need to add&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__pm__handler.html#gab87437602e62c352905e8a10e8464da4"&gt;&lt;span&gt;pm_handler_secure_on_connection&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;to ble_evt_handler function to handle the connection? The f&lt;/span&gt;&lt;span&gt;unction is for securing a connection when it is established. You can refer to&amp;nbsp;ble_app_gls on how to use it.&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Olfox"]How many bounded device can we add in memory before to be full ?[/quote]
&lt;p&gt;&amp;nbsp;See this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/34879/flash-memory-and-bonding-data-from-peer-manager/134030#134030"&gt;answer&lt;/a&gt;.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Olfox"]3. Sould I prepare a way to clean bounded device to avoid being out of memory ?[/quote]
&lt;p&gt;You can use&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Fgroup__peer__manager.html&amp;amp;anchor=gaa99779ab5b8b4cfde65974bdf75a1e7c"&gt;pm_peers_delete()&lt;/a&gt;&amp;nbsp;which&lt;span&gt;&amp;nbsp;is a function deleting all data stored for all peers. As for the disconnections, you do this however you like, for example by calling a&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v7.2.0%2Fgroup___b_l_e___g_a_p___e_n_u_m_e_r_a_t_i_o_n_s.html&amp;amp;anchor=ggae39030093ebca17966d1896533d1b556a58d418671daee4179d9a2cce944de1f9"&gt;sd_ble_gap_disconnect&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/a&gt;&lt;span&gt;event. You can refer to&amp;nbsp;ble_app_gls on how to use it.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Olfox"]4. If i do the contrarie, keep bounded in android nrf App, but clear my uC. I try to connect, and this error happen:[/quote]
&lt;p&gt;&amp;nbsp;The error is as expected because the device lost the bond information. You have to delete bond info on the phone.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/293981?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2021 12:58:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0754a79-e15c-4704-895e-8ce39ba61080</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;That was the point !!!&lt;/p&gt;
&lt;p&gt;Thanks, now if i click Cancel when pop up arrive, it disconnects the link and i also add all the print for pm_event. When i click cancel i can see&amp;nbsp;PM_EVT_CONN_SEC_FAILED happen and then cnnexion is forced close by nrf52833 so that&amp;#39;s good !&lt;/p&gt;
&lt;p&gt;I have still&amp;nbsp;few thing that is not perfect:&lt;/p&gt;
&lt;p&gt;1. When chip is erased, blank, no bounded device in memory. Android not bounded anymore too. All systeme freshly new. I can connect and see the list of char. Because i protected it, i can&amp;#39;t read without pairing by 6 digit code. But is there a way to pop up 6 digit windows after connexion and not only when i try to read a characteristic ?&lt;/p&gt;
&lt;p&gt;2.I f i unbound from Android side, for sur, it stay bounded in my nrf52 memory. How many bounded device can we add in memory before to be full ?&lt;/p&gt;
&lt;p&gt;3. Sould I prepare a way to clean bounded device to avoid being out of memory ? I have a settings char, can i use it for calling a cleaning bounded device function for example or is there a better native way to do it please ?&lt;/p&gt;
&lt;p&gt;4. If i do the contrarie, keep bounded in android nrf App, but clear my uC. I try to connect, and this error happen:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app: 	 PM_EVT_CONN_SEC_START                 	
&amp;lt;info&amp;gt; peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Encryption, error: 4102
&amp;lt;warning&amp;gt; peer_manager_handler: Disconnecting conn_handle 0.
&amp;lt;info&amp;gt; app: 	 PM_EVT_CONN_SEC_FAILED                	
&amp;lt;info&amp;gt; app: 	  BLE_GAP_EVT_SEC_INFO_REQUEST	
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x11.
&amp;lt;info&amp;gt; app: DISCONNECTED&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;pop up windows doesn&amp;#39;t appear, so i have to unbound in Android and start a fresh new pairing process.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thanks a lot for your help, at least i progress&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/293968?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2021 12:05:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa9b9027-d82a-484d-a039-58d4cedd53f6</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;You need &lt;span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__pm__handler.html#ga67b6cd8a312c96c8df7adea49f4a6221"&gt;pm_handler_disconnect_on_sec_failure&lt;/a&gt;()&lt;/span&gt;&amp;nbsp;function as the&amp;nbsp;&amp;nbsp;&lt;span&gt;ble_app_gls example to&amp;nbsp;disconnect when the connection could not be secured.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/293948?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2021 11:19:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0b38f51-634b-4e2d-ab18-d1df28cda75a</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;Ha no , i just compare both code and i don&amp;#39;t have the same&amp;nbsp; in main. I have this :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void pm_evt_handler(pm_evt_t const * p_evt)
{
    pm_handler_on_pm_evt(p_evt);
    pm_handler_flash_clean(p_evt);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So by going deeper i see there is some check in peer_manager_handler.c , but it doesn&amp;#39;t disconnect if it wasn&amp;#39;t a mitm connexion like in gls code.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here is the management in my handler:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void pm_handler_on_pm_evt(pm_evt_t const * p_pm_evt)
{
    pm_handler_pm_evt_log(p_pm_evt);

    if (p_pm_evt-&amp;gt;evt_id == PM_EVT_BONDED_PEER_CONNECTED)
    {
        conn_secure(p_pm_evt-&amp;gt;conn_handle, false);
    }
    else if (p_pm_evt-&amp;gt;evt_id == PM_EVT_ERROR_UNEXPECTED)
    {
        NRF_LOG_ERROR(&amp;quot;Asserting.&amp;quot;);
        APP_ERROR_CHECK(p_pm_evt-&amp;gt;params.error_unexpected.error);
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;At first connect, user has not yet pairing with the code, so will the connexion be closed ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks a lot , i hope it is the weak point in my system&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/293924?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2021 10:11:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09fad95a-b2be-471d-a919-18f4a3d6f4ea</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Florian,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you add&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__pm__handler.html#gab87437602e62c352905e8a10e8464da4"&gt;&lt;span&gt;pm_handler_secure_on_connection&lt;/span&gt;&lt;/a&gt; to ble_evt_handler function to handle the connection? The f&lt;span&gt;unction is for securing a connection when it is established. You can refer to&amp;nbsp;ble_app_gls on how to use it.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/293570?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 13:34:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:381957b7-cea1-4d5b-9842-0a4061197daa</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;The same if i fully erased the device, each time it should pop up the passkey window it crash. I notice that it didn&amp;#39;t solve the probleme of not poping up the windows after erased memory, i can reach characteristic and error 16 occurs when i try to read the char.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/293565?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 13:29:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38543278-f130-4bc8-bec7-709d2a4bdeba</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;I did for MITM not for LESC as i thought it was one or the other&lt;/p&gt;
&lt;p&gt;#define SEC_PARAM_BOND 1 /**&amp;lt; Perform bonding. */&lt;br /&gt;#define SEC_PARAM_MITM 1 /**&amp;lt; Man In The Middle protection not required. */&lt;br /&gt;#define SEC_PARAM_LESC 0 /**&amp;lt; LE Secure Connections not enabled. */&lt;/p&gt;
&lt;p&gt;Si have enable it, but an error 16 happens.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app: CONNECTED
&amp;lt;info&amp;gt; app: In ble_ircam_eeprom_value_update. 

&amp;lt;info&amp;gt; app: Init Ircam and tpms sensors done, Run.
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x3A.
&amp;lt;debug&amp;gt; nrf_ble_gatt: ATT MTU updated to 247 bytes on connection 0x0 (response).
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x12.
&amp;lt;info&amp;gt; app: 	  BLE_GAP_EVT_CONN_PARAM_UPDATE	
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x23.
&amp;lt;debug&amp;gt; nrf_ble_gatt: Peer on connection 0x0 requested a data length of 251 bytes.
&amp;lt;debug&amp;gt; nrf_ble_gatt: Updating data length to 27 on connection 0x0.
&amp;lt;info&amp;gt; app: 	  BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST	
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x24.
&amp;lt;debug&amp;gt; nrf_ble_gatt: Data length updated to 27 on connection 0x0.
&amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_octets: 27
&amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_octets: 27
&amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_time: 2120
&amp;lt;info&amp;gt; app: 	  BLE_GAP_EVT_DATA_LENGTH_UPDATE	
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x12.
&amp;lt;info&amp;gt; app: 	  BLE_GAP_EVT_CONN_PARAM_UPDATE	
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x13.
&amp;lt;error&amp;gt; peer_manager_sm: Could not perform security procedure. smd_params_reply() or smd_link_secure() returned NRF_ERROR_INVALID_ADDR. conn_handle: 0
&amp;lt;error&amp;gt; peer_manager_handler: Unexpected fatal error occurred: error: NRF_ERROR_INVALID_ADDR
&amp;lt;error&amp;gt; peer_manager_handler: Asserting.
&amp;lt;error&amp;gt; app: ERROR 16 [NRF_ERROR_INVALID_ADDR] at C:\nordic\nRF5SDK160098a08e2\components\ble\peer_manager\peer_manager_handler.c:294&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/293556?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 13:13:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a37e049-d4d9-4daf-8f9a-068b4104eb2a</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Did you set enable&amp;nbsp;&lt;span&gt;SEC_PARAM_MITM&amp;nbsp;and&amp;nbsp;SEC_PARAM_LESC&amp;nbsp;in&amp;nbsp;peer_manager_init()?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;If you use the main.c of&amp;nbsp;&lt;span&gt;hrs example, you need to modify as the following:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;#define SEC_PARAM_MITM 1 /**&amp;lt; Man In The Middle protection not required. */&lt;br /&gt;#define SEC_PARAM_LESC 1 /**&amp;lt; LE Secure Connections enabled. */&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/293529?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 11:20:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f55b3926-f471-463c-81ee-6bb647f55d70</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;Here a comparaison between the two console of this two case. Left, first connexion from scratch ( no bounded , nrf52833 erased) where no passkey pop up after connexion, but only when i try to read a char. And the right one, after disconnected and reconnect again where passkey pop up appears after connexion and no more after when reading char.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1612869611553v1.png" alt=" " /&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/293518?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 10:53:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76fc05a0-f1b3-43a3-bfc3-74d51b99aaca</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;So i have tested with&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.2.0/group___b_l_e___g_a_p___c_o_n_n___s_e_c___m_o_d_e___s_e_t___m_a_c_r_o_s.html#ga9130b57af7649cba1702b99e1594736c"&gt;BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM&lt;/a&gt;&amp;nbsp;. I still have cancel pairing no impact effect. But i don&amp;#39;t have pop up windows for each char. Because i think in flash this phone is memorized .&lt;/p&gt;
&lt;p&gt;So i did a test, I erase all my flash. Programm debug bootloader, settings page, Softdevice s113 and run the fw. Scan on android, connect. First, no pop up to enter 6 digit appears. I see all my char. When i try to read, the pop up 6 digit ask for the passkey. If i enter it , i can read the char and three other too.&lt;/p&gt;
&lt;p&gt;Now i diconnect and unbound on android side. Re connect. And here pop up window appear ! It was not the case at the first trial, idon&amp;#39;t know why. May be because now , it is bounded in my flash, so it ask after connexion . I don&amp;#39;t enter the code, and it runs for a while, keeping the connexion but doing nothing on android side ( just a circular row running in loop telling me it is waiting for something indefinitively).&lt;/p&gt;
&lt;p&gt;So i disconnect. I re connect, it ask for the paskey, i enter it successfully . I can read my char without re entering passkey.&lt;/p&gt;
&lt;p&gt;If i disconnect, and reconnect, now it is succesfully bounded, so no more pop and everything is fine.&lt;/p&gt;
&lt;p&gt;Conclusion, there is something not robust at pairing phase when nobody knows each others, and i click cancel.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/293512?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 10:27:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a3378de-c575-4717-9518-a5e529952ba9</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;Thanks Amanda,&lt;/p&gt;
&lt;p&gt;1.does it means 6 digit cancel behavior is normal and that we can&amp;#39;t use that to avoid to read characeteristics ?&lt;/p&gt;
&lt;p&gt;2.If yes , what is the purpose of this pairing method ?&lt;/p&gt;
&lt;p&gt;3. with &lt;span&gt;BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM , is it normal to hav the pop up windows and that we need to re enter each time the 6 digit ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thank you !&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/293510?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 10:23:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47a788b4-156e-42a7-9a7f-945a299796aa</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;Here is my console trace when i click on cancel and wait ( no fast click on characteristic):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app: ADVERTISING ! Wait connexion or TIMEOUT...
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x10.
&amp;lt;info&amp;gt; peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update, no change
&amp;lt;debug&amp;gt; nrf_ble_gatt: Requesting to update ATT MTU to 247 bytes on connection 0x0.
&amp;lt;info&amp;gt; app: CONNECTED

&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x3A.
&amp;lt;debug&amp;gt; nrf_ble_gatt: ATT MTU updated to 247 bytes on connection 0x0 (response).
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x12.

&amp;lt;info&amp;gt; app: 	  BLE_GAP_EVT_CONN_PARAM_UPDATE	
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x23.
&amp;lt;debug&amp;gt; nrf_ble_gatt: Peer on connection 0x0 requested a data length of 251 bytes.
&amp;lt;debug&amp;gt; nrf_ble_gatt: Updating data length to 27 on connection 0x0.
&amp;lt;info&amp;gt; app: 	  BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST	
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x24.
&amp;lt;debug&amp;gt; nrf_ble_gatt: Data length updated to 27 on connection 0x0.
&amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_octets: 27
&amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_octets: 27
&amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_time: 2120
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x12.
&amp;lt;info&amp;gt; app: 	  BLE_GAP_EVT_CONN_PARAM_UPDATE	
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x19.
&amp;lt;info&amp;gt; app: 	  BLE_GAP_EVT_AUTH_STATUS	
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x12.
&amp;lt;info&amp;gt; app: 	  BLE_GAP_EVT_CONN_PARAM_UPDATE	
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x11.
&amp;lt;info&amp;gt; app: DISCONNECTED

&amp;lt;info&amp;gt; app: try to advertise...
&amp;lt;info&amp;gt; app: ADVERTISING ! Wait connexion or TIMEOUT...&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here the trace if i do nothing when pop up 6 digit happens:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app: try to advertise...
&amp;lt;info&amp;gt; app: ADVERTISING ! Wait connexion or TIMEOUT...
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x10.
&amp;lt;info&amp;gt; peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update, no change
&amp;lt;debug&amp;gt; nrf_ble_gatt: Requesting to update ATT MTU to 247 bytes on connection 0x0.
&amp;lt;info&amp;gt; app: CONNECTED

&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x3A.
&amp;lt;debug&amp;gt; nrf_ble_gatt: ATT MTU updated to 247 bytes on connection 0x0 (response).
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x12.
&amp;lt;info&amp;gt; app: 	  BLE_GAP_EVT_CONN_PARAM_UPDATE	
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x23.
&amp;lt;debug&amp;gt; nrf_ble_gatt: Peer on connection 0x0 requested a data length of 251 bytes.
&amp;lt;debug&amp;gt; nrf_ble_gatt: Updating data length to 27 on connection 0x0.
&amp;lt;info&amp;gt; app: 	  BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST	
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x24.
&amp;lt;debug&amp;gt; nrf_ble_gatt: Data length updated to 27 on connection 0x0.
&amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_octets: 27
&amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_octets: 27
&amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_time: 2120
&amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_time: 2120
&amp;lt;info&amp;gt; app: 	  BLE_GAP_EVT_DATA_LENGTH_UPDATE	
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x12.
&amp;lt;info&amp;gt; app: 	  BLE_GAP_EVT_CONN_PARAM_UPDATE	
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x12.
&amp;lt;info&amp;gt; app: 	  BLE_GAP_EVT_CONN_PARAM_UPDATE	
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x19.
&amp;lt;info&amp;gt; app: 	  BLE_GAP_EVT_AUTH_STATUS	
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x11.
&amp;lt;info&amp;gt; app: DISCONNECTED
&amp;lt;info&amp;gt; app: try to advertise...
&amp;lt;info&amp;gt; app: ADVERTISING ! Wait connexion or TIMEOUT...
&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x26.
&amp;lt;debug&amp;gt; app: ADVERTISING TIMEOUT, ADV_SET_TERMINATED :(
&amp;lt;info&amp;gt; app: ACCEL IN LOW POWER
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/293509?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 10:23:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71ad6dc0-c191-441a-ad77-282883710db4</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi Florian,&amp;nbsp;&lt;/p&gt;
[quote user=""]I know i can protect each caracteristic by using :&amp;nbsp;BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM , what i did.&amp;nbsp;[/quote]
&lt;p&gt;&lt;span&gt;BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM&amp;nbsp;will&lt;/span&gt;&amp;nbsp;s&lt;span&gt;et sec_mode pointed to by ptr to require encryption, but no MITM protection.&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I think you can try to set&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.2.0/group___b_l_e___g_a_p___c_o_n_n___s_e_c___m_o_d_e___s_e_t___m_a_c_r_o_s.html#ga9130b57af7649cba1702b99e1594736c"&gt;BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;for your requirement, and this example&amp;nbsp;&lt;a title="Experimental: LE Secure Connections Multirole Example" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_multirole_lesc.html?cp=7_1_4_2_1_3"&gt;LE Secure Connections Multirole Example&lt;/a&gt;&amp;nbsp;is similar to your case.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/293498?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 09:46:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2f8225c-b4cb-4c5b-bc99-329d2897a711</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;I have added code in main to print all ble GAP event that occurs.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
{
uint32_t err_code = NRF_SUCCESS;

switch (p_ble_evt-&amp;gt;header.evt_id)
{

case BLE_GAP_EVT_CONN_PARAM_UPDATE : NRF_LOG_INFO ( &amp;quot; BLE_GAP_EVT_CONN_PARAM_UPDATE &amp;quot; ) ; break ;
case BLE_GAP_EVT_SEC_PARAMS_REQUEST : NRF_LOG_INFO ( &amp;quot; BLE_GAP_EVT_SEC_PARAMS_REQUEST &amp;quot; ) ; break ;
case BLE_GAP_EVT_SEC_INFO_REQUEST : NRF_LOG_INFO ( &amp;quot; BLE_GAP_EVT_SEC_INFO_REQUEST &amp;quot; ) ; break ;
case BLE_GAP_EVT_PASSKEY_DISPLAY : NRF_LOG_INFO ( &amp;quot; BLE_GAP_EVT_PASSKEY_DISPLAY &amp;quot; ) ; break ;
case BLE_GAP_EVT_KEY_PRESSED : NRF_LOG_INFO ( &amp;quot; BLE_GAP_EVT_KEY_PRESSED &amp;quot; ) ; break ;
case BLE_GAP_EVT_AUTH_KEY_REQUEST : NRF_LOG_INFO ( &amp;quot; BLE_GAP_EVT_AUTH_KEY_REQUEST &amp;quot; ) ; break ;
case BLE_GAP_EVT_LESC_DHKEY_REQUEST : NRF_LOG_INFO ( &amp;quot; BLE_GAP_EVT_LESC_DHKEY_REQUEST &amp;quot; ) ; break ;
case BLE_GAP_EVT_AUTH_STATUS : NRF_LOG_INFO ( &amp;quot; BLE_GAP_EVT_AUTH_STATUS &amp;quot; ) ; break ;
case BLE_GAP_EVT_CONN_SEC_UPDATE : NRF_LOG_INFO ( &amp;quot; BLE_GAP_EVT_CONN_SEC_UPDATE &amp;quot; ) ; break ;
case BLE_GAP_EVT_RSSI_CHANGED : NRF_LOG_INFO ( &amp;quot; BLE_GAP_EVT_RSSI_CHANGED &amp;quot; ) ; break ;
case BLE_GAP_EVT_SEC_REQUEST : NRF_LOG_INFO ( &amp;quot; BLE_GAP_EVT_SEC_REQUEST &amp;quot; ) ; break ;
case BLE_GAP_EVT_SCAN_REQ_REPORT : NRF_LOG_INFO ( &amp;quot; BLE_GAP_EVT_SCAN_REQ_REPORT &amp;quot; ) ; break ;
case BLE_GAP_EVT_PHY_UPDATE : NRF_LOG_INFO ( &amp;quot; BLE_GAP_EVT_PHY_UPDATE &amp;quot; ) ; break ;
case BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST : NRF_LOG_INFO ( &amp;quot; BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST &amp;quot; ) ; break ;
case BLE_GAP_EVT_DATA_LENGTH_UPDATE : NRF_LOG_INFO ( &amp;quot; BLE_GAP_EVT_DATA_LENGTH_UPDATE &amp;quot; ) ; break ;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When i click in pop up windows on Cancel, i catch&amp;nbsp;BLE_GAP_EVT_AUTH_STATUS. This flag is treated by this piece of code in security_dispatcher.c :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Function for processing the @ref BLE_GAP_EVT_AUTH_STATUS event from the SoftDevice.
 *
 * @param[in]  p_gap_evt  The event from the SoftDevice.
 */
static void auth_status_process(ble_gap_evt_t const * p_gap_evt)
{
    switch (p_gap_evt-&amp;gt;params.auth_status.auth_status)
    {
        case BLE_GAP_SEC_STATUS_SUCCESS:
            auth_status_success_process(p_gap_evt);
            break;

        default:
            auth_status_failure_process(p_gap_evt);
#if PM_RA_PROTECTION_ENABLED
            ast_auth_error_notify(p_gap_evt-&amp;gt;conn_handle);
#endif // PM_RA_PROTECTION_ENABLED
            break;
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I note that a piece of code is disabled because PM_RA_PROTECTION_ENABLED is cleared to 0 in my sdk_config.h , what avoid re pairing.&lt;/p&gt;
&lt;p&gt;So it could be the source of my issue ? because i already paired this phone once, it is in my autorized list in the nrf52833 and then even if i cancel it works ?&lt;/p&gt;
&lt;p&gt;I have enabled this flag but same behavior of the app.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So is it to me to manage via&amp;nbsp;&lt;span&gt;BLE_GAP_EVT_AUTH_STATUS, and try to ask for a new pairing code, or close connextion may be ? How it done usually. I find this strange that by default this case is not cover, it is a basic security fault in this state, i hope it comes from my code.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pairing passkey , cancel pairing on android side still give access to characteristic</title><link>https://devzone.nordicsemi.com/thread/293478?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 08:09:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2d6899a-bde1-4c8e-bf52-9b61031e53f9</guid><dc:creator>Olfox</dc:creator><description>&lt;p&gt;Here is a capture on android of the problem. I first connect, and click cancel on 6digit input windows, then i clicke fast to read characteristic. Once read, i&amp;#39;m still connecting, passkey has been totaly by passed... Second try i input the correct pas kay, and i get same result than without ( what i want in fact ):&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/20210209_2D00_085252_2D00_720x1280.mp4"&gt;devzone.nordicsemi.com/.../20210209_2D00_085252_2D00_720x1280.mp4&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>