Dialog Semiconductor customer support - Advertise string modification https://support.dialog-semiconductor.com/resource-keywords/advertise-string-modification en Change Advertising data dinamically https://support.dialog-semiconductor.com/change-advertising-data-dinamically < div class = "字段field-name-taxonomy-forums字段-type-taxonomy-term-reference field-label-above">
Forums: 

Hello,

Is it possible with SDK5 to change the advertising data packets dynamically during the life of the application?

If yes, how?

Thanks for your help.,

Andrea

Device: 
Wed, 20 Jan 2016 08:19:55 +0000 Andrea Longobardi 2600 at https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/change-advertising-data-dinamically#comments
启用和禁用advertisi后广告ng string modificaiton https://support.dialog-semiconductor.com/enabling-and-disabling-advertising-after-advertising-string-modificaiton < div class = "字段field-name-taxonomy-forums字段-type-taxonomy-term-reference field-label-above">
Forums: 

Hi
I am using an external processor in order to control the DA14580 (based on the SPS device code), the external processor program the DA14580 and then need to modify the advertise string while running.
After i gather the data via the UART port, I am trying to cancel the advertise using the "app_adv_stop()", then calling the "app_adv_start()" and modifying the data to *cmd pointer .the problem is that the advertise is not starting again.
If I am calling the app_adv_stop() at the start of the data reception instead of in the end, the advertise does stop and start again, but the data is left unchanged (the transmitted data- in cmd->data i see that data does changed).

My question if there is something else needs to be modified, or there is another way to change the advertise string.

BTW: I have changed the length in "cmd->info.host.adv_data_len" to my data length and set in comment this procedure so the length will be fine:

if (device_name_avail_space > 0)
{
// Get the Device Name to add in the Advertising Data (Default one or NVDS one)
#if (NVDS_SUPPORT)
device_name_length = NVDS_LEN_DEVICE_NAME;
if (nvds_get(NVDS_TAG_DEVICE_NAME, &device_name_length, &device_name_temp_buf[0]) != NVDS_OK)
#endif //(NVDS_SUPPORT)
{
// Get default Device Name (No name if not enough space)
device_name_length = strlen(APP_DFLT_DEVICE_NAME);
memcpy(&device_name_temp_buf[0], APP_DFLT_DEVICE_NAME, device_name_length);
}

if(device_name_length > 0)
{
// Check available space
device_name_length = co_min(device_name_length, device_name_avail_space);

// Fill Length
cmd->info.host.adv_data[cmd->info.host.adv_data_len] = device_name_length + 1;
// Fill Device Name Flag
cmd->info.host.adv_data[cmd->info.host.adv_data_len + 1] = '\x09';
// Copy device name
memcpy(&cmd->info.host.adv_data[cmd->info.host.adv_data_len + 2], device_name_temp_buf, device_name_length);
// Update Advertising Data Length
cmd->info.host.adv_data_len += (device_name_length + 2);
}
}

Device: 
Wed, 25 Nov 2015 20:06:08 +0000 asalhuv 2376 at https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/enabling-and-disabling-advertising-after-advertising-string-modificaiton#comments