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

change advertised devicename

Hi,

In SDK11 I was able to update advertised device name without restart, just handled write on the characteristic and update advertising data (through a second call to ble_advertising_init). sd_ble_gap_device_name_set seems to be called automatically by the SoftDevice

In SDK12/SD3 this does not work anymore, if I call ble_advertising_init a second time, it succeeds (no error code) but no advertising occurs. If I do not call ble_advertising_init, old name is still advertised.

Is this a known regression? How am I supposed to proceed?

Also I used the new device_name_param_t GAP param but it still does not provide a way for updates and seems to ignore write_perms params (despite a BLE_GAP_CONN_SEC_MODE_SET_OPEN(&device_name_params.write_perm) before init, it's still read only if I do not call sd_ble_gap_device_name_set with the exact same parameters…)

Regards

  • I think you have done some kind of mistake in your code. I did a quick test by modifying the Heart Rate Application in SDK 12 (see attached modified main.c). If you build and flash it, you will see that it advertises as "Nordic_HRM" initially. After a long button 2 push, it will advertise as "New".

    Essentially the steps are the same as with earlier SoftDevice and SDK versions:

    1. Call sd_ble_gap_device_name_set() with the new device name
    2. Call ble_advdata_set(). (Using the advertising module you typically don't do this directly, but indirectly by a call to ble_advertising_start() or (as I did in the attached example) ble_advertising_restart_without_whitelist().)
  • Hi,

    First, this code does not use SD3 device_name_t struct, so the question about ignored write_perm (and device name value) by the new device name setting code is still valid.

    Secondly I found out that ble_advertising_init to reset device name works //only// if you're currently advertising while S132v2 (same code) worked fine, no matter if you were currently advertising, connected or not

    Regards

Related