how to change the device name by ble_app

hi ... i want to change the device name by using our customized nrf toolbox , user will entry the name of device , so that particular name should with the previous name (nRF5X) ..How to do that ?

 i tried by copying the received data to device name (strcpy (device_name , user_name) , the name is not changing . i have seen multiple threads, none of them work out

suggest me 

Parents
No Data
Reply
  • Hi,

    To update the device name via BLE you need to do the following:

    • Call sd_ble_gap_device_name_set() with the new name
    • Update the advertising set with new advertising data to use the new name.
    • If you want this to be persistent, you also need to write it to flash and read it back and use that when you set the advertising name after reset.

    Note that the phones cache the advertising name, so you will not necessarily see the new name on an existing phone unless you delete the bond, toggle Bluetooth off and on, and pair again (or similar).

Children