<?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>Best way to know when timeslot is about to start?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/59462/best-way-to-know-when-timeslot-is-about-to-start</link><description>Hi all, 
 We are currently working on an application that uses the timeslot API, and requests timeslots spaced 20ms apart. 
 In our application we need to trigger some functions right before the next timeslot starts (while softdevice operations are still</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 30 Mar 2020 13:10:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/59462/best-way-to-know-when-timeslot-is-about-to-start" /><item><title>RE: Best way to know when timeslot is about to start?</title><link>https://devzone.nordicsemi.com/thread/242429?ContentTypeID=1</link><pubDate>Mon, 30 Mar 2020 13:10:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b5e5949-f92a-4273-943b-82027b808f89</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank your for a good explanation :) &lt;a href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/multilink_scheduling/advertiser_timing.html?cp=4_6_2_0_14_4"&gt;From Softdevice specification&lt;/a&gt;&amp;nbsp;:&amp;nbsp;&amp;quot;&lt;em&gt;Advertiser is started as early as possible, after a random delay in the range of 3 - 13 ms, asynchronously to any other role timing-events. If no roles are running, advertiser timing-events are able to start and run without any collision.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;My guess is that this random delay is causing your timeslots to be rejected sometimes.&amp;nbsp;&lt;/p&gt;
[quote user="a_87"]However, we&amp;#39;ve found that if we start advertising after the end of the &lt;em&gt;previous&lt;/em&gt; timeslot, and stop advertising before the start of the&amp;nbsp;&lt;em&gt;next&lt;/em&gt; timeslot, the timeslot requests seem to be accepted without issue. [/quote]
&lt;p&gt;Ok, so you&amp;#39;re planning to advertise in between timeslots? My initial guess is that 20 ms is a too small interval for the Softdevice to start advertising before it needs to stop it. The Softdevice needs to queue the operation before it executes it, which means that you have the queueing delay + the random delay which makes it very difficult to schedule something in between the timeslots.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best way to know when timeslot is about to start?</title><link>https://devzone.nordicsemi.com/thread/242178?ContentTypeID=1</link><pubDate>Fri, 27 Mar 2020 19:34:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51e45423-8d16-43bc-8563-f0615047e5d8</guid><dc:creator>a_87</dc:creator><description>&lt;p&gt;Hey Jared,&lt;/p&gt;
&lt;p&gt;Thank you for the reply!&lt;/p&gt;
&lt;p&gt;Our application acts as a sort of BLE gateway to a network of ESB devices. It uses timeslots to switch over to ESB and sample the ESB network for 5ms (timeslot length)&amp;nbsp;and then sends this information out through BLE notifications. This happens approximately every 20ms (normal timeslot request interval).&lt;/p&gt;
&lt;p&gt;We&amp;#39;d prefer that this &amp;quot;sampling&amp;quot; timeslot runs as close to every 20ms as possible,&amp;nbsp;but we&amp;#39;ve noticed that continuous advertising causes timeslot requests to occasionally be rejected.&lt;/p&gt;
&lt;p&gt;However, we&amp;#39;ve found that if we start advertising after the end of the &lt;em&gt;previous&lt;/em&gt; timeslot, and stop advertising before the start of the&amp;nbsp;&lt;em&gt;next&lt;/em&gt; timeslot, the timeslot requests seem to be accepted without issue. Thus the&amp;nbsp;question about&amp;nbsp;an event that fires right before the start of the next timeslot.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best way to know when timeslot is about to start?</title><link>https://devzone.nordicsemi.com/thread/242139?ContentTypeID=1</link><pubDate>Fri, 27 Mar 2020 14:32:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb664758-1a95-49b9-a413-cd144319da86</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;HI,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]In our application we need to trigger some functions right&amp;nbsp;&lt;em&gt;before&lt;/em&gt;&amp;nbsp;the next timeslot starts (while softdevice operations are still available, e.g. stopping advertising).[/quote]
&lt;p&gt;I&amp;#39;m not sure I understand your intention of using timeslots, could you elaborate a bit more?&lt;/p&gt;
[quote user=""]&lt;p&gt;&lt;/p&gt;&lt;p&gt;Right now we do this through a timer that fires some N ms before the next timeslot (assuming the timeslot request is accepted), but is there a better way?&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;I actually think a timer in combination with a flag that signalizes if the next timeslot is granted or not is a good method. &lt;a href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/concurrent_multiprotocol_tsl_api/complete_session.html?cp=4_6_2_0_8_2_0"&gt;The Softdevice signalizes if the next time slot is granted or not in the end of the current timeslot.&amp;nbsp;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>