Hi,
I have read a few other related tickets but still have not found a fix
We want to be able to change device name in the field to show a meaningful name when scanning.
We set the name at runtime after reading out of flash.
During a boot, the device first starts all ble services. Then the flash is read back and the device name is updated, as needed.
The device name is being set with the following
void set_device_name(const uint8_t* device_name, size_t device_name_len)
{
ble_gap_conn_sec_mode_t sec_mode;
bool erase_bonds = true;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
sd_ble_gap_device_name_set(&sec_mode, device_name, device_name_len);
// Restart advertising
ble_app_restart_advertising();
}
Restart advertising like this (from advice here)
void ble_app_restart_advertising(void)
{
// Stop
uint32_t err_code = sd_ble_gap_adv_stop(m_advertising.adv_handle);
NRF_LOG_INFO("Stopping advertising");
// Start
err_code = sd_ble_gap_adv_start(m_advertising.adv_handle, APP_BLE_CONN_CFG_TAG);
APP_ERROR_CHECK(err_code);
NRF_LOG_INFO("Starting advertising");
}
This seems to only change the device name shown after a connection. When scanning - the default device name is still shown

What else needs to happen to update the device name shown when scanning?