<?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>when I use sd_ble_gap_disconnect() in button evt handle it appear error_code 0x3002</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/3023/when-i-use-sd_ble_gap_disconnect-in-button-evt-handle-it-appear-error_code-0x3002</link><description>app_error_handler, L:188]
error_code=0x3002 
 So how can I avoid this error? 
 I just want to disconnect from peripheral device</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 13 Oct 2014 17:49:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/3023/when-i-use-sd_ble_gap_disconnect-in-button-evt-handle-it-appear-error_code-0x3002" /><item><title>RE: when I use sd_ble_gap_disconnect() in button evt handle it appear error_code 0x3002</title><link>https://devzone.nordicsemi.com/thread/11378?ContentTypeID=1</link><pubDate>Mon, 13 Oct 2014 17:49:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7fd84fc0-84cf-4ced-950e-94b7d4974e1a</guid><dc:creator>Vyacheslav Lebets</dc:creator><description>&lt;p&gt;0x3002 is BLE_ERROR_INVALID_CONN_HANDLE.&lt;/p&gt;
&lt;p&gt;As for my code,  first init m_conn_handle was in device_manager_evt_handler DM_EVT_CONNECTION as:&lt;/p&gt;
&lt;p&gt;m_conn_handle = p_event-&amp;gt;event_param.p_gap_param-&amp;gt;conn_handle;&lt;/p&gt;
&lt;p&gt;but  in next event DM_EVT_DEVICE_CONTEXT_STORED,
p_event-&amp;gt;event_param.p_gap_param-&amp;gt;conn_handle stay another, and this another handler
was a parameter in sd_ble_gap_disconnect.&lt;/p&gt;
&lt;p&gt;I do not know, why conn_handler is changed, but when I remove this string from  event DM_EVT_DEVICE_CONTEXT_STORED, function sd_ble_gap_disconnect return OK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: when I use sd_ble_gap_disconnect() in button evt handle it appear error_code 0x3002</title><link>https://devzone.nordicsemi.com/thread/11377?ContentTypeID=1</link><pubDate>Mon, 13 Oct 2014 16:31:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8da09543-ad1f-4164-8147-db9385a6afe0</guid><dc:creator>Vyacheslav Lebets</dc:creator><description>&lt;p&gt;And BLE_HCI_CONN_INTERVAL_UNACCEPTABLE)
and BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION
have same result&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: when I use sd_ble_gap_disconnect() in button evt handle it appear error_code 0x3002</title><link>https://devzone.nordicsemi.com/thread/11376?ContentTypeID=1</link><pubDate>Mon, 13 Oct 2014 12:57:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ae9d17f-18ee-451a-8e4d-acbafae266c0</guid><dc:creator>Vyacheslav Lebets</dc:creator><description>&lt;p&gt;I have same problem:
After sucessfully bonding with nRF51822, immediately on nRF side i call&lt;/p&gt;
&lt;p&gt;sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION);&lt;/p&gt;
&lt;p&gt;and function return NRF_ERROR_SOFTDEVICE_NOT_ENABLED.&lt;/p&gt;
&lt;p&gt;What could it be?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>