<?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>updating advertising parameters during runtime within callback function using Zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107439/updating-advertising-parameters-during-runtime-within-callback-function-using-zephyr</link><description>Hello Team and developer community, Can you please help me with the 2 question that I have. I am developing an advertising application for nRF 52832 using Zephyr. 
 
 Can I use bt_le_ext_adv_cb to register callbacks for Legacy advertising? Alternatively</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 18 Jan 2024 11:52:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107439/updating-advertising-parameters-during-runtime-within-callback-function-using-zephyr" /><item><title>RE: updating advertising parameters during runtime within callback function using Zephyr</title><link>https://devzone.nordicsemi.com/thread/464776?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2024 11:52:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:160e5890-9900-41a7-82de-f772dec8032c</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello Maulik,&lt;/p&gt;
&lt;p&gt;The advertisement parameters cannot be updated on the fly like you can for the advertisement payload. The advertisement set has to be started again after you&amp;#39;ve updated the parameters.&amp;nbsp;&lt;strong&gt;bt_le_ext_adv_update_param&amp;nbsp;&amp;nbsp;&lt;/strong&gt;can be used to update the adv. params for an already created adv. set, but not when the adv. set is active.&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: updating advertising parameters during runtime within callback function using Zephyr</title><link>https://devzone.nordicsemi.com/thread/464760?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2024 10:44:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11412dd6-0b2c-4a3b-a295-f0ccf997dc6f</guid><dc:creator>Maulik</dc:creator><description>&lt;p&gt;Hello Vidar,&lt;br /&gt;&lt;br /&gt;Yes, I tried that, I first stopped the advertising and then updated advertising parameter. But issue is that after using&amp;nbsp;&lt;strong&gt;bt_le_ext_adv_update_param &lt;/strong&gt;advertising is stopped. So do I have to again start the advertising? If yes then how does this update function make sense to update parameters on the fly, I would rather stop advertising and start again with updated parameter. Can you please confirm it?&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: updating advertising parameters during runtime within callback function using Zephyr</title><link>https://devzone.nordicsemi.com/thread/464669?ContentTypeID=1</link><pubDate>Wed, 17 Jan 2024 16:05:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03ade339-2dce-47d8-883d-4243788513df</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello Maulik,&lt;/p&gt;
&lt;p&gt;Thanks for the additional information. I assumed you wanted to update the advertising data on the fly, but I now see that you are trying to update the advertising parameters instead. This requires you to stop the advertiser first:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/zephyr/connectivity/bluetooth/api/gap.html#c.bt_le_ext_adv_update_param"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/zephyr/connectivity/bluetooth/api/gap.html#c.bt_le_ext_adv_update_param&lt;/a&gt;&amp;nbsp;&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: updating advertising parameters during runtime within callback function using Zephyr</title><link>https://devzone.nordicsemi.com/thread/464662?ContentTypeID=1</link><pubDate>Wed, 17 Jan 2024 15:30:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e1b9986-e678-454f-87a6-ab1a886b0330</guid><dc:creator>Maulik</dc:creator><description>&lt;p&gt;Hello Vidar,&lt;br /&gt;&lt;br /&gt;Thank you for your reply,&lt;br /&gt;- I want to update an advertising interval after the scan response has been sent. Please note that I am directly using&amp;nbsp;&lt;strong&gt;bt_le_ext_adv_update_param&lt;/strong&gt;&lt;span&gt;&amp;nbsp; without stopping advertising.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;- Error:&amp;nbsp;&amp;nbsp;&lt;strong&gt;Failed to update advertising parameter (err -22&lt;/strong&gt;&lt;span&gt;&lt;strong&gt;)&lt;/strong&gt;&amp;nbsp;&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: updating advertising parameters during runtime within callback function using Zephyr</title><link>https://devzone.nordicsemi.com/thread/464596?ContentTypeID=1</link><pubDate>Wed, 17 Jan 2024 13:00:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c70b863-155a-4a15-8dd3-945de4d02541</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]Can I use &lt;strong&gt;bt_le_ext_adv_cb&lt;/strong&gt; to register callbacks for Legacy advertising? Alternatively is there any callbacks structure available to registers callback in Legacy advertising?[/quote]
&lt;p&gt;Yes, you can perform legacy advertising with the bt_le_ext_adv_* APIs. This is achieved by not setting the&amp;nbsp;&lt;span&gt;BT_LE_ADV_OPT_EXT_ADV flag in your advertisment params.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user=""]I want to update advertising parameters when I get a scan request and send scan response data (using &lt;strong&gt;scanned&lt;/strong&gt; callback within &lt;strong&gt;bt_le_ext_adv_cb&lt;/strong&gt; structure).This updating of the advertising parameters should be done within the callback itself. Should it be possible to do so during runtime using &lt;strong&gt;bt_le_ext_adv_update_param&lt;/strong&gt; API, because I am getting an error.&amp;nbsp;[/quote]
&lt;p&gt;Perhaps you could you explain the motivation for updating the data inside the callback, and also let me know what the error code was? Please note that the callback is invoked after the scan response has been sent.&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>