<?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 data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/33606/updating-advertising-data-manuf-spec-data-in-sdk15</link><description>Hello guys! And girls 
 
 My project is working as expected in SDK14.2. I&amp;#39;m updating adv data (manuf. spec. data) without any problem with this function But in SDK15 the function ble_advdata_set() has been deprecated. The migration guide is says to use</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 Nov 2019 04:28:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/33606/updating-advertising-data-manuf-spec-data-in-sdk15" /><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/221457?ContentTypeID=1</link><pubDate>Fri, 22 Nov 2019 04:28:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd5aaf25-529c-4aac-858b-d1bf00380d6a</guid><dc:creator>BrianT</dc:creator><description>&lt;p&gt;It took me a while to figure this out, but I was missing two pieces:&lt;/p&gt;
&lt;p&gt;1: You need to alternate buffers each time you update.&lt;/p&gt;
&lt;p&gt;2: The interrupt priority on your radio callback must be greater than 4. I was using 3 and had the same problem. Switching to 5 fixed it. The bluetooth stack uses 4, which is a lower priority than 3. See info here:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/40641/why-is-irq-priority-different-in-s140-sds-1-2-and-in-app_util_platform-h"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/40641/why-is-irq-priority-different-in-s140-sds-1-2-and-in-app_util_platform-h&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t usually do embedded programming, so this took me quite a while to figure out :).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/183143?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2019 13:30:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a338171f-c035-4ac4-9930-3cd1c15db3f6</guid><dc:creator>Niclas Heitz</dc:creator><description>&lt;p&gt;Have you verified this over the air? Does the advertising really change length, or just using dummy (or old) data behind the length you specified.&lt;/p&gt;
&lt;p&gt;We tested this once, but i admit only with using longer data then previously, which caused the softdevice to cut the data after the length of the initial advertising.&lt;/p&gt;
&lt;p&gt;Since you give the softdevice a pointer and a length during initialization I don&amp;#39;t see how changing the data behind the pointer would change the length, that the softdevice assumes.&lt;/p&gt;
&lt;p&gt;The encode function doesn&amp;#39;t call the softdevice, so this shouldn&amp;#39;t change it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/183131?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2019 13:12:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60a3e8e0-e388-4aba-844b-364f125c0e4d</guid><dc:creator>BitsAndBytes</dc:creator><description>&lt;p&gt;This has not been my experience. I switch advert packet size every TX of the radio. I have a set of different advert packets (each diff data and size) and cycle thru the list changing each time.&lt;/p&gt;
&lt;p&gt;As long as you do the following it should work fine.&lt;/p&gt;
&lt;p&gt;1) Set the characteristics&amp;nbsp;&lt;strong&gt;max_len&lt;/strong&gt; to the largest possible during initialization.&lt;/p&gt;
&lt;p&gt;2) Inside&amp;nbsp;&lt;strong&gt;advertiseUpdate&lt;/strong&gt; (above function) you set &lt;strong&gt;ble_advdata_encode&amp;#39;&lt;/strong&gt;s&amp;nbsp;&lt;strong&gt;p_len&lt;/strong&gt;&amp;nbsp;(3rd parameter) to the size of the new advert data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/182977?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2019 05:58:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac6d5582-b90c-4349-8113-c7917180036c</guid><dc:creator>Niclas Heitz</dc:creator><description>&lt;p&gt;That is only true, as long as you don&amp;#39;t want to change the size of the advertised data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/182824?ContentTypeID=1</link><pubDate>Fri, 19 Apr 2019 14:32:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:624ff448-5b14-4c81-a92e-c9ad306c1500</guid><dc:creator>BitsAndBytes</dc:creator><description>&lt;p&gt;You do NOT have to stop/restart advertising to change the data inside the advert packets. I dynamically update advert payloads on several projects while advertising. The above code I posted is working in one of my projects, but I do have another way that I use in others. The other way deals with being able to change the data on every radio transmit. Posting the code below.&lt;/p&gt;
&lt;p&gt;1) In main.c&lt;br /&gt; Note: I keep my main.c to a bare minimum (&amp;lt; 200 lines or so) and put other functionality in associated .c/.h files. KEEP IT CLEAN! :) Below is just an example of initialization flow and how to update adverts without restarting advertising and on every radio tx (which you can just keep send the same data and/or change as needed).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int main(void) {
	logInit();
	timersInit();
	gpioInit();
	... other peripheral inits, like TWI/SPI/buttons/etc ...
	schedulerInit();
	printBanner();
	bleStackInit();
	flashInit_Internal();	// Internal FDS
	gpioInit();
	... other inits for data handlers/external flash (if any)/ etc ...
	bleInit();	// See below

	advertisingStart(); // Start advertising last. This prevents other centrals from initiating a connection before everything is ready and no conflicts with other GATT processes.

	for (;;) {
		app_sched_execute();

		if (!NRF_LOG_PROCESS()) {
			powerManage();
		}
	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;2) In bleInitialize.c:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;typedef PACKED_STRUCT {
	uint8_t advertisingCounter;
	uint8_t someByte02;
	uint16_t someOtherValue01;
	uint16_t someOtherValue02;
	uint16_t someOtherValue03;
	uint16_t someOtherValue04;
} MfgData_t;

static MfgData_t mfgData = {
	.advertisingCounter = 0,
	.someByte02 = 0,
	.someOtherValue01 = 0,
	.someOtherValue02 = 0,
	.someOtherValue03 = 0,
	.someOtherValue04 = 0,
};


BLE_ADVERTISING_DEF(advertiseModule);
ble_advertising_init_t bleAdvertInit;
#define NUM_SERVICES_TO_ADVERTISE 1
static ble_uuid_t servicesToAdvertise[NUM_SERVICES_TO_ADVERTISE];

void bleInit(void) {
	gapParamsInit();	// sd_ble_gap_ppcp_set
	bleInfoInit();		// sd_ble_gap_addr_get (optional)
	gattInit();		// nrf_ble_gatt_init
	servicesInit();		// services &amp;amp; characteristics init
	advertiseInit();	// advert init
	connParamsInit();	// ble_conn_params_init
}

static void advertiseInit(void) {
	// Only call once at start of program.

	// Set handler so payloads can be changed between radio transmits.
	ret_code_t err_code = ble_radio_notification_init(APP_IRQ_PRIORITY_LOW, NRF_RADIO_NOTIFICATION_DISTANCE_2680US, advertiseUpdate);

	servicesToAdvertise[0] = yourServiceUUID;

	static ble_advdata_manuf_data_t advertMfgData;
	memset(&amp;amp;advertMfgData, 0, sizeof(advertMfgData));
	advertMfgData.data.p_data = (uint8_t*)&amp;amp;mfgData;
	advertMfgData.data.size = sizeof(mfgData);

	memset(&amp;amp;bleAdvertInit, 0, sizeof(bleAdvertInit));
	bleAdvertInit.advdata.name_type = BLE_ADVDATA_FULL_NAME;
	bleAdvertInit.advdata.include_appearance = false;
	bleAdvertInit.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
	bleAdvertInit.advdata.uuids_complete.uuid_cnt = NUM_SERVICES_TO_ADVERTISE;
	bleAdvertInit.advdata.uuids_complete.p_uuids = servicesToAdvertise;
	bleAdvertInit.advdata.p_manuf_specific_data = &amp;amp;advertMfgData;

	bleAdvertInit.config.ble_adv_fast_enabled = true;
	bleAdvertInit.config.ble_adv_fast_interval = ADV_INTERVAL_ACTIVE;
	bleAdvertInit.config.ble_adv_fast_timeout = BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED;
	bleAdvertInit.config.ble_adv_on_disconnect_disabled = true; // true = Let our code handle the restart

	bleAdvertInit.evt_handler = advertiseEventHandler;
	bleAdvertInit.error_handler = advertiseErrorHandler;

	err_code = ble_advertising_init(&amp;amp;advertiseModule, &amp;amp;bleAdvertInit);
	APP_ERROR_CHECK(err_code);

	ble_advertising_conn_cfg_tag_set(&amp;amp;advertiseModule, APP_BLE_CONN_CFG_TAG);

	err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, advertiseModule.adv_handle, TX_POWER_LEVEL);
	APP_ERROR_CHECK(err_code);
}

static void advertiseUpdate(bool radio_active) {
	// This is called after EVERY radio tx, ie during advertising and tx-ing during connection.
	if (radio_active) {
		// Increment advert counter (optional based on your project, you can change the data in mfgData anywhere in your code and it will go to advert packet because inside advertiseInit we set the advertMfgData.data.p_data = (uint8_t*)&amp;amp;mfgData;, which was sent to ble_advertising_init() via bleAdvertInit struct.
		mfgData.advertisingCounter++;

		ret_code_t err_code = ble_advdata_encode(&amp;amp;bleAdvertInit.advdata, advertiseModule.enc_advdata, &amp;amp;advertiseModule.adv_data.adv_data.len);
		APP_ERROR_CHECK(err_code);
	}
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/182170?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 15:50:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d4f3ea1-dd22-4eaf-a7e9-d747b31b2ea2</guid><dc:creator>Jimmy Wong</dc:creator><description>&lt;p&gt;HI,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I did the example at my github (&lt;a href="https://github.com/jimmywong2003/nrf5-modify-device-parameter-through-host"&gt;https://github.com/jimmywong2003/nrf5-modify-device-parameter-through-host&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;The method is to use the pointer instead of copying value.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For example, after getting the battery value (SAADC) interrupt and put its value inside the manufactory specific data (payload).&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1555343262767v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1555343297813v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void saadc_event_handler(nrf_drv_saadc_evt_t const * p_event)
{
        if (p_event-&amp;gt;type == NRF_DRV_SAADC_EVT_DONE)
        {
                nrf_saadc_value_t adc_result;
                uint16_t batt_lvl_in_milli_volts;
                // uint8_t percentage_batt_lvl;
                uint32_t err_code;

                adc_result = p_event-&amp;gt;data.done.p_buffer[0];

                err_code = nrf_drv_saadc_buffer_convert(p_event-&amp;gt;data.done.p_buffer, 1);
                APP_ERROR_CHECK(err_code);

                batt_lvl_in_milli_volts = ADC_RESULT_IN_MILLI_VOLTS(adc_result) +
                                          DIODE_FWD_VOLT_DROP_MILLIVOLTS;
                m_percentage_batt_lvl = battery_level_in_percent(batt_lvl_in_milli_volts);

#if defined(USE_THINGY_ADVERTISING_PAYLOAD)
                m_hardcode_enc_advdata[ADV_PAYLOAD_WITH_BATTERY]    = m_percentage_batt_lvl;
#endif&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/182149?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 14:17:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a9ee735-8772-46d1-b7ac-f5516f8e51c6</guid><dc:creator>Mojo</dc:creator><description>&lt;p&gt;Using doubler buffer may work. &amp;nbsp;I have not tried it yet. &amp;nbsp;I use adv timeout event to update my data instead, &amp;nbsp;much simpler. &amp;nbsp; That way, I don&amp;#39;t need a timer to update.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/182140?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 13:48:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebdf7125-e96d-4fee-8e0a-d51b72a77ccb</guid><dc:creator>Augustin Bricout</dc:creator><description>&lt;p&gt;Is there a way to update without having to stop and restart advertising? I have a new data for every advertising frame so stop and restart is not really interesting.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/181713?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2019 17:45:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3e9dbd0-4682-4b0b-ad7a-4e14849751df</guid><dc:creator>Mojo</dc:creator><description>&lt;p&gt;the function returns an error when you are still advertising. &amp;nbsp;You need to stop and restart after update.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/181708?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2019 16:42:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9218b46b-2774-41ac-8e1f-ee6f1dba49a3</guid><dc:creator>Augustin Bricout</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;I&amp;#39;m also trying to update my advertising data on the fly using the ble_advdata_encode function, however it&amp;#39;s currently not working, my app crashes every time I call it while the advertising is running.&amp;nbsp; I&amp;#39;m really interested to know if someone has an idea why.&lt;/p&gt;
&lt;p&gt;Thank you,&lt;/p&gt;
&lt;p&gt;Augustin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/179966?ContentTypeID=1</link><pubDate>Wed, 03 Apr 2019 11:28:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8892dc1c-06d2-47d4-b6ec-90ba31821250</guid><dc:creator>GK</dc:creator><description>&lt;p&gt;Dear Sir,&lt;/p&gt;
&lt;p&gt;Can you provide your main.c file&lt;/p&gt;
&lt;p&gt;I want to know the postions/locations where the functions to be called?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanking you in advance.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;with regards,&lt;/p&gt;
&lt;p&gt;Geetha&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/179965?ContentTypeID=1</link><pubDate>Wed, 03 Apr 2019 11:27:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a05f837f-5e17-434e-8c58-2313e3890954</guid><dc:creator>GK</dc:creator><description>&lt;p&gt;Dear Sir,&lt;/p&gt;
&lt;p&gt;Can you provide your main.c file&lt;/p&gt;
&lt;p&gt;I want to know the postions/locations where the functions to be called?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanking you in advance.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;with regards,&lt;/p&gt;
&lt;p&gt;Geetha&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/172219?ContentTypeID=1</link><pubDate>Thu, 21 Feb 2019 06:41:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fbdc25f-8af7-4b18-8bed-09004510a913</guid><dc:creator>M.Anis</dc:creator><description>&lt;p&gt;worked for me &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;thanks man&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/171716?ContentTypeID=1</link><pubDate>Mon, 18 Feb 2019 17:36:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bf6abed-e6f8-48d5-8ce3-4ecb87832847</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="fj_rob"]I&amp;#39;d like to see Nordic weigh in on this.[/quote]
&lt;p&gt;Unfortunately there are issues with &lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/group__ble__advertising#gaed156c3a650acabf79890fa9da01dec2"&gt;ble_advertising_advdata_update()&lt;/a&gt;, for SDK v15.x and SoftDevice v6.&lt;/p&gt;
&lt;p&gt;If you set the &amp;quot;permanent&amp;quot; parameter to true it will try to reuse the original buffer, but that is not allowed when advertising is ongoing. This is a known issue. The workaround is to stop advertising, then update the data, then start advertising again.&lt;/p&gt;
&lt;p&gt;You can use it with &amp;quot;permanent&amp;quot; of false at any time if you manage double buffering yourself. If you use a single buffer then you will still have to do the drill of stop advertising, update data, start advertising.&lt;/p&gt;
&lt;p&gt;If you use &lt;a href="https://www.nordicsemi.com/DocLib/Content/SoftDevice_API_Doc/S132/v6-1-0/group_ble_gap_functions#ga9969047f4e7485c3f856c841978cc31a"&gt;sd_ble_gap_adv_set_configure()&lt;/a&gt; directly for updating the advertising data you also need to use double buffering or stop advertising, update data, start advertising.&lt;/p&gt;
&lt;p&gt;So yes, essentially you have two options:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Stop advertising, then change data, then start advertising again.&lt;/li&gt;
&lt;li&gt;Use double buffers, which you handle yourself.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/171436?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 14:51:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a9c604f-7678-44bb-8360-0097a66ec2fa</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Yes, effectively there are 2 ways to do it. &amp;nbsp;Either stop/start or pass another different pointer. &amp;nbsp;SD reject it if same pointer while still advertising. &amp;nbsp;I never have any issue with stop/start and my adv data length varies from one time to the next. &amp;nbsp;The best approche for most of my application is to sync data change with adv timeout. &amp;nbsp;At adv timeout event, the adv is already stopped. &amp;nbsp;All you need to do then is to update the data and advertise again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/171433?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 14:44:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a11c895c-249e-45f7-9b3f-c886dac4733c</guid><dc:creator>Rob C</dc:creator><description>&lt;p&gt;I&amp;#39;d like to see Nordic weigh in on this.&amp;nbsp; I had nothing but trouble in trying to stop and restart advertising when changing advertising data in SDK 15.2.&amp;nbsp; I implemented a function to update manufacturer&amp;#39;s advertising data using the 2-buffer approach and pass it to&amp;nbsp;ble_advertising_advdata_update() in ble_advertising.c from SDK 15.2.&amp;nbsp; The advertisements update reliably without stopping/re-starting advertising.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/171403?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 13:41:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19a725c0-40c1-4ff8-b66c-4809153970a9</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;In the new sdk15.2, you need to stop the adv before updating, otherwise you get that error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/171330?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 10:31:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61e0959a-e861-4f5d-bb05-5712c7d3c9f4</guid><dc:creator>Gerth</dc:creator><description>&lt;p&gt;I&amp;#39;m struggling with the same problem and i&amp;#39;m pretty sure it is the pointer to the encoded data (p_encoded_data) since the error is thrown in the next encode function (name_encode in my case) if no UUID&amp;#39;s are provided.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So my question is if anybody has found the answer yet&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;EDIT:&lt;/p&gt;
&lt;p&gt;Found out that the&amp;nbsp;&lt;em&gt;&amp;nbsp;new_advdata.adv_data.p_data&lt;/em&gt; pointer is NULL which is why the&amp;nbsp;&lt;span&gt;NRF_ERROR_INVALID_ADDR is returned. In &lt;em&gt;ble_advertising_init&lt;/em&gt; this pointer is set to&amp;nbsp;&amp;nbsp;&lt;em&gt;m_advertising.enc_advdata&amp;nbsp;&lt;/em&gt;which cannot be done in the update function since then a&amp;nbsp;NRF_ERROR_INVALID_STATE error is returned.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/168956?ContentTypeID=1</link><pubDate>Thu, 31 Jan 2019 23:43:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ba73a04-f61f-40d3-9ddf-27110c7c59ae</guid><dc:creator>BitsAndBytes</dc:creator><description>&lt;p&gt;I had same issue with SDK 15. Read thru several forums including this one with no real answer. I too was using the Advertising Module with&amp;nbsp;&lt;/p&gt;
&lt;div&gt;&lt;strong&gt;BLE_ADVERTISING_DEF(advertiseModule);&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;I found the answer to my problem by digging into what SDK&amp;#39;s&amp;nbsp;&lt;strong&gt;ble_advertising_init&lt;/strong&gt; was using when it calls&amp;nbsp;&lt;span&gt;ble_advdata_encode.&lt;/span&gt;&amp;nbsp;It uses the&amp;nbsp;encoded buffer inside&amp;nbsp;&lt;strong&gt;advertiseModule&lt;/strong&gt;. I was mistakenly creating my own buffer and passing it to&amp;nbsp;&lt;strong&gt;ble_advdata_encode&lt;/strong&gt;.&lt;/div&gt;
&lt;div&gt;Once I used the following functions, everything worked fine. Even without restarting advertising.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void advertiseInit(void) {
&amp;#160;&amp;#160;&amp;#160;&amp;#160;// Only call once at start of program.
&amp;#160;&amp;#160;&amp;#160;&amp;#160;servicesToAdvertise[0] =&amp;#160;someServiceUUID;

&amp;#160;&amp;#160;&amp;#160;&amp;#160;static ble_advdata_manuf_data_t advertMfgData;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;memset(&amp;amp;advertMfgData, 0, sizeof(advertMfgData));
&amp;#160;&amp;#160;&amp;#160;&amp;#160;advertMfgData.data.p_data = (uint8_t*)&amp;amp;mfgData;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;advertMfgData.data.size = sizeof(mfgData);

&amp;#160;&amp;#160;&amp;#160;&amp;#160;memset(&amp;amp;init, 0, sizeof(init));
&amp;#160;&amp;#160;&amp;#160;&amp;#160;init.advdata.name_type = BLE_ADVDATA_FULL_NAME;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;init.advdata.include_appearance = false;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;init.advdata.uuids_complete.uuid_cnt = NUM_SERVICES_TO_ADVERTISE;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;init.advdata.uuids_complete.p_uuids = servicesToAdvertise;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;init.advdata.p_manuf_specific_data = &amp;amp;advertMfgData;

&amp;#160;&amp;#160;&amp;#160;&amp;#160;init.config.ble_adv_fast_enabled = true;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;init.config.ble_adv_fast_timeout = BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;init.config.ble_adv_on_disconnect_disabled = true; // true = Let our code handle the restart

&amp;#160;&amp;#160;&amp;#160;&amp;#160;init.evt_handler = advertiseEventHandler;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;init.error_handler = advertiseErrorHandler;

&amp;#160;&amp;#160;&amp;#160;&amp;#160;ret_code_t err_code = ble_advertising_init(&amp;amp;advertiseModule, &amp;amp;init);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;APP_ERROR_CHECK(err_code);

&amp;#160;&amp;#160;&amp;#160;&amp;#160;ble_advertising_conn_cfg_tag_set(&amp;amp;advertiseModule, APP_BLE_CONN_CFG_TAG);

&amp;#160;&amp;#160;&amp;#160;&amp;#160;err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, advertiseModule.adv_handle, TX_POWER_LEVEL);
&amp;#160;&amp;#160;&amp;#160;&amp;#160;APP_ERROR_CHECK(err_code);
}

void advertisingUpdateMfgData(void) {
&amp;#160; mfgData.inventoryCount = userData.count;
&amp;#160; ret_code_t err_code = ble_advdata_encode(&amp;amp;init.advdata, advertiseModule.enc_advdata, &amp;amp;advertiseModule.adv_data.adv_data.len);
&amp;#160; APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Notes:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; 1) that&amp;nbsp;advertiseModule.enc_advdata is not my buffer. It was created by SDK when using &lt;strong&gt;BLE_ADVERTISING_DEF(advertiseModule)&lt;/strong&gt;&lt;strong&gt; &lt;/strong&gt;and&amp;nbsp;&amp;nbsp;&lt;strong&gt;ble_advertising_init.&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/146024?ContentTypeID=1</link><pubDate>Tue, 28 Aug 2018 05:47:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da7a6e0f-2fa6-4110-9137-2f8cb949e697</guid><dc:creator>devops</dc:creator><description>&lt;p&gt;This one really made my morning :D&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/146010?ContentTypeID=1</link><pubDate>Mon, 27 Aug 2018 23:39:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e782a76-7ea3-4108-b87b-01015be69673</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;yeah, again a lot of changes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/145994?ContentTypeID=1</link><pubDate>Mon, 27 Aug 2018 18:50:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26e2d44b-c8d0-4404-a12a-ad326dfc1c6f</guid><dc:creator>Spirit</dc:creator><description>&lt;p&gt;Guys, I don&amp;#39;t know if you already seen that, but... in the SDK15.1 the Advertising module has a new function -&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.1.0/group__ble__advertising.html#gaed156c3a650acabf79890fa9da01dec2"&gt;ble_advertising_advdata_update&lt;/a&gt;&amp;nbsp;;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/145967?ContentTypeID=1</link><pubDate>Mon, 27 Aug 2018 14:11:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4163d26-4373-47d5-9263-f54979f25086</guid><dc:creator>Juan Moya</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have the same problem.&lt;/p&gt;
&lt;p&gt;Did you achieve to solve it?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Juan&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: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/145280?ContentTypeID=1</link><pubDate>Wed, 22 Aug 2018 10:44:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:904ffc28-d7ba-4969-9be9-9bc97a7df73d</guid><dc:creator>Niclas Heitz</dc:creator><description>&lt;p&gt;I posted some explanation to the function &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/37233/ble_advertising_init-returning-nrf_error_invalid_param-for-parameters-set-by-the-function-itself"&gt;here&lt;/a&gt;, but if you just need the code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;BLE_ADVERTISING_DEF(m_advModuleInstance);

extern void advertising_init (void)
{
  uint32_t      err_code = NRF_SUCCESS;
  ble_advdata_t advInitData;
  ble_advdata_t srInitData;

  /* Initialize structs. */
  memset(&amp;amp;advInitData, 0, sizeof(ble_advdata_t));
  memset(&amp;amp;srInitData, 0, sizeof(ble_advdata_t));

  /* Prepare advertising data. */
  advInitData.xxx = xxx; // configure the data you want here

  /* Prepare scan response data. */
  srInitData.xxx = xxx; // configure the data you want here

  /* Set advertising and scan response data. */
  m_advModuleInstance.adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET;
  m_advModuleInstance.adv_mode_current = BLE_ADV_MODE_IDLE;

  m_advModuleInstance.adv_data.adv_data.p_data = m_advModuleInstance.enc_advdata;
  m_advModuleInstance.adv_data.adv_data.len    = BLE_GAP_ADV_SET_DATA_SIZE_MAX;

  err_code = ble_advdata_encode(&amp;amp;advInitData, m_advModuleInstance.adv_data.adv_data.p_data, &amp;amp;m_advModuleInstance.adv_data.adv_data.len);
  APP_ERROR_CHECK(err_code);
  BLEPE_LOG_PRINTF_WARNING(&amp;quot;adv_data.len 0x%X&amp;quot;,m_advModuleInstance.adv_data.adv_data.len);

  m_advModuleInstance.adv_data.scan_rsp_data.p_data = m_advModuleInstance.enc_scan_rsp_data;
  m_advModuleInstance.adv_data.scan_rsp_data.len    = BLE_GAP_ADV_SET_DATA_SIZE_MAX;

  err_code = ble_advdata_encode(&amp;amp;srInitData, m_advModuleInstance.adv_data.scan_rsp_data.p_data, &amp;amp;m_advModuleInstance.adv_data.scan_rsp_data.len);
  APP_ERROR_CHECK(err_code);
  BLEPE_LOG_PRINTF_WARNING(&amp;quot;scan_rsp_data.len 0x%X&amp;quot;,m_advModuleInstance.adv_data.scan_rsp_data.len);

  /*
   *  Configure a initial advertising configuration. The advertising data and advertising parameters
   *  can be changed later, but must be set to legal values here to define an advertising handle.
   */
  m_advModuleInstance.adv_params.primary_phy     = BLE_GAP_PHY_1MBPS;
  m_advModuleInstance.adv_params.duration        = BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED;
  m_advModuleInstance.adv_params.properties.type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED;
  m_advModuleInstance.adv_params.p_peer_addr     = NULL;
  m_advModuleInstance.adv_params.filter_policy   = BLE_GAP_ADV_FP_ANY;
  m_advModuleInstance.adv_params.interval        = BLE_GAP_ADV_INTERVAL_MIN;

  err_code = sd_ble_gap_adv_set_configure(&amp;amp;m_advModuleInstance.adv_handle, &amp;amp;m_advModuleInstance.adv_data, &amp;amp;m_advModuleInstance.adv_params);
  APP_ERROR_CHECK(err_code);

  m_advModuleInstance.initialized = true;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;EDIT: Sorry, but I have no github projects.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating advertising data (manuf. spec. data) in SDK15</title><link>https://devzone.nordicsemi.com/thread/145276?ContentTypeID=1</link><pubDate>Wed, 22 Aug 2018 10:37:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d08eeed2-a7a7-4b3e-894e-a4cec77b9234</guid><dc:creator>Spirit</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/niclas-heitz"&gt;Niclas Heitz&lt;/a&gt;, tnx for info, I will try without a module to.&lt;br /&gt;&lt;br /&gt;Can you please show me your adv_init funciton?&lt;br /&gt;EDIT: I saw now your function in the other topic.&lt;br /&gt;&lt;br /&gt;Do you have any of your project(s) on some-sort-of github too?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>