<?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>Unwanted disconnection after notification</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18524/unwanted-disconnection-after-notification</link><description>Hi, 
 I am trying to write a program which send data through notification. All is working, excepted that once the notifications are done, the device automatically disconnects after a few seconds. And there is no possibility to write nor read the other</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 Jan 2017 15:07:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18524/unwanted-disconnection-after-notification" /><item><title>RE: Unwanted disconnection after notification</title><link>https://devzone.nordicsemi.com/thread/71483?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2017 15:07:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:553eb69a-2b66-42ee-b818-16ed9dd65883</guid><dc:creator>Guillaume Levant</dc:creator><description>&lt;p&gt;Thanks a lot ! I forgot to set one parameter that is needed for sd_ble_gatts_rw_authorize_reply, so this function returns the error NRF_ERROR_INVALID_PARAM and doesn&amp;#39;t send the reply.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unwanted disconnection after notification</title><link>https://devzone.nordicsemi.com/thread/71482?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2017 14:21:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3af941de-1887-4fbe-a4dc-96809362cb85</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Guillaume,&lt;/p&gt;
&lt;p&gt;From the trace I can see that it&amp;#39;s not disconnect right after you send notification. What you capture in your image in the question is the LL_TERMINATE_IND packet which mean it&amp;#39;s the termination packet from the Master/central to disconnect.&lt;/p&gt;
&lt;p&gt;The disconnection happen 30 second after a write request (packet 637) it&amp;#39;s a timeout for the write request because there is no write response for it.&lt;/p&gt;
&lt;p&gt;Usually this happens when you set a characteristic with authorization and in the application you don&amp;#39;t response to the BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event. Please have a look &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v2.0.1/group___b_l_e___g_a_t_t_s___w_r_i_t_e___r_e_q___a_u_t_h___m_s_c.html?cp=3_7_2_1_0_2_4_3_19"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The write request is for attribute at handle ID 0x0f, you may want to check. Same write response to handle 0x10 (packet 302)had no issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unwanted disconnection after notification</title><link>https://devzone.nordicsemi.com/thread/71481?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2017 13:40:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3570196-340f-421a-92e2-02011c6db655</guid><dc:creator>Guillaume Levant</dc:creator><description>&lt;p&gt;I send it to you via PM right away.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unwanted disconnection after notification</title><link>https://devzone.nordicsemi.com/thread/71479?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2017 13:22:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73494d06-922f-423f-9bc6-683a14a32113</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Please upload the whole sniffer trace file. If there is confidential information, you can send me via PM.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unwanted disconnection after notification</title><link>https://devzone.nordicsemi.com/thread/71480?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2017 13:10:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e057029-0e82-4506-af6a-5373a5042dff</guid><dc:creator>Guillaume Levant</dc:creator><description>&lt;p&gt;I finally managed to get a sniffer. I added in my question the information catched from the message which came at the same moment than the disconnection event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unwanted disconnection after notification</title><link>https://devzone.nordicsemi.com/thread/71473?ContentTypeID=1</link><pubDate>Mon, 02 Jan 2017 11:37:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bef88284-c9eb-4016-8515-254f3028dca1</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Have you managed to catch the sniffer ?&lt;/p&gt;
&lt;p&gt;Also please  try to test using the nRFConnect app.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unwanted disconnection after notification</title><link>https://devzone.nordicsemi.com/thread/71474?ContentTypeID=1</link><pubDate>Mon, 02 Jan 2017 10:26:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c533cf46-d5ff-4e9c-bcaa-196759cf366b</guid><dc:creator>Guillaume Levant</dc:creator><description>&lt;p&gt;Yes I can receive the data on the phone without any problem. And if I only enable CCCD, the device stays connected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unwanted disconnection after notification</title><link>https://devzone.nordicsemi.com/thread/71478?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2016 14:29:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:576623a2-6107-4b1e-9dc8-d5ed211d580b</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;A sniffer trace would really be helpful. You would need a nRF51 dongle/DK to use as a sniffer trace.&lt;/p&gt;
&lt;p&gt;One question, do you receive the data on the phone, from your notification ? If you don&amp;#39;t send the notification (but enable CCCD), the link will still keep with no disconnection?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unwanted disconnection after notification</title><link>https://devzone.nordicsemi.com/thread/71477?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2016 14:18:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2417be16-3c68-4c8a-b414-02b520d7df0e</guid><dc:creator>Guillaume Levant</dc:creator><description>&lt;p&gt;Sorry I didn&amp;#39;t want to convert you comment... I use LightBlue to make my test, and I noticed that the device disconnect each time 30 seconds after the last notification. I saw that NEXT_CONN_PARAMS_UPDATE_DELAY was set to 30 sec, so I set it to 20 sec to check if it is related to my problem, but the disconnection still happens 30 sec after the last notification.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unwanted disconnection after notification</title><link>https://devzone.nordicsemi.com/thread/71476?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2016 13:49:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a62a36a9-8fe2-4a80-8f13-df6afd96b51f</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Could you try to test with the nRFConnect app ? the DISCONNECTED event came right after the notification or only when you see that it&amp;#39;s only disconnected on the phone (after a few seconds) ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unwanted disconnection after notification</title><link>https://devzone.nordicsemi.com/thread/71475?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2016 09:42:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c6a7ce3-61b1-4d9f-9ef1-a8d9ad6061f6</guid><dc:creator>Guillaume Levant</dc:creator><description>&lt;p&gt;Hi,
I checked the reason, it is BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION, but the central didn&amp;#39;t crash, and the device is working perfectly after the disconnection event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unwanted disconnection after notification</title><link>https://devzone.nordicsemi.com/thread/71472?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2016 09:37:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5a222b7-1df6-4f72-aac6-f026a4d0b5c2</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Most probably either your device or the central crashed after the notification is sent. I can&amp;#39;t guess the reason. You may need to check what disconnect reason is (check the parameter when the DISCONNECTED event occurs) and check if your central device is crashed.
A &lt;a href="https://www.nordicsemi.com/eng/Products/Bluetooth-Smart-Bluetooth-low-energy/nRF-Sniffer/"&gt;sniffer trace&lt;/a&gt; would be useful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>