This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Dynamic Advertisement Name In DFU

Hi,

Is there any way to change the advertisement name before switching to DFU mode?

I have a custom app that reboots into DFU mode (via NRF_POWER->GPREGRET). I want to be able to somehow change the default ADV_NAME ("DfuTarg") on the fly.

Thanks.

A.

Parents
  • Hi,

    The advertising name is configured separately in the application and bootloader, so the advertising name will not be the same unless you have set the same name in both. For the bootloader, the name is set by the NRF_DFU_BLE_ADV_NAME in the sdk_config.h file, and most application examples use a define called DEVICE_NAME in the main.c file. You can also change the advertised device name dynamically, by configuring a new set of advertising data, using for instance ble_advertising_advdata_update().

    This may not have the desired effect though, since even if the advertising name is changed and you can verify this with a sniffer, most BLE stacks (such as that in iOS and Android) will cache the advertising data, and will not actually update the name unless you switch Bluetooth off and on on the phone.

Reply
  • Hi,

    The advertising name is configured separately in the application and bootloader, so the advertising name will not be the same unless you have set the same name in both. For the bootloader, the name is set by the NRF_DFU_BLE_ADV_NAME in the sdk_config.h file, and most application examples use a define called DEVICE_NAME in the main.c file. You can also change the advertised device name dynamically, by configuring a new set of advertising data, using for instance ble_advertising_advdata_update().

    This may not have the desired effect though, since even if the advertising name is changed and you can verify this with a sniffer, most BLE stacks (such as that in iOS and Android) will cache the advertising data, and will not actually update the name unless you switch Bluetooth off and on on the phone.

Children
No Data
Related