<?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>NRF52840 Central connected with peripherial devices + advertising</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/48597/nrf52840-central-connected-with-peripherial-devices-advertising</link><description>Hello everyone, 
 
 I&amp;#39;ve got a three type of devices: 1 Central device, 2 Peripherial devices, and mulitple beacons. Central is connected with two peripherial devices with connection interval 100ms ( Bluetooth 5.0 Long range ). I want central to collect</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 14 Jun 2019 13:53:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/48597/nrf52840-central-connected-with-peripherial-devices-advertising" /><item><title>RE: NRF52840 Central connected with peripherial devices + advertising</title><link>https://devzone.nordicsemi.com/thread/192952?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2019 13:53:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e10d7cb7-8356-4027-8a7a-e3b4fb0046fb</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]1) In central device, when packed is sending to peryperial, Rx scanning is stopped in all scanning interval ( as we see on picture above for 5ms in first otion and 100ms for second option). Why scanning isn&amp;#39;t immidietly started just aftrer Tx event.[/quote]
&lt;p&gt;This is due to how the SoftDevice scheduler works. First of all, scanning always has &lt;a href="https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/multilink_scheduling/priorities_and_events_intro.html?cp=3_4_2_0_14_0"&gt;lower priority than connection events&lt;/a&gt;. The scheduler will always schedule &lt;em&gt;full&lt;/em&gt; events, so in order to make room for scanning between the connection events, you need to make the scan window shorter than the connection interval (but keep the scan interval and connection interval identical). This is e&lt;a href="https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/multilink_scheduling/scanner_timing_primary_channel.html?cp=3_4_2_0_14_3_0"&gt;xplained in the SoftDevice specification&lt;/a&gt;:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;A primary channel scanner timing-event is always placed after the central link timing-events. Scanner timing - one or more connections as a Central shows that when there are one or more active connections, the scanner or observer role timing-event will be placed after the link timing-events. With scanInterval equal to the connectionInterval and a scanWindow ≤ (connectionInterval - (∑ tevent + tScanReserved)), scanning will proceed without overlapping with central link timing-events.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;As a practical example, you can take an unmodified &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_blinky.html?cp=5_1_4_2_2_3"&gt;BLE Blinky Application&lt;/a&gt;&amp;nbsp;from SDK 15.3 and modify the sdk_config.h file of the&amp;nbsp;BLE Multi-link Example as shown by this diff and observe the scanning duty cycle like you have done with your application. You will see that it scans for most of the time, which is because it is configured with a shorter scan window (and a shorter event length), so that&amp;nbsp;scanWindow ≤ (connectionInterval - (∑ tevent + tScanReserved)) is respected.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-8b1b83fd5970462aaa49d531c30e91a1/sdk_5F00_config.diff"&gt;devzone.nordicsemi.com/.../sdk_5F00_config.diff&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
[quote user=""]2) How to maximilizeme scanning time witch two peryperial connected? How to set scan interval and window when connection interval is 100ms ?[/quote]
&lt;p&gt;It is the same principle with two peripherals connected, but the scheduling becomes more complex, so you need to reduce the window length more, or use shorter windows and intervals as you have already attempted.&lt;/p&gt;
[quote user=""]3) Is there any mechanism to fix this problem? For example advertising with ack? (Beacon: if there is no ack, send adv once again?). I know that there is scan request mechanism - can I use it as &amp;quot;ack&amp;quot; mechanism? (Beacon: if there is no scan request, send adv once again).[/quote]
&lt;p&gt;Not really. Advertisement packets are by definition connectionless and packet loss is expected. If you cannot accept packet loss, then you should use a connection or an application specific approach. Using scan requests for this mechanism might be possible using an application specific approach.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>