<?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>nrf51822 starts advertising on disconnect. How to stop it??</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70302/nrf51822-starts-advertising-on-disconnect-how-to-stop-it</link><description>I have advertising in s130 set to BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED. The idea is to advertise until a connection event is received. In reality the user will pull the finger out of the pulse ox turning it off if no connection takes place. 
 In any</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Jan 2021 10:04:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70302/nrf51822-starts-advertising-on-disconnect-how-to-stop-it" /><item><title>RE: nrf51822 starts advertising on disconnect. How to stop it??</title><link>https://devzone.nordicsemi.com/thread/288584?ContentTypeID=1</link><pubDate>Tue, 12 Jan 2021 10:04:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a371620-ce86-47d1-8455-3ba19c8fc7fe</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;Well, I set the type to&amp;nbsp;&lt;span&gt;BLE_GAP_ADV_TYPE_ADV_IND and it is scannable; the chip responds to a scan request. I don&amp;#39;t recall what happens if I set the type to&amp;nbsp;BLE_GAP_ADV_TYPE_ADV_SCAN_IND.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I see for SoftDevice s130 I have these:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;#define BLE_GAP_ADV_TYPE_ADV_IND 0x00 /**&amp;lt; Connectable undirected. */&lt;br /&gt;#define BLE_GAP_ADV_TYPE_ADV_DIRECT_IND 0x01 /**&amp;lt; Connectable directed. */&lt;br /&gt;#define BLE_GAP_ADV_TYPE_ADV_SCAN_IND 0x02 /**&amp;lt; Scannable undirected. */&lt;br /&gt;#define BLE_GAP_ADV_TYPE_ADV_NONCONN_IND 0x03 /**&amp;lt; Non connectable undirected. */&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But there is no mention here that the &amp;#39;SCAN&amp;quot; option is not connectable.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But in s140v6 I have these which is a little more extensive and clearer:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED                   0x01   /**&amp;lt; Connectable and scannable undirected
                                                                                        advertising events. */
#define BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE  0x02   /**&amp;lt; Connectable non-scannable directed advertising
                                                                                        events. Advertising interval is less that 3.75 ms.
                                                                                        Use this type for fast reconnections.
                                                                                        @note Advertising data is not supported. */
#define BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED                  0x03   /**&amp;lt; Connectable non-scannable directed advertising
                                                                                        events.
                                                                                        @note Advertising data is not supported. */
#define BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED                0x04   /**&amp;lt; Non-connectable scannable undirected
                                                                                        advertising events. */
#define BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED             0x05   /**&amp;lt; Non-connectable non-scannable undirected
                                                                                        advertising events. */
#define BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED       0x06   /**&amp;lt; Connectable non-scannable undirected advertising
                                                                                        events using extended advertising PDUs. */
#define BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_DIRECTED         0x07   /**&amp;lt; Connectable non-scannable directed advertising
                                                                                        events using extended advertising PDUs. */
#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED       0x08   /**&amp;lt; Non-connectable scannable undirected advertising
                                                                                        events using extended advertising PDUs.
                                                                                        @note Only scan response data is supported. */
#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_DIRECTED         0x09   /**&amp;lt; Non-connectable scannable directed advertising
                                                                                        events using extended advertising PDUs.
                                                                                        @note Only scan response data is supported. */
#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED    0x0A   /**&amp;lt; Non-connectable non-scannable undirected advertising
                                                                                        events using extended advertising PDUs. */
#define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_DIRECTED      0x0B   /**&amp;lt; Non-connectable non-scannable directed advertising
                                                                                        events using extended advertising PDUs. */
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 starts advertising on disconnect. How to stop it??</title><link>https://devzone.nordicsemi.com/thread/288543?ContentTypeID=1</link><pubDate>Tue, 12 Jan 2021 08:00:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5794b40f-f06e-47bd-a764-ab9e31d2f8a7</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="brianreinhold"]So I wasn&amp;#39;t sure what&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/70302/nrf51822-starts-advertising-on-disconnect-how-to-stop-it/editpost/group___b_l_e___g_a_p___a_d_v___t_y_p_e_s.html#ga594ca8490efef1702e8ccb6a28d2a1de"&gt;BLE_GAP_ADV_TYPE_ADV_SCAN_IND&lt;/a&gt;&amp;nbsp;did and how it differed from&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/70302/nrf51822-starts-advertising-on-disconnect-how-to-stop-it/editpost/group___b_l_e___g_a_p___a_d_v___t_y_p_e_s.html#ga594ca8490efef1702e8ccb6a28d2a1de"&gt;BLE_GAP_ADV_TYPE_ADV_IND&lt;/a&gt;.[/quote]
&lt;p&gt;I see. It is unfortunately not clear from the API documentation. To be specific&amp;nbsp;BLE_GAP_ADV_TYPE_ADV_SCAN_IND is scannable, undirected and non-connectable.&amp;nbsp;BLE_GAP_ADV_TYPE_ADV_IND is non-scannable, undirected and connectable.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 starts advertising on disconnect. How to stop it??</title><link>https://devzone.nordicsemi.com/thread/288465?ContentTypeID=1</link><pubDate>Mon, 11 Jan 2021 17:09:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c74ed77-cf46-4c24-971c-b56f25719561</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;Yes, but it includes in that list of non-connectable modes&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/70302/nrf51822-starts-advertising-on-disconnect-how-to-stop-it/editpost/group___b_l_e___g_a_p___a_d_v___t_y_p_e_s.html#ga594ca8490efef1702e8ccb6a28d2a1de"&gt;BLE_GAP_ADV_TYPE_ADV_SCAN_IND&lt;/a&gt;&amp;nbsp;which, as you describe it, is connectable as I understand it. So I have been using&amp;nbsp; &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/70302/nrf51822-starts-advertising-on-disconnect-how-to-stop-it/editpost/group___b_l_e___g_a_p___a_d_v___t_y_p_e_s.html#ga594ca8490efef1702e8ccb6a28d2a1de"&gt;BLE_GAP_ADV_TYPE_ADV_IND&lt;/a&gt;&amp;nbsp;instead which responds to scan requests as well. So I wasn&amp;#39;t sure what&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/70302/nrf51822-starts-advertising-on-disconnect-how-to-stop-it/editpost/group___b_l_e___g_a_p___a_d_v___t_y_p_e_s.html#ga594ca8490efef1702e8ccb6a28d2a1de"&gt;BLE_GAP_ADV_TYPE_ADV_SCAN_IND&lt;/a&gt;&amp;nbsp;did and how it differed from&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/70302/nrf51822-starts-advertising-on-disconnect-how-to-stop-it/editpost/group___b_l_e___g_a_p___a_d_v___t_y_p_e_s.html#ga594ca8490efef1702e8ccb6a28d2a1de"&gt;BLE_GAP_ADV_TYPE_ADV_IND&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 starts advertising on disconnect. How to stop it??</title><link>https://devzone.nordicsemi.com/thread/288444?ContentTypeID=1</link><pubDate>Mon, 11 Jan 2021 15:34:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10344ef6-a086-4f63-b084-4cf67f38be26</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]How can I shut this thing up?[/quote]
&lt;p&gt;The SoftDevice itself will not start to advertise on it&amp;#39;s own. Are you by any chance using the advertising module (ble_advertising.c/.h)? If so, it will start advertising after a&amp;nbsp;BLE_GAP_EVT_DISCONNECTED event.&lt;/p&gt;
[quote user=""]&lt;p&gt;&amp;quot;&lt;span&gt;An application can start an advertising procedure for broadcasting purposes while a connection is active. After a&amp;nbsp;&lt;/span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/70302/nrf51822-starts-advertising-on-disconnect-how-to-stop-it/editpost/group___b_l_e___g_a_p___e_n_u_m_e_r_a_t_i_o_n_s.html#ggada486dd3c0cce897b23a887bed284fefaa0b4789724d202a13a5e7eab85c52957"&gt;BLE_GAP_EVT_CONNECTED&lt;/a&gt;&lt;span&gt;&amp;nbsp;event is received, this function may therefore be called to start a broadcast advertising procedure. The advertising procedure cannot however be connectable (it must be of type&amp;nbsp;&lt;/span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/70302/nrf51822-starts-advertising-on-disconnect-how-to-stop-it/editpost/group___b_l_e___g_a_p___a_d_v___t_y_p_e_s.html#ga594ca8490efef1702e8ccb6a28d2a1de"&gt;BLE_GAP_ADV_TYPE_ADV_SCAN_IND&lt;/a&gt;&lt;span&gt;&amp;nbsp;or&amp;nbsp;&lt;/span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/70302/nrf51822-starts-advertising-on-disconnect-how-to-stop-it/editpost/group___b_l_e___g_a_p___a_d_v___t_y_p_e_s.html#ga8c86ca45ebffc3938fd97f9556daa49c"&gt;BLE_GAP_ADV_TYPE_ADV_NONCONN_IND&lt;/a&gt;&lt;span&gt;).&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;There you state that a scannable advertisement is not connectable. What do you mean by &amp;#39;scannable&amp;#39;?&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&amp;quot;Scannable&amp;quot; here means that the device is scannable, i.e. will listen for scan requests and reply with a scan response. I think you are reading the documentation wrong, though. The key here is that the S130 SoftDevice (unlike SoftDevices for the nRF52) only supports a single connection in the peripheral role. Therefor, the point here is that when there is an active connection, you can only advertise in non-connectable mode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>