<?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>BLE_GAP_EVT_DISCONNECTED doesn&amp;#39;t occur when connection is terminated after receiving LL_VERSION_IND</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/99209/ble_gap_evt_disconnected-doesn-t-occur-when-connection-is-terminated-after-receiving-ll_version_ind</link><description>Hi 
 We established a connection with a mobie phone as central device and an nRF52832 or nRF52833 as peripheral device. If we afterwards try to terminate the connection on the nRF with sd_ble_gap_disconnect(), the BLE_GAP_EVT_DISCONNECTED does not occur</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 11 May 2023 14:07:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/99209/ble_gap_evt_disconnected-doesn-t-occur-when-connection-is-terminated-after-receiving-ll_version_ind" /><item><title>RE: BLE_GAP_EVT_DISCONNECTED doesn't occur when connection is terminated after receiving LL_VERSION_IND</title><link>https://devzone.nordicsemi.com/thread/425143?ContentTypeID=1</link><pubDate>Thu, 11 May 2023 14:07:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f034418b-468e-4a41-8a5e-28fe7a9a8365</guid><dc:creator>Remo</dc:creator><description>&lt;p&gt;Ok, thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_GAP_EVT_DISCONNECTED doesn't occur when connection is terminated after receiving LL_VERSION_IND</title><link>https://devzone.nordicsemi.com/thread/425086?ContentTypeID=1</link><pubDate>Thu, 11 May 2023 11:55:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b3de677-2258-4099-8413-64d9b049df88</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I cannot say for sure it it will be included in a new&amp;nbsp;release or not,&amp;nbsp;but generally you should not expect large updates to the SoftDevices going forward (due to most new activity happening with the nRF Connect SDK). Also, the disconnected event only happens after the peer has acknowledged the&amp;nbsp;LL_TERMINATE_IND, and if this does not happen for instance due to the ACK being lost on air, you will also have to wait for the timeout, so you anyway need to handel that condition.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_GAP_EVT_DISCONNECTED doesn't occur when connection is terminated after receiving LL_VERSION_IND</title><link>https://devzone.nordicsemi.com/thread/425059?ContentTypeID=1</link><pubDate>Thu, 11 May 2023 09:30:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88e95690-e921-4c54-bd55-4058f2adf3c5</guid><dc:creator>Remo</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;Thank you for the explanation. Do you know if this implemantation detail will be fixed if there will be a new SoftDevice release?&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_GAP_EVT_DISCONNECTED doesn't occur when connection is terminated after receiving LL_VERSION_IND</title><link>https://devzone.nordicsemi.com/thread/425021?ContentTypeID=1</link><pubDate>Thu, 11 May 2023 07:25:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6754860-b6ca-45fd-aa12-27d685fcefad</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Remo,&lt;/p&gt;
&lt;p&gt;I have discussed this with our SoftDevice team, and due to some implementation details in the SoftDevice, it is expected that you do not get the immediate disconnect with&amp;nbsp;BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION in this specific case, where the nRF sends the&amp;nbsp;LL_TERMINATE_IND in the same connection event as it received&amp;nbsp;LL_VERSION_IND. You will always get a disconnected event with a timeout reason later though, so it is not a critical issue,&amp;nbsp;but the SoftDevice could have handled this more&amp;nbsp;gracefully.&lt;/p&gt;
&lt;p&gt;Br,&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_GAP_EVT_DISCONNECTED doesn't occur when connection is terminated after receiving LL_VERSION_IND</title><link>https://devzone.nordicsemi.com/thread/424636?ContentTypeID=1</link><pubDate>Tue, 09 May 2023 15:47:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3086e746-6578-414e-b993-0add8f3c4f93</guid><dc:creator>Remo</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;No, I didn&amp;#39;t mix up the disconnected reasons. I received 0x22 in the error case and 0x16 in the good case.&lt;/p&gt;
&lt;p&gt;We are using the Frontline Sodera BLE sniffer. Are you able to open these trace files? I made here a screenshot of the last packages of the trace from the Sodera:&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/2023_2D00_05_2D00_09-17_5F00_43_5F00_13_2D00_Message-Sequence-Chart-_2800_MSC_2900_.png" /&gt;&lt;/p&gt;
&lt;p&gt;I looked into the sniffer trace you sent. When I see it correctly, there are two empty PDU&amp;#39;s between the LL_VERSION_IND of the mobile and the LL_TERMINATE_IND of the nRF52832. Can you adjust the timing so that there are no empty PDU&amp;#39;s between the mentioned LL packets? I think that this should reproduce the problem.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_GAP_EVT_DISCONNECTED doesn't occur when connection is terminated after receiving LL_VERSION_IND</title><link>https://devzone.nordicsemi.com/thread/424427?ContentTypeID=1</link><pubDate>Tue, 09 May 2023 07:20:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0531750a-250e-4d05-9ddd-650a15b8ea87</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have not been able to reproduce this on my end yet. I ended up with a slightly more modified ble_app_hrs example, testing on the nRF52 DK (nRF52832) and SDK 17.1.0, but with S132 7.3.0.The changes are mostly your modified main.c file, but I modified it slightly. For reference, the slightly modified main.c and sdk_config.h (where the change there is to use default data length and ATT MTU) are attached together with the sniffer trace: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nrf_5F00_connect_5F00_iphone_5F00_trace.pcapng"&gt;devzone.nordicsemi.com/.../nrf_5F00_connect_5F00_iphone_5F00_trace.pcapng&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;main.c:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/64850.main.c"&gt;devzone.nordicsemi.com/.../64850.main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;sdk_config.h:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/76725.sdk_5F00_config.h"&gt;devzone.nordicsemi.com/.../76725.sdk_5F00_config.h&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In the log I get this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;...
&amp;lt;info&amp;gt; app: Disconnected, reason 22 (0x16).
...&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;As&amp;nbsp;BLE_HCI_STATUS_CODE_LMP_RESPONSE_TIMEOUT is 0x22 and BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION is 0x16 which is 22 decimal, this makes me wonder if it could be that&amp;nbsp; you accidentally mixed up decimal and hex? You should anyway get the disconnect event immediately though, but I want to double check.&lt;/p&gt;
&lt;p&gt;Can you share a full sniffer trace showing all packets for a complete connection (starting and ending with the peripheral advertising)? Perhaps with that it will be easier to see which exact conditions need to be present in order to reproduce the issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_GAP_EVT_DISCONNECTED doesn't occur when connection is terminated after receiving LL_VERSION_IND</title><link>https://devzone.nordicsemi.com/thread/424280?ContentTypeID=1</link><pubDate>Mon, 08 May 2023 12:40:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:024e3bda-531f-4c4c-b58d-cf47c5b8d8e6</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Remo,&lt;/p&gt;
&lt;p&gt;Yes, you are right. You should get the disconnected event right away (and not as a&amp;nbsp;supervision timeout). I need to look a bit more into this but will get back to you.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_GAP_EVT_DISCONNECTED doesn't occur when connection is terminated after receiving LL_VERSION_IND</title><link>https://devzone.nordicsemi.com/thread/423943?ContentTypeID=1</link><pubDate>Fri, 05 May 2023 09:52:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d36655f8-2d66-4803-bd89-a50e6e050de8</guid><dc:creator>Remo</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;Thank you. I expect that the BLE_GAP_EVT_DISCONNECTED event occurs right away when the link has been terminated and not after 5 seconds when the supervision timeout expired.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t check the disconnect reason in my application. This was just an observation during reproducing the issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_GAP_EVT_DISCONNECTED doesn't occur when connection is terminated after receiving LL_VERSION_IND</title><link>https://devzone.nordicsemi.com/thread/423935?ContentTypeID=1</link><pubDate>Fri, 05 May 2023 09:29:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e357f90b-42ac-4424-be47-69ee0b17ccbe</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Remo,&lt;/p&gt;
&lt;p&gt;Thank you, I will test this on my end. Just on question first so there are no misunderstandings: Is it so that you&amp;nbsp;always get the&amp;nbsp;BLE_GAP_EVT_DISCONNECTED event after all, just that you do not get the disconnect reason you expected?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_GAP_EVT_DISCONNECTED doesn't occur when connection is terminated after receiving LL_VERSION_IND</title><link>https://devzone.nordicsemi.com/thread/423889?ContentTypeID=1</link><pubDate>Fri, 05 May 2023 06:42:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bc36d3d-8d1d-474c-8f66-0c1e76c5dcaa</guid><dc:creator>Remo</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;Sorry for the late response. I needed some time to reproduce this behavior with the example &amp;quot;ble_peripheral\ble_app_hrs&amp;quot; from the nRF5 SDK V17.1.0 with S132 V7.3.0.&lt;/p&gt;
&lt;p&gt;While trying to reproduce it, I realized that the disconnected-event is not lost in the error-case (as I thought in the first place), but it occurs first after the supervision timeout has expired (after 5s in my case) with the reason 0x22 BLE_HCI_STATUS_CODE_LMP_RESPONSE_TIMEOUT. In the good case, the event occurs right away with the reason 0x16 BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION.&lt;/p&gt;
&lt;p&gt;Please see below the attached modified main.c from the example ble_app_hrs which showed also the described issue. The importent part starts on line 705. There, I have added two different delays to show the good and the bad case. Important is that the delay for the bad case needs to be adjusted so that the LL_TERMINATE_IND is sent as &amp;quot;reply&amp;quot; to LL_VERSION_IND for the mobile you&amp;#39;re using.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/main_5F00_mod_5F00_for_5F00_Nordic.c"&gt;devzone.nordicsemi.com/.../main_5F00_mod_5F00_for_5F00_Nordic.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Remo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_GAP_EVT_DISCONNECTED doesn't occur when connection is terminated after receiving LL_VERSION_IND</title><link>https://devzone.nordicsemi.com/thread/423456?ContentTypeID=1</link><pubDate>Wed, 03 May 2023 08:19:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4d29ef2-8186-43a4-b426-7ecb64587474</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Remo,&lt;/p&gt;
&lt;p&gt;I am not aware of any other known issues that would cause the disconnected event to be lost. You&amp;nbsp; may loose some events (like advertising reports), but critical events like this is prioritized and will not be intentionally dropped. There may be some bug we are not aware of, though.&lt;/p&gt;
&lt;p&gt;How do you handle the SoftDevice events in your application? Could there be an issue there? Are you able to share some code that can reproduce this on a DK?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_GAP_EVT_DISCONNECTED doesn't occur when connection is terminated after receiving LL_VERSION_IND</title><link>https://devzone.nordicsemi.com/thread/423170?ContentTypeID=1</link><pubDate>Tue, 02 May 2023 06:35:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd501856-30b8-4324-8ffe-13c749ec278b</guid><dc:creator>Remo</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;Thank you for your answer.&lt;/p&gt;
&lt;p&gt;I just replaced the SoftDevice 7.2.0 with 7.3.0 (without making any changes on our FW), but the problem still occurs.&lt;/p&gt;
&lt;p&gt;Is it possible that this issue is not the same as DRGN-15619? Do you have an idea what else I can try?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_GAP_EVT_DISCONNECTED doesn't occur when connection is terminated after receiving LL_VERSION_IND</title><link>https://devzone.nordicsemi.com/thread/422969?ContentTypeID=1</link><pubDate>Fri, 28 Apr 2023 12:10:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c92e1060-9318-43cf-9a71-8dd90f1aec2c</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Remo,&lt;/p&gt;
&lt;p&gt;This is a known bug. It is fixed in version 7.3.0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>