<?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>How to disconnect Peripheral device after sending a packet to central using sd_ble_gap_disconnect()</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57135/how-to-disconnect-peripheral-device-after-sending-a-packet-to-central-using-sd_ble_gap_disconnect</link><description>Hi Nordic Team, 
 Requirement- 
 Connect-&amp;gt;Send 1 packet-&amp;gt;Disconnect-&amp;gt;Connect... 
 
 I am Sending a data packet to central using Timer handler and trying to disconnect using sd_ble_gap_disconnect() in same timer handler. 
 But i am getting &amp;lt;error&amp;gt; app</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 30 Jan 2020 12:09:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57135/how-to-disconnect-peripheral-device-after-sending-a-packet-to-central-using-sd_ble_gap_disconnect" /><item><title>RE: How to disconnect Peripheral device after sending a packet to central using sd_ble_gap_disconnect()</title><link>https://devzone.nordicsemi.com/thread/231870?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2020 12:09:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0cb9fa0e-9b8d-4995-81de-8d310d491a84</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The error code 12290 = 0x3002 is:&lt;/p&gt;
&lt;p&gt;#define BLE_ERROR_INVALID_CONN_HANDLE&amp;nbsp; &amp;nbsp; (NRF_ERROR_STK_BASE_NUM+0x002) /**&amp;lt; Invalid connection handle. */&lt;/p&gt;
&lt;p&gt;In other words it seems that&amp;nbsp;&lt;span&gt;m_conn_handle is wrong in this case. Maybe you are already disconnected?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You should likely want some delay between&amp;nbsp;Send 1 packet-&amp;gt;Disconnect, either a fixed delay (e.g. 100ms), or wait for notification sent event before disconnect.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Kenneth&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>