<?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 Continue Peripheral Device Advertising After the Connection of a Central Device that Peripheral Device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52605/how-to-continue-peripheral-device-advertising-after-the-connection-of-a-central-device-that-peripheral-device</link><description>I am developing firmware for my Peripheral Device (nRF52840) using S140 (v7) and SDK 15.3. In my application, I will advertise (with advert payload changes) and support Smartphone app connect/disconnect to read and write custom characteristic values.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 26 Sep 2019 21:22:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52605/how-to-continue-peripheral-device-advertising-after-the-connection-of-a-central-device-that-peripheral-device" /><item><title>RE: How to Continue Peripheral Device Advertising After the Connection of a Central Device that Peripheral Device</title><link>https://devzone.nordicsemi.com/thread/212146?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2019 21:22:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ff5ec09-01c6-4d23-8994-ffdfb4b5bd60</guid><dc:creator>Mark J</dc:creator><description>&lt;p&gt;Thanks again &lt;a href="https://devzone.nordicsemi.com/members/kenneth"&gt;Kenneth&lt;/a&gt;. That did the trick! increased both counts (1-&amp;gt;2 for each) and modified RAM start (size was already 0x4000) as required to get past nrf_sdh_ble_enable(). Now, I can see advertising immediately when I disconnect using the nRF Connect app. Thanks much!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Continue Peripheral Device Advertising After the Connection of a Central Device that Peripheral Device</title><link>https://devzone.nordicsemi.com/thread/212143?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2019 20:18:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:997438a4-4743-4c7f-bb63-4c81dce50afd</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;You likely need to increase&amp;nbsp;NRF_SDH_BLE_PERIPHERAL_LINK_COUNT and&amp;nbsp;NRF_SDH_BLE_TOTAL_LINK_COUNT, I suspect that the&amp;nbsp;&lt;span&gt;sd_ble_gap_adv_start() return an error code here if you don&amp;#39;t.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Once you do that you will likely get a warning in&amp;nbsp;nrf_sdh_ble_enable() that you need to modify the RAM size required by the softdevice.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Continue Peripheral Device Advertising After the Connection of a Central Device that Peripheral Device</title><link>https://devzone.nordicsemi.com/thread/212139?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2019 20:03:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2a6cf1c-56c2-4a90-af5e-de0cc782be3e</guid><dc:creator>Mark J</dc:creator><description>&lt;p&gt;Thank you for the reply &lt;a href="https://devzone.nordicsemi.com/members/kenneth"&gt;Kenneth&lt;/a&gt;. I have added a&amp;nbsp;&lt;span&gt;sd_ble_gap_adv_start() call when&amp;nbsp;BLE_GAP_EVT_CONNECTED hits the&amp;nbsp;ble_evt_handler(), but advertising is not restarting. I suspect that (for some reason) advertising is not permitted when a connection is made.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Any other options that I should try?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Continue Peripheral Device Advertising After the Connection of a Central Device that Peripheral Device</title><link>https://devzone.nordicsemi.com/thread/212039?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2019 12:00:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea3f7cf7-f772-4521-ad57-2b716003e0bb</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Different applications have different requirements, so the softdevice have tried to make it as flexible as possible. You may start advertising again on the connection event, or at any time during connection if you want, there is no need to wait for the disconnect event. You may also be connected to two central devices and/or disconnect the first connection on the second connection occurs. Again it can pretty much do whatever you want, but you need to call the api for it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have seen some phones may keep connection even if the application is shut down or want to close connection. There is no way for the peripheral to know that this have occured, but you may for instance add some keep alive data from the app, so once the peripheral have not received any keep alive for a timeout period it may disconnect from the phone and start advertising again. Again, you are free to do this as you see fit.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>