<?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>1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/90849/1st-connection-is-bonded-authenticated-encrypted-link-but-2nd-connection-becomes-not-bonded-unencrypted-link</link><description>I use nRF Connect to connect to nRF52832 device. 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link. Why 1st and 2nd connection are different? 
 The following is log message of nRF52832 device</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Aug 2022 10:39:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/90849/1st-connection-is-bonded-authenticated-encrypted-link-but-2nd-connection-becomes-not-bonded-unencrypted-link" /><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381533?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2022 10:39:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:649c25b7-9f74-476c-8507-2e0d1d6393bc</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;No, you are not. Your main loop in the zip you uploaded&amp;nbsp;looks like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    for (;;)
    {
 
        c = SEGGER_RTT_WaitKey(); // will block until data is available
	if(c == &amp;#39;r&amp;#39;) {
		SEGGER_RTT_WriteString(0, &amp;quot;Resetting..\n&amp;quot;);
		nrf_delay_ms(1000);
//		sd_nvic_SystemReset();
	}
        else {

        }
        char acIn[12];
        unsigned NumBytes = sizeof(acIn);
        NumBytes = SEGGER_RTT_Read(0, &amp;amp;acIn[0], NumBytes);
        acIn[NumBytes]=0;
        SEGGER_RTT_WriteString(0, &amp;quot;Get &amp;quot;);
        SEGGER_RTT_WriteString(0, acIn);

        idle_state_handle();
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is not in the example, and this is why it is failing as I have explained before.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381510?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2022 09:13:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55c694c4-c0dc-4aa3-a996-87929a7b8224</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6404.ble_5F00_app_5F00_ancs_5F00_c.zip"&gt;devzone.nordicsemi.com/.../6404.ble_5F00_app_5F00_ancs_5F00_c.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381507?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2022 09:12:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d77ac24-979b-4e1a-b0ec-a7e224c2b597</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;I am using unmodified ble_app_ancs_c example now. Please refer to the attached file.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381504?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2022 09:08:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55067909-6c76-4cc1-ae5c-db2022a41d2e</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Are you testing with an unmodified example now, or are you still testing with your flawed project? Please clarify this. If you are testing with that,&amp;nbsp;BLE_GAP_SEC_STATUS_TIMEOUT is expected. That is because the main loop does not run, so the app scheduler does not run. And that way, the LESC crypto operations are never run and the operation times out.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381501?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2022 08:59:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2630cb06-dfe4-40f3-8581-889c11763c64</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nRF_5F00_Connect_5F00_ANCS_5F00_pairing_5F00_BLE_5F00_GAP_5F00_SEC_5F00_STATUS_5F00_TIMEOUT.txt"&gt;devzone.nordicsemi.com/.../nRF_5F00_Connect_5F00_ANCS_5F00_pairing_5F00_BLE_5F00_GAP_5F00_SEC_5F00_STATUS_5F00_TIMEOUT.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381500?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2022 08:58:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5cbee66-323d-4a26-9038-574da7cd1d53</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ANCS_5F00_pairing_5F00_BLE_5F00_GAP_5F00_SEC_5F00_STATUS_5F00_TIMEOUT.mp4"&gt;devzone.nordicsemi.com/.../ANCS_5F00_pairing_5F00_BLE_5F00_GAP_5F00_SEC_5F00_STATUS_5F00_TIMEOUT.mp4&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381499?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2022 08:58:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:830f9be5-7143-4c5a-a001-d8ba8d27e129</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;I click&amp;nbsp;&amp;quot;Close&amp;quot; after the operation finishes this time. But the following error occurred.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Authentication failed with status BLE_GAP_SEC_STATUS_TIMEOUT&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381490?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2022 08:25:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:555ca0b6-3e1a-40e1-99c2-0b7b846426bc</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;A few observations.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;This is not from the unmodified example, but your code modified code. Can you try an unmodified example first, so that you know that how you do things with nRF Connect for Desktop is correct? Please do this to limit the number of unknowns at a singe time.&lt;/li&gt;
&lt;li&gt;The procedure you use from nRF Connect is correct, with one important exception. After clicking the &amp;quot;Pair&amp;quot; button you click&amp;nbsp;&amp;quot;Close&amp;quot; before the operation finishes. Please wait until you see the pairing text go green like this:&amp;nbsp;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1660551779402v1.png" alt=" " /&gt;. That means the operation has completed (alternatively you will see an error).&lt;/li&gt;
&lt;li&gt;&lt;em&gt;After&lt;/em&gt; you have tested with the &lt;em&gt;unmodified&lt;/em&gt; example, fix you project like I explained in before the weekend. The code you have uploaded here will not work, and pairing will never succeed, as explained then (because you are blocking in your main loop).&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381484?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2022 08:04:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1870148-87b8-4e6f-a63a-008bd157f994</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6472.ble_5F00_app_5F00_ancs_5F00_c.zip"&gt;devzone.nordicsemi.com/.../6472.ble_5F00_app_5F00_ancs_5F00_c.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381482?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2022 08:02:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c4aadc6-b1f0-4f7b-9c91-64ba704becca</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nRF52832_5F00_ANCS_5F00_pairing.txt"&gt;devzone.nordicsemi.com/.../nRF52832_5F00_ANCS_5F00_pairing.txt&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nRF_5F00_Connect_5F00_ANCS_5F00_pairing.txt"&gt;devzone.nordicsemi.com/.../nRF_5F00_Connect_5F00_ANCS_5F00_pairing.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381481?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2022 08:01:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9faed820-57d5-446f-89bc-20d79693c96b</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ANCS_5F00_pairing.mp4"&gt;devzone.nordicsemi.com/.../ANCS_5F00_pairing.mp4&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381467?ContentTypeID=1</link><pubDate>Mon, 15 Aug 2022 07:03:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72094ec1-5268-41fb-8d28-f35a2018f671</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;The&amp;nbsp;&lt;span&gt;ble_app_ancs_c&amp;nbsp;supports bonding out of the box, so if you are using an &lt;em&gt;unmodified&lt;/em&gt; version of that, you should be good.&amp;#39;&amp;#39;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you do this?&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;Ensure that you are testing with an unmodified&amp;nbsp;ble_app_ancs_c. If in doubts, program a pre-built hex file from &amp;lt;SDK&amp;gt;\examples\ble_peripheral\ble_app_ancs_c\hex\&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Use nRF Connect to connect and initiate pairing. As this should just work I am having problems understanding what you are doing, I suggest making a screen recording showing exactly how you do it.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Please click &amp;quot;OPEN LOG FILE&amp;quot; in the lower bar and upload the complete log here (use Insert - Insert image/video/file). Also, check the log on the nRF side and upload here. That should hopefully tell us more.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381392?ContentTypeID=1</link><pubDate>Fri, 12 Aug 2022 13:54:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6588deb-b4d7-4f75-a4f6-bfe9ba2f192e</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;Yes, I have initiated pairing from nRF Connect. But I don&amp;#39;t know why nRF Connect doesn&amp;#39;t pop up window for me to enter passkey. I am using ble_app_ancs_c example now, do I need to change firmware for encryption link testing?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381368?ContentTypeID=1</link><pubDate>Fri, 12 Aug 2022 13:06:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80a89ba7-bc54-481f-b465-266af14302b5</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Did you initiate pairing here? I do not see that from the log? And did you do the fixes to your firmware that I described in my previous post, ensuring that your main loop is not blocked? With that this should work and does on my end.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381253?ContentTypeID=1</link><pubDate>Fri, 12 Aug 2022 01:35:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07930520-bc21-4db3-ab24-50d1f2e69231</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/user_5F00_initiated_5F00_pairing.png" alt=" " /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/7823.not_5F00_bonded_5F00_unencrypted_5F00_link.png" /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/security_5F00_parameters_5F00_I.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/security_5F00_parameters_5F00_II.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381252?ContentTypeID=1</link><pubDate>Fri, 12 Aug 2022 01:34:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1eff5402-625c-4b88-b285-61d0dba7a5f5</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;I am using nRF Connect v3.0.1. And I check &amp;quot;Enable LE Secure Connection&amp;quot; and &amp;quot;Performing bonding&amp;quot;. And then I click But when I click &amp;quot;Pair ...&amp;quot;. But nRF Connect doesn&amp;#39;t show window for me to enter paskey and still shows &amp;quot;Not bonded, Unencrypted link&amp;quot;. Do I need to check other options?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The following is log messages of nRF52832 device with ble_app_ancs_c example.&lt;/p&gt;
&lt;p&gt;00&amp;gt; BLE_ADV_EVT_WHITELIST_REQUEST&lt;br /&gt;00&amp;gt; BLE_ADV_EVT_FAST&lt;br /&gt;00&amp;gt; Hello World!..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381172?ContentTypeID=1</link><pubDate>Thu, 11 Aug 2022 11:09:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19184244-f0a3-46fa-9a30-edb2b243e9c9</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It depends a bit on what you mean. Do you want to only allow already bonded peers to connect? If so, advertising with whitelisting is what you want, and in that case you add the bonded peer(s) to the whitelist, an ignore connections from any non-whitelisted device. This is commonly done, and you can see an example of this in the ANCS example that you are using (search for &amp;quot;whitelist&amp;quot;).&lt;/p&gt;
&lt;p&gt;If you on the other hand want to allow any device to connect, but disconnect if the link is not encrypted there is no standard way to do this. You could achieve it by for instance starting a timer when you get the&amp;nbsp;BLE_GAP_EVT_CONNECTED event, and stop the timer if you get the&amp;nbsp;PM_EVT_CONN_SEC_SUCCEEDED event. If not, and the timer runs out, disconnect.&lt;/p&gt;
&lt;p&gt;In any case though, you can configure security restrictions on each characteristic to prevent a peer from accessing them without having the right level of security (for instance minimum just works legacy pairing, or minimum LESC with authentication), etc.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381159?ContentTypeID=1</link><pubDate>Thu, 11 Aug 2022 10:12:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3eb34b1-583a-4e1c-8fd1-b849a97c63be</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;Thanks for your reply! I have another question that is how can I modify nRF52832 firmware to reject unencrypted link connecting?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381156?ContentTypeID=1</link><pubDate>Thu, 11 Aug 2022 09:43:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35b53f21-ad12-4a4c-a43b-8ed11524d009</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;It does not bond&amp;nbsp;automatically with nRF Connect by default. First connect, like you did and then:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click the gears icon on the device&lt;/li&gt;
&lt;li&gt;Click &amp;quot;Pair...&amp;quot;&lt;/li&gt;
&lt;li&gt;Check the &amp;quot;Bonding&amp;quot; checkbox&lt;/li&gt;
&lt;li&gt;Click the &amp;quot;Pair&amp;quot; button&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now the devices are bonded.&lt;/p&gt;
&lt;p&gt;If you now disconnect and reconnect again the link will be automatically&amp;nbsp;encrypted as the devices was bonded from before.&lt;/p&gt;
&lt;p&gt;(You can also change the nRF Connect configuration by clicking the gears icon on the device close to the right, which is the one used for connectivity. There select &amp;quot;Security parameters...&amp;quot; and check the &amp;quot;Perform bonding&amp;quot; box. This is used by default if the peripheral request security, which is the case here, and then bonding will be automatic&amp;quot;.)&lt;/p&gt;
&lt;p&gt;Both of the&amp;nbsp;above procedures&amp;nbsp;works with any Bluetooth LE device that supports bonding, like for instance the ANCS example in the SDK. However, if you look at the log from nRF while pairing/bonding you get a timeout, and that is because&amp;nbsp;of your main loop where you wait for RTT etc, so your idle state handler with the here important app_sched_execute() does not run. So I fixed it simply by removing&amp;nbsp;everything in your main loop except for the call to&amp;nbsp;idle_state_handle().&lt;/p&gt;
&lt;p&gt;In a nutshell, the root cause of the issue you are seeing is that you block in your main loop, preventing the app scheduler from running.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381145?ContentTypeID=1</link><pubDate>Thu, 11 Aug 2022 09:08:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:501bc673-4f54-4976-9533-f378ec2e3795</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_ancs_5F00_c.rar"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_ancs_5F00_c.rar&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381144?ContentTypeID=1</link><pubDate>Thu, 11 Aug 2022 09:06:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a82229b1-dc57-4133-925f-7d68a1eb6b3e</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/not_5F00_bonded_5F00_unencrypted_5F00_link.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/381143?ContentTypeID=1</link><pubDate>Thu, 11 Aug 2022 09:06:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9fa7d70-46e0-4231-880e-959c56259025</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;I test ble_app_ancs_c example. But nRF Connect shows &amp;quot;Not bonded, Unencrypted link&amp;quot;. But what I need to do is&amp;nbsp; encrypted link.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/380960?ContentTypeID=1</link><pubDate>Wed, 10 Aug 2022 08:53:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a77111b-cfd2-4bf3-b85a-ef9250f7c349</guid><dc:creator>Einar Thorsrud</dc:creator><description>[quote user="snowuyl"]&lt;p&gt;Do you mean this example?&lt;/p&gt;
&lt;p&gt;nRF5_SDK_16\examples\ble_peripheral\ble_app_ancs_c&lt;/p&gt;[/quote]
&lt;p&gt;Yes (though any BLE peripheral example that use bonding should do).&lt;/p&gt;
[quote user="snowuyl"]Beside I can&amp;#39;t see disconnect button on nRF Connect, which method do you suggest to disconnect from nRF Connect?[/quote]
&lt;p&gt;Click on the&amp;nbsp;gears icon on the device, and then select disconnect:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1660121593024v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/380958?ContentTypeID=1</link><pubDate>Wed, 10 Aug 2022 08:46:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f5a1f1d-bfc8-48a3-abb1-07f450ecd4af</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;Do you mean this example?&lt;/p&gt;
&lt;p&gt;nRF5_SDK_16\examples\ble_peripheral\ble_app_ancs_c&lt;/p&gt;
&lt;p&gt;Beside I can&amp;#39;t see disconnect button on nRF Connect, which method do you suggest to disconnect from nRF Connect?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link</title><link>https://devzone.nordicsemi.com/thread/380956?ContentTypeID=1</link><pubDate>Wed, 10 Aug 2022 08:39:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0e2450a-e497-40a9-904d-61c079012661</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can refer to for instance the ANCS example in SDK 16.0.0, where this&amp;nbsp;should also work. Does it on your end? If not, did you by any chance restart nRF Connect Bluetooth or click &amp;quot;Delete Bond Information&amp;quot;? (Based on the log of the second screenshot it does not look like the device is known for some reason, even though I see it has the same address so it should be seen as the same device.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>