Change device name

Hello Nordic Engineer,

I know that I can modify #define DEVICE_NAME "device001" in sdk_config.h, but it takes a lot of time to compile and flash the program every time. It seems like there should be another way to quickly solve this.

【1】Is it possible to modify it through the iOS nRF Connect app, but with a prerequisite? Do I need to add some code in the 52811 program? (My product uses nRF52811)

【2】Can it be solved through the command line with J-Link? But I've never used the command line before...

【3】Are there any other methods? I just want to solve the problem quickly, and I don't mind how many methods there are.

Thanks

Parents
  • Hello,

    I know that I can modify #define DEVICE_NAME "device001" in sdk_config.h, but it takes a lot of time to compile and flash the program every time. It seems like there should be another way to quickly solve this.

    You can re-init the advertising and provide a new name as the device name parameter instead of DEVICE_NAME. Please see the section of main.c where DEVICE_NAME is used as the parameter to configure the name of the device in the GAP initialization.

    This approach will also let you do so at runtime, so if you first receive the new name over BLE you can then re-init and start advertising with this new name.
    Just out of curiosity, which use-case are you targeting where you would need to change the advertising name after you have already established connection with the central device?

    Best regards,
    Karl

  • Hello Ylvisaker ,

    Thank you for your reply.

    You can re-init the advertising

    I still don't quite understand how to initialize advertising separately. My previous approach was to modify the DEVICE_NAME, then build, wait for more than 1 minute until the hex file was generated, and then download it to the chip. However, the build time is too long.

    Whether it's central or peripheral, it's ble_app_multirole_lesc.

    I used this example to establish a mesh network with 1-to-1-to-1 connections, extending continuously. Therefore, all devices include both central and peripheral roles.

Reply
  • Hello Ylvisaker ,

    Thank you for your reply.

    You can re-init the advertising

    I still don't quite understand how to initialize advertising separately. My previous approach was to modify the DEVICE_NAME, then build, wait for more than 1 minute until the hex file was generated, and then download it to the chip. However, the build time is too long.

    Whether it's central or peripheral, it's ble_app_multirole_lesc.

    I used this example to establish a mesh network with 1-to-1-to-1 connections, extending continuously. Therefore, all devices include both central and peripheral roles.

Children
Related