<?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>Timeslot question</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85393/timeslot-question</link><description>Dear Nordic Engineers 
 I would like to sample the ADC between advertisements or connections, that is when the RF is sleeping, so I want to use Timeslot, I see there is a tutorial: devzone.nordicsemi.com/.../setting-up-the-timeslot-api 
 I refer to this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 Mar 2022 02:16:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85393/timeslot-question" /><item><title>RE: Timeslot question</title><link>https://devzone.nordicsemi.com/thread/356167?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2022 02:16:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0408f92a-52b0-486c-826f-a72cb879ffb9</guid><dc:creator>Hannibalhz</dc:creator><description>&lt;p&gt;Dear&amp;nbsp;&lt;span&gt;Priyanka&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thank your for your good advices.I try to add&amp;nbsp;earliest request into&amp;nbsp;NRF_EVT_RADIO_SESSION_IDLE,it&amp;#39;s working.However I turn off the&amp;nbsp;keep_running judgment,because it will cause an error.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1646359959991v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Thank you for you support.&lt;/p&gt;
&lt;p&gt;Best regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timeslot question</title><link>https://devzone.nordicsemi.com/thread/356114?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2022 15:53:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f40f471-8b27-4041-a41a-c6f761e8ac49</guid><dc:creator>Priyanka</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you try to request a new timeslot after it ends, similar to the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static bool keep_running = true;
void timeslot_on_sys_evt(uint32_t sys_evt, void * p_context)
{
    uint32_t err_code;
    switch (sys_evt)
    {
        case NRF_EVT_RADIO_SESSION_IDLE:
               // NRF_LOG_INFO(&amp;quot;NRF_EVT_RADIO_SESSION_IDLE&amp;quot;);
                if (keep_running)
                {
                    err_code = m_request_earliest(NRF_RADIO_PRIORITY_NORMAL);
                    APP_ERROR_CHECK(err_code);
                }
                break;
        case NRF_EVT_RADIO_SESSION_CLOSED:
            NRF_LOG_INFO(&amp;quot;NRF_EVT_RADIO_SESSION_CLOSED&amp;quot;);
            break;
        case NRF_EVT_RADIO_BLOCKED:
        case NRF_EVT_RADIO_CANCELED: // Fall through.
            if (keep_running)
            {
                err_code = m_request_earliest(NRF_RADIO_PRIORITY_NORMAL);
                APP_ERROR_CHECK(err_code);
            }
            break;
        default:
            NRF_LOG_INFO(&amp;quot;timeslot_on_sys_evt: %d\r\n&amp;quot;, sys_evt);
            break;
    }
}
void timeslot_on_sys_evt(uint32_t, void *);
/* Define a nrf_sdh_soc event observer to receive SoftDevice system events. */
NRF_SDH_SOC_OBSERVER(m_sys_obs, 0, timeslot_on_sys_evt, NULL);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint32_t m_request_earliest(enum NRF_RADIO_PRIORITY priority)
{
    timeslot_request.request_type                = NRF_RADIO_REQ_TYPE_EARLIEST;
    timeslot_request.params.earliest.hfclk       = NRF_RADIO_HFCLK_CFG_XTAL_GUARANTEED;
    timeslot_request.params.earliest.priority    = priority;
    timeslot_request.params.earliest.length_us   = TS_LEN_US;
    timeslot_request.params.earliest.timeout_us  = NRF_RADIO_EARLIEST_TIMEOUT_MAX_US;
    return sd_radio_request(&amp;amp;timeslot_request);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Priyanka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>