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
  • 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).

  • Hi ,Einar 

    How to update the advertising set with new advertising data to use the new name ?

    Best Regards ,

    pspavi

  • If I disconnected then how I will enter the data in ble_app_uart 

  • 1)You need to disconnect the link
    2) set the device name for activation 
    3) reconnect to the host again

    in my example, I store on the flash.  After power up, I will configure the device name.

  • ok let me try jimmy , i will be back to you, but i couldn't able to run your code need to include many header files . 

  • You should run the example on the nRF52 DK board to try first.

    and then understand what I did on such example.  Otherwise, you can't solve the problem by yourself.

  • i am finding the difficult , your example is for thingy52 ,if i run in nRF52  sdk 15.2 version . i am getting error , ble_tcs.h no such file found . This ble_tcs.h file is not found in my sdk ..so the only one way , i should program on my own, guide for that please

Reply
  • i am finding the difficult , your example is for thingy52 ,if i run in nRF52  sdk 15.2 version . i am getting error , ble_tcs.h no such file found . This ble_tcs.h file is not found in my sdk ..so the only one way , i should program on my own, guide for that please

Children
No Data