<?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 advertising data update with SDK v17.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70066/ble-advertising-data-update-with-sdk-v17-0</link><description>Hello Noridc Support Team and All members, 
 I am new to BLE development. 
 I am using the nRF52 development kit and the SDK v17.0.2 
 My intent is to send the sensor data within BLE advertising packet.[BLE beacon mode] 
 I started of with the BLE beacon</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 13 Jan 2021 09:54:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70066/ble-advertising-data-update-with-sdk-v17-0" /><item><title>RE: BLE advertising data update with SDK v17.0</title><link>https://devzone.nordicsemi.com/thread/288863?ContentTypeID=1</link><pubDate>Wed, 13 Jan 2021 09:54:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc3d93d9-e49e-4e36-b95c-e6fe84081eb0</guid><dc:creator>awneil</dc:creator><description>[quote userid="98231" url="~/f/nordic-q-a/70066/ble-advertising-data-update-with-sdk-v17-0/288802#288802"]The issue got resolved after using the BLE advertising library[/quote]
&lt;p&gt;Thanks for feedback:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/6607._5F00_Verify_2D00_answer_2D00_nordic_5F00_2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE advertising data update with SDK v17.0</title><link>https://devzone.nordicsemi.com/thread/288824?ContentTypeID=1</link><pubDate>Wed, 13 Jan 2021 08:22:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60bdc09e-adfa-48ec-bbe9-6e45dac73c2c</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello pwarrier,&lt;/p&gt;
[quote user="pwarrier"]The issue got resolved after using the BLE advertising library.[/quote]
&lt;p&gt;I am happy to hear that it resolved your issue!&lt;br /&gt;&lt;br /&gt;Thank you for providing details on what you changed to make it work for your project, so other users might see in the future.&lt;br /&gt;I will also leave a link to &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/how-to-update-advertising-data-dynamically-using-ble-advertising-library"&gt;this blogpost for future reference, which goes through how to dynamically change advertising data using the BLE Advertising library&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Please do not hesitate to open a new ticket if you should encounter any issues or questions in the future.&lt;br /&gt;&lt;br /&gt;Good luck with your development!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE advertising data update with SDK v17.0</title><link>https://devzone.nordicsemi.com/thread/288802?ContentTypeID=1</link><pubDate>Wed, 13 Jan 2021 05:44:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c33f0d92-053b-4336-96a8-cd02aa68f3cd</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Thanks &lt;a href="https://devzone.nordicsemi.com/members/awneil"&gt;awneil&lt;/a&gt; and Karl Ylvisaker for the support.&lt;/p&gt;
&lt;p&gt;awneil, I will make sure to follow the&amp;nbsp;correct&amp;nbsp;way to insert code snippets as shown by you.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Karl Ylvisaker,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The issue got resolved after using the BLE advertising library. I was not using the same.&lt;/p&gt;
&lt;p&gt;Yes. Actually what I meant earlier when I said data was not being sent was &amp;quot;there was no change in advertising data&amp;quot;.&lt;/p&gt;
&lt;p&gt;Now after using the &amp;quot;ble_advertising_advdata_update&amp;quot; function data&amp;nbsp;is being updated. I am verifying it using nRF Connect app.&lt;/p&gt;
&lt;p&gt;Here is the code snippet&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
// data structure intialization
BLE_ADVERTISING_DEF(pw_advertising);        //&amp;lt; Advertising module instance. 

typedef struct{

  ble_advdata_manuf_data_t manuf_specific_data;
  ble_advertising_init_t pw_init; 

}pw_ble_adv_data_t;

static pw_ble_adv_data_t pw_ble_data;

// Within Advertising Init function
    
err_code = ble_advertising_init(&amp;amp;pw_advertising, &amp;amp;pw_ble_data.pw_init);

if(err_code != NRF_SUCCESS)
{
  NRF_LOG_INFO(&amp;quot;Error Occured: %d&amp;quot;,err_code);
}

ble_advertising_conn_cfg_tag_set(&amp;amp;pw_advertising, APP_BLE_CONN_CFG_TAG);


// updation code after the timer expires
ble_advertising_advdata_update(&amp;amp;pw_advertising,&amp;amp;pw_ble_data.pw_init.advdata,&amp;amp;pw_ble_data.pw_init.srdata);

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Few changes I had to do once I started to use the ble_advertising library&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
//had to set the following macros to 1

#define BLE_ADVERTISING_ENABLED 1

#define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I got a error while debugging the code related to memory not being sufficient&lt;/p&gt;
&lt;p&gt;So&amp;nbsp;I had to change this &amp;quot;Common project configuration&amp;quot; from&lt;/p&gt;
&lt;p&gt;RAM_START=0x200018C8&lt;/p&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;p&gt;RAM_START=0x20001DC8&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;pwarrier&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE advertising data update with SDK v17.0</title><link>https://devzone.nordicsemi.com/thread/287235?ContentTypeID=1</link><pubDate>Mon, 04 Jan 2021 13:11:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecb060fc-ce6b-4902-8c79-f1dd8dbef88e</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]I am new to BLE development.[/quote]
&lt;p&gt;Welcome!&lt;/p&gt;
[quote user=""]However I faced issues when updating the sensor data at runtime. Data was not being sent.[/quote]
&lt;p&gt;Could you elaborate how you attempted to do this? When you say that data was not being sent, do you mean that the module was advertising as before - but there was not change in the advertised data - or do you mean that no advertising was happening?&lt;br /&gt;&lt;br /&gt;Are you using &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_ble_advertising.html"&gt;the BLE advertising library&lt;/a&gt;? If you are, you could use the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Fgroup__ble__advertising.html&amp;amp;anchor=ga99dab70061ce04aea98bf226dc0c989f"&gt;&lt;em&gt;ble_advertising_advdata_update&lt;/em&gt;&lt;/a&gt; function to update your advertising data at runtime. Please mind that you should declare the advdata struct globally or statically, so that it persists outside the scope of your updating function.&lt;/p&gt;
[quote user=""]Also I read the description about the data structure “ble_gap_adv_data_t”, which says this memory will remain unmodified in application RAM and in order to update user needs to create another buffer.[/quote][quote user=""]- what is the correct way to update it using SDK v17.0&lt;br /&gt;- Is there any documentation given by Nordic related to same.&lt;br /&gt;- I am sure Nordic must have done these changes for a reason. &lt;br /&gt;- I am also sure people must have reported this behaviour since the API was introduced in SDK v15[/quote]
&lt;p&gt;Yes. Previously to nRF5 SDK v16.0.0 the user had to manually double buffer their advertising data, in order to use the ble_advertising_advdata_update function. You might have read some older forum posts regarding this.&lt;br /&gt;However, since the release of SDK v.16.0.0 this is handled by the ble_advertising_advdata_update function itself, so the user does not have to remember this. If you would like to know exactly how this was changed you can compare the SDK ble_advertising.c source code from SDK v15.3.0 with the one from SDK v17.0.0. In essence, it makes sure that new buffers are provided to the configuration every time the update function is called.&lt;br /&gt;&lt;br /&gt;Please do not hesitate to ask if any part of my answer should be unclear, or if you encounter any other issues or questions!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE advertising data update with SDK v17.0</title><link>https://devzone.nordicsemi.com/thread/287180?ContentTypeID=1</link><pubDate>Mon, 04 Jan 2021 10:31:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ece4c512-46f7-40f9-80cc-87816764b516</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/84216._5F00_Insert-Code-_2D00_-Nordic-2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>