I'm Currently working on nRF52840. I am trying to change Name for Beacon received from one of the Beacon's Characteristic and storing it in Flash. Now for name I am changing it on reset/restart. But here function
sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &m_adv_params);
gives the error 0x3004.
It is running normally without any error if I doesn't try to change the name.
err_code = sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &m_adv_params);
NRF_LOG_INFO("Error at sd_ble_gap_adv_set_configure 0x%X, %u", err_code, err_code);
APP_ERROR_CHECK(err_code);
Here is the code where I Set the Beacon's name.
if(name[0] != 'ÿ')
{
err_code = sd_ble_gap_device_name_set(&sec_mode,
(const uint8_t *)name,
strlen(name));
NRF_LOG_INFO("Error at sd_ble_gap_device_name_set in if 0x%X, %u", err_code, err_code);
APP_ERROR_CHECK(err_code);
}
else
{
err_code = sd_ble_gap_device_name_set(&sec_mode,
(const uint8_t *)DEVICE_NAME,
strlen(DEVICE_NAME));
NRF_LOG_INFO("Error at sd_ble_gap_device_name_set in else 0x%X, %u", err_code, err_code);
APP_ERROR_CHECK(err_code);
}
The if part executes it Flash has any name stored in it. Otherwise it pick the default DEVICE_NAME defined in the program.