<?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>ble advertizing data update dynamically in the prigram</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85776/ble-advertizing-data-update-dynamically-in-the-prigram</link><description>Hi 
 I want to update the ble advertising data in my program. In nrf5340 the bt_le_adv_start() command should run only once in the main program. 
 Is it possible to change the advertising data of ble device in broadcast non connectable mode by bt_data_bytes</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 29 Sep 2024 12:02:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85776/ble-advertizing-data-update-dynamically-in-the-prigram" /><item><title>RE: ble advertizing data update dynamically in the prigram</title><link>https://devzone.nordicsemi.com/thread/504259?ContentTypeID=1</link><pubDate>Sun, 29 Sep 2024 12:02:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f65c391-bbf8-45ca-a2cf-4794427bc178</guid><dc:creator>master.chipset</dc:creator><description>&lt;p&gt;&lt;span&gt;The&amp;nbsp;&lt;/span&gt;&lt;code&gt;BT_DATA_BIG_INFO&lt;/code&gt;&lt;span&gt;&amp;nbsp;macro in the nRF Connect SDK is used to define a Bluetooth advertising data structure for broadcasting information about a Broadcast Isochronous Group (BIG). This is part of the Bluetooth LE Audio features, which allow for synchronized audio streaming to multiple devices.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble advertizing data update dynamically in the prigram</title><link>https://devzone.nordicsemi.com/thread/359061?ContentTypeID=1</link><pubDate>Mon, 21 Mar 2022 09:55:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:547e0059-9bb0-42f6-9f4f-6244927db9a7</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="saeed mahvis"]or I should completely change them and define new struct variables compatible with&amp;nbsp;&lt;span&gt;bt_le_ext_adv_create()&lt;/span&gt;[/quote]
&lt;p&gt;Disclaimer: I have not used the extended advertisements. Check the input parameters.&lt;/p&gt;
&lt;p&gt;Well... With the snippet above, first of all, you are not using sd anywhere, just so you know.&lt;/p&gt;
&lt;p&gt;Is there a reason you are using BT_DATA_BIG_INFO? Do you know what it refers to, or did you just take it because it contains the name &amp;quot;BIG&amp;quot;?&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t know what it is (I don&amp;#39;t), I suggest you stick with the&amp;nbsp;BT_DATA_MANUFACTURER_DATA, which is a field where you can use completely custom data. That may not be the case in &amp;quot;BT_DATA_BIG_INFO&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble advertizing data update dynamically in the prigram</title><link>https://devzone.nordicsemi.com/thread/358568?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 09:15:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f823665b-f5b7-4919-bdcc-22e46bc3246a</guid><dc:creator>saeed mahvis</dc:creator><description>&lt;p&gt;Hi again&lt;/p&gt;
&lt;p&gt;Would you please to explain a little more about&amp;nbsp;&lt;span&gt;bt_le_ext_adv_create() usage. Should I still use these lines:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;static uint8_t adv_array[29] = {0};&lt;/p&gt;
&lt;p&gt;static const struct bt_data ad[] = {&lt;br /&gt; BT_DATA(BT_DATA_BIG_INFO, adv_array, sizeof(adv_array)),&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;// Set Scan Response data //&lt;br /&gt;static const struct bt_data sd[] = {&lt;br /&gt; BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN),&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;bt_enable(NULL);&lt;br /&gt; bt_le_adv_start(BT_LE_ADV_NCONN_IDENTITY, ad, ARRAY_SIZE(ad),0,0);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;or I should completely change them and define new struct variables compatible with&amp;nbsp;&lt;span&gt;bt_le_ext_adv_create().&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble advertizing data update dynamically in the prigram</title><link>https://devzone.nordicsemi.com/thread/358499?ContentTypeID=1</link><pubDate>Wed, 16 Mar 2022 19:24:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d70e3b58-ab56-4965-8c89-79fd52e5dda7</guid><dc:creator>saeed mahvis</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Thank you very much. I have tested it and it did work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble advertizing data update dynamically in the prigram</title><link>https://devzone.nordicsemi.com/thread/358379?ContentTypeID=1</link><pubDate>Wed, 16 Mar 2022 11:11:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1018bc4f-3272-4504-b02f-7ac55d983fe2</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;In order to write completely custom data, I suggest you look into something called manufacturer specific data:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
static uint8_t adv_array[4] = {0};

static const struct bt_data ad[] = {
    BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
    BT_DATA(BT_DATA_MANUFACTURER_DATA, adv_array, sizeof(adv_array)),
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The size can be larger than 4 bytes.&lt;/p&gt;
&lt;p&gt;However, updating the adv_array directly wouldn&amp;#39;t change the advertisements. You still need to update the advertising data with the updated adv_array whenever you want to update the advertisements.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble advertizing data update dynamically in the prigram</title><link>https://devzone.nordicsemi.com/thread/358293?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2022 18:36:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12652463-e869-410f-8967-ce0e3c20522d</guid><dc:creator>saeed mahvis</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Thank you very much for your guidance. But let me discus another question.&lt;/p&gt;
&lt;p&gt;Actually I want to attach the serial port receiving data to ad area field of my advertising device. Should&lt;/p&gt;
&lt;p&gt;I use&amp;nbsp;BT_DATA_BYTES()? As far as I tried only static constant data can be used in this function.&lt;/p&gt;
&lt;p&gt;How could I change the ad data dynamically in the program.?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble advertizing data update dynamically in the prigram</title><link>https://devzone.nordicsemi.com/thread/358115?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2022 07:55:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d312bc5-b344-4866-97f5-992ab3cb1ebc</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;You can ad a scan response packet in bt_le_adv_start():&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int bt_le_adv_start(const struct bt_le_adv_param *param,
		    const struct bt_data *ad, size_t ad_len,
		    const struct bt_data *sd, size_t sd_len);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The parameters *sd and sd_len is the scan response data, which gives you another 31 bytes. If you need even more, then you need to look into&amp;nbsp;bt_le_ext_adv_create(). In fact, you will find a lot of the possibilities by looking at the bluetooth.h file found in NCS\zephyr\include\bluetooth\bluetooth.h.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble advertizing data update dynamically in the prigram</title><link>https://devzone.nordicsemi.com/thread/358063?ContentTypeID=1</link><pubDate>Mon, 14 Mar 2022 18:12:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:217fb7a2-4c42-4091-abcf-db9bba8f2006</guid><dc:creator>saeed mahvis</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I have tested it on my custom board. It worked without the need of using &lt;span&gt;bt_le_adv_stop&lt;/span&gt;().&lt;/p&gt;
&lt;p&gt;But I have another question yet. I want to use the ble radio in extended mode to be able to&lt;/p&gt;
&lt;p&gt;transfer more than just 32 bytes.&lt;/p&gt;
&lt;p&gt;Again thank you for your supports.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Saeed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble advertizing data update dynamically in the prigram</title><link>https://devzone.nordicsemi.com/thread/358020?ContentTypeID=1</link><pubDate>Mon, 14 Mar 2022 15:13:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bec11394-0a7f-44b9-8066-04ac29a5cede</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have not tested it yet, but there is a function called&amp;nbsp;bt_le_adv_update_data(). I am not sure whether you need to stop the adverting using bt_le_adv_stop() before updating the data or not. Check the return value from bt_le_adv_update to see whether it succeeds without stopping the advertising data.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>