<?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>Scan request as an event to application layer with Zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102908/scan-request-as-an-event-to-application-layer-with-zephyr</link><description>Hello Team. I am using zephyr with nRF52 DK to develop an application. I have developed advertising and active scanning application according to my need. But I have some questions. Can anyone please help me? 
 
 I want to generate an event when my advertising</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 01 Sep 2023 08:00:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102908/scan-request-as-an-event-to-application-layer-with-zephyr" /><item><title>RE: Scan request as an event to application layer with Zephyr</title><link>https://devzone.nordicsemi.com/thread/444010?ContentTypeID=1</link><pubDate>Fri, 01 Sep 2023 08:00:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:def23956-2c3e-4672-9f0e-cecd49bbe0a8</guid><dc:creator>Sigurd</dc:creator><description>&lt;div&gt;
&lt;div&gt;&lt;span&gt;-22 is the same as EINVAL(Invalid argument). Looking quickly at&amp;nbsp;bt_le_ext_adv_set_data(), and function call this function calls(e.g. le_adv_update), this error might occur if you are e.g. trying to set the&amp;nbsp;device name in both advertising&amp;nbsp;data and scan response data.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1693555193511v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan request as an event to application layer with Zephyr</title><link>https://devzone.nordicsemi.com/thread/444004?ContentTypeID=1</link><pubDate>Fri, 01 Sep 2023 07:39:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f871087a-3ee4-4b2d-a17b-1ae0918f2b51</guid><dc:creator>Maulik</dc:creator><description>&lt;p&gt;Hi Siguard,&lt;br /&gt;&lt;br /&gt;Thank you for answering on behalf on Einar and your help. &lt;br /&gt;Now I am getting that callback once scan response data is sent. But the problem is when I add scan response data in bt_le_ext_adv_set_data, It gives me an error showing &amp;quot;&lt;strong&gt;Failed to set extended advertising (err -22)&lt;/strong&gt;&amp;quot;.&amp;nbsp;&lt;br /&gt;And If I pass NULL to 4th and 5th position in&amp;nbsp;&lt;span&gt;bt_le_ext_adv_set_data, still I got some scan response data even if I didn&amp;#39;t set it.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan request as an event to application layer with Zephyr</title><link>https://devzone.nordicsemi.com/thread/443737?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2023 12:42:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfc36419-99ef-4e6f-ae60-de8cd7baebf9</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Einar is out of office, so I&amp;#39;m replying instead.&lt;/p&gt;
&lt;p&gt;Take a look at the code in this post:&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/100916/fragmented-advertising-in-legacy-mode-ble-4-2"&gt;Fragmented advertising in legacy mode (BLE 4.2)&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;i.e. the&amp;nbsp;&lt;span&gt;on_scanned() function, the&amp;nbsp;struct bt_le_ext_adv_cb cb, and BT_LE_ADV_OPT_NOTIFY_SCAN_REQ usage in adv param&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan request as an event to application layer with Zephyr</title><link>https://devzone.nordicsemi.com/thread/443135?ContentTypeID=1</link><pubDate>Fri, 25 Aug 2023 09:39:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:268997e7-a5b4-4cd6-9a93-8fb2a729d571</guid><dc:creator>Maulik</dc:creator><description>&lt;p&gt;Yes. it is. Now how can I execute my custom function using function you mentioned.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Maulik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan request as an event to application layer with Zephyr</title><link>https://devzone.nordicsemi.com/thread/442085?ContentTypeID=1</link><pubDate>Fri, 18 Aug 2023 12:23:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:850221ed-de61-4e71-8762-acde8f8a1f5a</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;So you&amp;#39;re able to build with &lt;code&gt;BT_CTLR_SCAN_REQ_NOTIFY&lt;/code&gt; activated?&lt;/p&gt;
&lt;p&gt;In that case &lt;code&gt;le_scan_req_received()&lt;/code&gt; should be activated:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/bluetooth/controller/hci/hci.c#L7805"&gt;https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/bluetooth/controller/hci/hci.c#L7805&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Is it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan request as an event to application layer with Zephyr</title><link>https://devzone.nordicsemi.com/thread/441884?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2023 13:41:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00deeba8-71c6-40a3-8d5a-d5e48beaebce</guid><dc:creator>Maulik</dc:creator><description>&lt;p&gt;Hi Einar.&lt;br /&gt;&lt;br /&gt; Yes. Now I am not getting any warning as before. Thank you for your&amp;nbsp;guidance.&lt;br /&gt;Can you please answer me first 2 questions?&lt;br /&gt;&lt;br /&gt;Best regards&lt;br /&gt;Maulik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan request as an event to application layer with Zephyr</title><link>https://devzone.nordicsemi.com/thread/441879?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2023 13:28:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df90701d-aac5-4b25-bc57-0f9af84b6623</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;What about the configs listed as its dependencies, can you confirm whether those are set?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan request as an event to application layer with Zephyr</title><link>https://devzone.nordicsemi.com/thread/441865?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2023 12:38:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c72857f-b843-4437-b06d-1ecfa2e7ba8a</guid><dc:creator>Maulik</dc:creator><description>&lt;p&gt;I set these dependencies in prj.conf file. I had already done that and then I got the warning that I showed you earlier.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan request as an event to application layer with Zephyr</title><link>https://devzone.nordicsemi.com/thread/441864?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2023 12:33:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22103a8f-895e-4992-8ba1-c0deef00a4ee</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;What do you mean?&lt;/p&gt;
&lt;p&gt;In what file are you setting these dependencies?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan request as an event to application layer with Zephyr</title><link>https://devzone.nordicsemi.com/thread/441836?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2023 11:30:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7e4d514-c8ae-48b0-9c2d-a31f10a75659</guid><dc:creator>Maulik</dc:creator><description>&lt;p&gt;Yes, I had already set all dependencies.&amp;nbsp;&lt;br /&gt; And also after build, when I look for&amp;nbsp;&lt;span&gt;BT_CTLR_SCAN_REQ_NOTIFY in .config file, I can&amp;#39;t see this parameter.&lt;br /&gt;I think that happens because of during compilation it doesn&amp;#39;t get changed to y from n. Right?&lt;br /&gt;&lt;br /&gt;Best Regards&lt;br /&gt;Maulik&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan request as an event to application layer with Zephyr</title><link>https://devzone.nordicsemi.com/thread/441829?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2023 11:09:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75740a57-8a9a-4b9a-9be5-c5d271f7af8a</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_BT_CTLR_SCAN_REQ_NOTIFY"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_BT_CTLR_SCAN_REQ_NOTIFY&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Have you set the dependencies from here&amp;nbsp;&lt;em&gt;before&lt;/em&gt; setting this config?&lt;/p&gt;
&lt;p&gt;-Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan request as an event to application layer with Zephyr</title><link>https://devzone.nordicsemi.com/thread/441793?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2023 08:57:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90ab1ecf-3951-4f8a-8e93-39f61cac5361</guid><dc:creator>Maulik</dc:creator><description>&lt;p&gt;Hello Einar&lt;br /&gt;&lt;br /&gt;Thank you for your reply. Small mistake from my side is wrong choice of word. It is showing warning not compilation error.&lt;br /&gt;Here Please have a look.&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/7206.Warning.PNG" /&gt;&lt;br /&gt;&lt;br /&gt;Thanks and Best Regards&lt;br /&gt;Maulik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan request as an event to application layer with Zephyr</title><link>https://devzone.nordicsemi.com/thread/441788?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2023 08:40:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c94caf49-e0fb-4522-ba6c-6ed5a46042f6</guid><dc:creator>Einarh</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
[quote user=""]According to&amp;nbsp;Zephyr documentation Several CONFIG parameters like, BT_HCI, BT, BT_CTLR, BT_CTLR_ADV_EXT and BT_CTLR_SCAN_REQ_NOTIFY must be set in prj.conf to receive notifications on a scan request. I have done that, but I still get compilation error for these parameters.[/quote]
&lt;p&gt;Could you please share your compilation errors?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>