<?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 solve the stop scanning due to unknown reason?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40026/how-to-solve-the-stop-scanning-due-to-unknown-reason</link><description>Hi, everyone, 
 We are developing BLE project on nRF52832 chip by using SDK14.0 software. 
 The project is build from one master-device and many slave- devices. 
 The master device must establish connection to one of the slave-devices from time to time</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 01 Nov 2018 14:55:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40026/how-to-solve-the-stop-scanning-due-to-unknown-reason" /><item><title>RE: How to solve the stop scanning due to unknown reason?</title><link>https://devzone.nordicsemi.com/thread/155600?ContentTypeID=1</link><pubDate>Thu, 01 Nov 2018 14:55:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1227dfbb-f88b-4bf6-abeb-37383920b1eb</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Boris,&amp;nbsp;&lt;br /&gt;after calling&amp;nbsp;&lt;span&gt;sd_ble_gap_connect() you should get the BLE_GAP_EVT_CONNECTED if you successfully connected or the BLE_GAP_EVT_TIMEOUT if the connection establishment timesout. If you call sd_ble_gap_connect_cancel it will return NRF_SUCCESS if the connection establishment is cancelled,&amp;nbsp;&lt;/span&gt;&lt;span&gt;see&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v5.0.0/group___b_l_e___g_a_p___c_e_n_t_r_a_l___c_o_n_n___m_s_c.html"&gt;Central Connection Establishment and Termination&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So you should be able to restart scanning by calling sd_ble_gap_scan_start when you get&amp;nbsp;BLE_GAP_EVT_CONNECTED&amp;nbsp;or&amp;nbsp;BLE_GAP_EVT_TIMEOUT or after you call&amp;nbsp;sd_ble_gap_connect_cancel(). You state that this does not work, do you get any error code from &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v5.0.0/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html#ga3db84fa4870b155489187103906cf318"&gt;sd_ble_gap_scan_start&lt;/a&gt;&amp;nbsp;&amp;nbsp;indicating that scanning is not started?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Bjørn&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>