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
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);
}
}