<?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>Advertisement handler on SYTEM_ON sleep mode.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/112813/advertisement-handler-on-sytem_on-sleep-mode</link><description>Hello , 
 i am trying to find out advertisement handler while SD advertising in SYSTEM ON mode. 
 i have added a simple counter to see if it is increasing or not but it is not. 
 I can connect to the device , it is advertising , i can see from the sniffer</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 08 Jul 2024 18:02:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/112813/advertisement-handler-on-sytem_on-sleep-mode" /><item><title>RE: Advertisement handler on SYTEM_ON sleep mode.</title><link>https://devzone.nordicsemi.com/thread/492810?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2024 18:02:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f70246c5-7807-4277-9245-23fcece888d8</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The SDK does not include any samples for this, so&amp;nbsp; I made a small example, please see code snippet below.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void RADIO_NOTIFICATION_IRQHandler(void)
{
    static uint32_t count_adv; 

    if (m_conn_handle == BLE_CONN_HANDLE_INVALID) 
    {
        count_adv++;
        NRF_LOG_INFO(&amp;quot;Advertisment event counter: %d&amp;quot;, count_adv);
    }
}

/*to be called after ble_stack_init() before adv. start */
static void radio_notification_init(void) 
{
    uint32_t err_code;

    NVIC_SetPriority(RADIO_NOTIFICATION_IRQn, APP_IRQ_PRIORITY_LOW);
    NVIC_EnableIRQ(RADIO_NOTIFICATION_IRQn);

    err_code = sd_radio_notification_cfg_set(NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE, 0);
    APP_ERROR_CHECK(err_code);

}


/**@brief Function for application main entry.
 */
int main(void)
{
    ...
    ble_stack_init();
    radio_notification_init();
    ...&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This snippet should be compatible with&amp;nbsp;any of the Bluetooth samples that define the m_conn_handle variable. This variable is updated on the connect and disconnect event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement handler on SYTEM_ON sleep mode.</title><link>https://devzone.nordicsemi.com/thread/492805?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2024 17:29:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:917702a0-2f55-4dfb-a6ea-bd4ed58ed024</guid><dc:creator>MCB</dc:creator><description>&lt;p&gt;Hello. Thank you for your replies . İs there any example about this , which handler is handling that signal in which .c file if you remember/know it&amp;#39;s name ?&lt;/p&gt;
&lt;p&gt;Thanks again&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement handler on SYTEM_ON sleep mode.</title><link>https://devzone.nordicsemi.com/thread/492687?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2024 12:10:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2829aa85-306e-4181-b645-c2b223967e8c</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can have the application wake up after every advertisement event by enabling the &lt;a href="https://docs.nordicsemi.com/bundle/sds_s140/page/SDS/s1xx/radio_notif/radio_notif.html"&gt;radio notification&lt;/a&gt; feature in the SoftDevice. Note that the radio notification signal will trigger after every protocol event, so the application must track whether it is a connection or advertisement event.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement handler on SYTEM_ON sleep mode.</title><link>https://devzone.nordicsemi.com/thread/492673?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2024 10:57:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d8b5c60-83f2-4caa-ade4-f7edb0bf09be</guid><dc:creator>MCB</dc:creator><description>&lt;p&gt;Hi ,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am continuously advertising in system on sleep mode , and the device is connectable .... What I want is, I want to hook soft devices adv handler.so I want to call my own function after each advertisement of soft device . Because SD&amp;nbsp; wakes up the device according to defined intervals then goes to sleep . I want to call a function when SD wakes up to advertise.&amp;nbsp; How can I do that , is there any way to hook SD &amp;#39;s advertisement function?&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement handler on SYTEM_ON sleep mode.</title><link>https://devzone.nordicsemi.com/thread/492635?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2024 08:53:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5058bab2-ec4a-4dfd-87ae-f8bd74a5852e</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The function on_adv_evt() is called only when the &lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/lib_ble_advertising.html"&gt;Advertising Module&lt;/a&gt;&amp;nbsp;transitions to a new mode. For instance, if you have enabled slow advertising with a timeout, the&amp;nbsp;on_adv_evt() will be invoked when the slow advertising has timed out. However, if you advertise without a timeout, the handler will never be called.&lt;/p&gt;
[quote user=""]1-) is this the correct handler function ?&amp;nbsp;[/quote]
&lt;p&gt;You can monitor the BLE event handler if you want to see the connection and disconnect events.&lt;/p&gt;
[quote user=""]2-) if it is not , how can i hook to the softdevices advertisement handler in system on sleep mode.&amp;nbsp;[/quote]
&lt;p&gt;Could you say a bit more about what you are trying to acheive?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>