<?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>Is it possible keep advertising when ancs connecting?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18312/is-it-possible-keep-advertising-when-ancs-connecting</link><description>Hi, I&amp;#39;m using SDK12.1 example ble_app_ancs_c.
Is it possible keep advertising (non-connectable is ok) when ancs connecting?
And how to do it? 
 I tried call advertising_start() at on_ble_evt-&amp;gt;BLE_GAP_EVT_CONNECTED.
But got error. 
 Sincerely,
K</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 May 2019 16:04:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18312/is-it-possible-keep-advertising-when-ancs-connecting" /><item><title>RE: Is it possible keep advertising when ancs connecting?</title><link>https://devzone.nordicsemi.com/thread/185249?ContentTypeID=1</link><pubDate>Fri, 03 May 2019 16:04:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87b47aee-aa74-4fee-92ba-c2fadc30bea8</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;I had the same question, and came across this, but it&amp;#39;s no good for SDK 15 - the advertising has changed significantly.&lt;/p&gt;
&lt;p&gt;This one is for SDK 15:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/45644/how-do-i-simply-do-a-non-connectable-advert-on-nrf52-using-sdk-15"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/45644/how-do-i-simply-do-a-non-connectable-advert-on-nrf52-using-sdk-15&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it possible keep advertising when ancs connecting?</title><link>https://devzone.nordicsemi.com/thread/70727?ContentTypeID=1</link><pubDate>Wed, 14 Dec 2016 11:16:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:273f9f19-a125-411c-8cb8-675e6ab9c752</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;This behavior is expected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it possible keep advertising when ancs connecting?</title><link>https://devzone.nordicsemi.com/thread/70726?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2016 15:21:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3ace6f1-0794-430e-aea8-9d0366bddac9</guid><dc:creator>frogofmagic</dc:creator><description>&lt;p&gt;Yes , and other devices only can see advertising can&amp;#39;t connect it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it possible keep advertising when ancs connecting?</title><link>https://devzone.nordicsemi.com/thread/70724?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2016 12:47:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df19223d-5da7-4ec8-be3e-90c866198af3</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;So you are connected with a iPhone 6, you open LightBlue on that same iPhone 6? Then you only have one connection, and LightBlue is just using that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it possible keep advertising when ancs connecting?</title><link>https://devzone.nordicsemi.com/thread/70725?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2016 01:28:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81a77b97-56c0-4c0a-9d04-3c2679ad05eb</guid><dc:creator>frogofmagic</dc:creator><description>&lt;p&gt;Hi Petter, I test it again, First time I connected with my iPhone6 and paired. Open Lightblue can see the advertising and also can connect it.( I think this should be normal?) But I tried my iPad air and failed to connect it.&lt;/p&gt;
&lt;p&gt;I think iPhone6 still connected to nrf51822 and that&amp;#39;s why  Lightblue can  connect it again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it possible keep advertising when ancs connecting?</title><link>https://devzone.nordicsemi.com/thread/70723?ContentTypeID=1</link><pubDate>Mon, 12 Dec 2016 10:59:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86f0d7c4-39d5-45a9-a555-0cab6ad9726c</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Looks correct. You should only be able to do non-connectable advertising while you are in a connection, and you shouldn&amp;#39;t be able to connect to non-connectable advertising. Are you saying that you are able to connect to it while you are connected to it? Or are you connecting with another device while you are connect to it? Please clarify.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is it possible keep advertising when ancs connecting?</title><link>https://devzone.nordicsemi.com/thread/70722?ContentTypeID=1</link><pubDate>Mon, 12 Dec 2016 07:58:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00344632-d92e-47d7-8cf0-6f1e67d4ed96</guid><dc:creator>frogofmagic</dc:creator><description>&lt;p&gt;OK, after try and error, now it can advertising when ancs connecting...
I&amp;#39;m not sure it&amp;#39;s right or not, please help me check it~&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;1. Add another initial.

static void non_connectable_advertising_init(void)
{
    uint32_t             err_code;    
		ble_gap_adv_params_t adv_params;
		
		memset(&amp;amp;adv_params, 0, sizeof(ble_gap_adv_params_t));
		adv_params.type        = BLE_GAP_ADV_TYPE_ADV_NONCONN_IND ;
		adv_params.p_peer_addr = NULL;
		adv_params.fp          = BLE_GAP_ADV_FP_ANY;
		adv_params.interval    = 200 ;
		adv_params.timeout     = 0;
		adv_params.p_whitelist =NULL;
		
		err_code = sd_ble_gap_adv_start(&amp;amp;adv_params);
		APP_ERROR_CHECK(err_code);
		
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And call this new function when connected.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void on_ble_evt(ble_evt_t * p_ble_evt)
{
    uint32_t err_code = NRF_SUCCESS;

    switch (p_ble_evt-&amp;gt;header.evt_id)
    {
        case BLE_GAP_EVT_CONNECTED:
            NRF_LOG_INFO(&amp;quot;Connected.\r\n&amp;quot;);
            err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);
            APP_ERROR_CHECK(err_code);
            m_cur_conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
            err_code = app_timer_start(m_sec_req_timer_id, SECURITY_REQUEST_DELAY, NULL);
            APP_ERROR_CHECK(err_code);
				
	        non_connectable_advertising_init();  //&amp;lt;===here.
            break; // BLE_GAP_EVT_CONNECTED
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, it will keep advertising after connected.
But...you can connect it again,  I already set to BLE_GAP_ADV_TYPE_ADV_NONCONN_IND .
Still don&amp;#39;t know why still can connect.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>