<?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>Problem with slow advertising nRF51 SDK9</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21101/problem-with-slow-advertising-nrf51-sdk9</link><description>I use SDK 9 and nrF51 in the advertising mode. I want to advertise each 1s packets.
First, I call function 
 set_adv_params(&amp;amp;m_adv_params);
 
 where I 
 static void set_adv_params(ble_gap_adv_params_t * adv_params)
 
 { 
memset(adv_params, 0,</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 07 Apr 2017 09:09:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21101/problem-with-slow-advertising-nrf51-sdk9" /><item><title>RE: Problem with slow advertising nRF51 SDK9</title><link>https://devzone.nordicsemi.com/thread/82538?ContentTypeID=1</link><pubDate>Fri, 07 Apr 2017 09:09:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7dbb72f6-2779-46b7-9fb9-c4dc3f5e88e9</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;I believe so yes. Then I suspect there is some delay to when you m_peer_list.length is updated. You could create your own peer counter variable that you increment as part of a connect event, and decrement on disconnects. That should give you an up to date number of connected peers without delay.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with slow advertising nRF51 SDK9</title><link>https://devzone.nordicsemi.com/thread/82537?ContentTypeID=1</link><pubDate>Fri, 07 Apr 2017 08:56:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3510f235-52ea-4779-802a-77277b84cbc9</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;In another words, my check like&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if(m_peer_list.length &amp;gt; 0) {}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;also correct?
I have some problems when central with code above doesn&amp;#39;t sometimes see connection from peripherial. Sometimes up to 10-15 seconds.
May be I should check connection exist by another method?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with slow advertising nRF51 SDK9</title><link>https://devzone.nordicsemi.com/thread/82536?ContentTypeID=1</link><pubDate>Fri, 07 Apr 2017 08:51:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8838a2ee-8dc3-4841-afce-1c226d721a74</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;Hi! The exact way to do it will depend on what your central is and how it keeps track of its peers. If it is a Nordic device you can look at the multilink central example in the SDK, and see what they do on connection events. In SDK12, on disconnect, they perform a check very similar to yours to see if there are any devices connected with the following line&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if (central_link_cnt == 0)
{
 bsp_board_led_off(CENTRAL_CONNECTED_LED);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In SDK 9 they use a similar check for m_peer_count, and then decrement it upon disconnect. So I believe your check is a viable way to doing it, as long as m_peer_list.length contains an updated number of currently connected peers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with slow advertising nRF51 SDK9</title><link>https://devzone.nordicsemi.com/thread/82535?ContentTypeID=1</link><pubDate>Fri, 07 Apr 2017 07:56:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:333c19fb-8ef1-4128-bd64-4b7d78bc629b</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;Hello! One more queston:
Is it correct to check when peripherial connect to my central with next code in the central:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if(m_peer_list.length &amp;gt; 0) {}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Or does it have another method?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with slow advertising nRF51 SDK9</title><link>https://devzone.nordicsemi.com/thread/82534?ContentTypeID=1</link><pubDate>Thu, 06 Apr 2017 07:32:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8a4d4d7-0f18-4d74-913f-92d8ff49b2ca</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;Thanks a lot, J0rn.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with slow advertising nRF51 SDK9</title><link>https://devzone.nordicsemi.com/thread/82533?ContentTypeID=1</link><pubDate>Thu, 06 Apr 2017 06:48:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c9615ed-fe69-41c0-82be-8060f7e0ce13</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;I have conferred with a colleague and as far as we know there shouldn&amp;#39;t be an issue with having equal scan window and interval. You will then be scanning close to 100% of the time, but there will be some interruptions due to channel changes. See this link:
&lt;a href="https://devzone.nordicsemi.com/question/64842/how-can-i-decide-scan-window-interval-for-continuous-scanning/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As Kenneth also mentions in the post, continuous scanning can interfere with other operations in the Softdevice, so that&amp;#39;s also something to consider. If the central have many other things to do it might be more beneficial to scan with both short windows and intervals, as you can then loose a couple of scans due to other operations with minimum impact.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with slow advertising nRF51 SDK9</title><link>https://devzone.nordicsemi.com/thread/82532?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 15:21:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90fa11d5-5422-4385-a03d-52f91c58e567</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;Thanks for answer. I readed that in some SDK were problems with it. I mean that no recommend use same settings. For example, if window = scan = 160 it is no good. Or I can use same settings in SDK 9?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with slow advertising nRF51 SDK9</title><link>https://devzone.nordicsemi.com/thread/82531?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 15:16:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2da5028f-6018-4896-ab5f-185d38a416a4</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;You are of course completely right. That was a blunder on my part and I apologise. Setting the scan interval equal to the scan window as you originally suggested should give a continuous scan, and should guarantee that you catch the advertisement.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with slow advertising nRF51 SDK9</title><link>https://devzone.nordicsemi.com/thread/82530?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 15:10:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e49215bf-bd1f-4550-a528-8f9fcd3bb0ee</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;No, I mean that (as I understand) scan window should be less than interval. In my opinion. Is it possible to set scan window more than interval? Are You sure that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with slow advertising nRF51 SDK9</title><link>https://devzone.nordicsemi.com/thread/82529?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 15:08:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e326a9ac-c5cd-43ea-a301-43fb49948e9d</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;Both scan interval and scan window should be configurable between 2.5ms to 10.24s (described in ble_gap.h). Setting scan window to 320 should correspond to 200ms which is within the spec. Are you having problems setting the desired values?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with slow advertising nRF51 SDK9</title><link>https://devzone.nordicsemi.com/thread/82528?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 14:58:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a89d56c-5e84-4b58-9b92-40ef6101ad9d</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;Sorry, are your sure that possible to set scan interval 160 and scan window 320???&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with slow advertising nRF51 SDK9</title><link>https://devzone.nordicsemi.com/thread/82527?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 14:48:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b05cbba-a742-41f7-b242-f27ba2022bf0</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;I don&amp;#39;t think having them both at 160 would be a good idea. 160 corresponds to 100 ms, so you are looking for the advertiser for 100 ms, and then waiting 100 ms. In the long run you end up with a periodicity which aligns with the advertiser, meaning that in an ideal world you would always miss the advertisement, if you missed it the first time. You could try using Scan interval 160 and scan window 320 as a start. If I&amp;#39;m not mistaken that should guarantee you catch the next advertisement if you miss the first.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with slow advertising nRF51 SDK9</title><link>https://devzone.nordicsemi.com/thread/82526?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 13:39:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bbbfa01-c228-4fe6-97f4-a0493188dac0</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;Thanks, J0rn, for datailed answer. Yes, I try to change scan window in my central before. Could You advise me what better for my case shoul I settings?
Now my settings in central is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define SCAN_INTERVAL           160
#define SCAN_WINDOW                158
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or better make 160 and 160 both?
or better will another digits?
power consumption for central doesn&amp;#39;t matter.
Peripherial- from battery.
This behavior of central- is it only in scan window setup?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with slow advertising nRF51 SDK9</title><link>https://devzone.nordicsemi.com/thread/82525?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 13:14:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b23272c8-e1d4-4491-8ac7-fafe988ea3e2</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;Hello Mikhail&lt;/p&gt;
&lt;p&gt;I suspect the reason you see such varying delays before your central detects your peripheral is due an unlucky choice of advertising interval and scan interval/window.&lt;/p&gt;
&lt;p&gt;Your peripheral only advertises once every second, during which time it advertises sequentially on all three advertisement channels. The duration of this broadcast is very short.&lt;/p&gt;
&lt;p&gt;Your central is configured with a scan window and interval, and will look for the peripheral once per scan interval, for the time specified by the scan window, and in only one channel at a time. With a long advertisement interval as you have the central and peripheral intervals might &amp;quot;miss&amp;quot; one another, so that the peripheral isn&amp;#39;t advertising when the central is looking for it.&lt;/p&gt;
&lt;p&gt;Please see section A in this blog post for more details on how central and peripheral behaves during advertisement &lt;a href="https://devzone.nordicsemi.com/blogs/782/bluetooth-smart-and-the-nordics-softdevices-part-1/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You could try to change your peripherals advertisement interval, or the central&amp;#39;s scan interval and window, to see if you get a more predictable result.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Jørn Frøysa&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with slow advertising nRF51 SDK9</title><link>https://devzone.nordicsemi.com/thread/82524?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 12:08:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a407c973-68ed-4530-8002-6573bc3c47cf</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;Central connect via static passkey to pheriferial. But I think that pheriferial has no problem. I can see on my oscilloscope consumption every adertising time period. For me it is 1 S. But central sometimes can&amp;#39;t see  pheriferial 5-10 seconds! Why? I send adv packets every 1S.
Any idea?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with slow advertising nRF51 SDK9</title><link>https://devzone.nordicsemi.com/thread/82523?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 11:25:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4d8038f-9085-46e7-bd78-39318c29a6c3</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;Are you actually connecting (pairing) the central to the peripheral, or is your central just listening to the advertisement packets from the peripheral?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>