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

How to change the name of the smart beacon kit?

I'm testing my nRF51822 Bluetooth Smart Beacon Kit (pca20006). I've successfully uploaded ble_app_beacon_bcs code example to my beacon via Master Control Panel Android app, however, I've noticed a problem with changing the beacon name. I pressed the button SW2 and switched to the configuration mode and then connected with the beacon using Master Control Panel Android app. I can read and write the device name by tapping the arrows, however, when I disconnects from the beacon the name seems to be unchanged (is still showing "Beacon Config"). How to permanently change the beacon name for configuration mode and beacon mode using nRF Master Control Panel app?

  • The default code is setup to re-use the same defined name every time config mode is enabled. So you would have to change this to store the new device name and re-use that next time you enter config mode instead of using the defined device name.

    Please see the gap_params_init() function in main.c and make sure you store the new name and reuse the new name for every time you start config mode.

    EDIT: I implemented the changes needed to be able to change the Device Name and also keep it during the reset that occurs when exiting Beacon config mode. I cheated slightly and re-used the same flash operations used for the beacon service even though the device name isn't a part of the beacon service. It gets the point across however. I think I marked all the modifications I did with #warning.

    I added the code for supporting Softdevice S110 v.7.x.x, but it's commented out by default. If you want to use this you have to modify the memory settings as well.

    ble_app_beacon_bcs-keep_devicename.zip

  • Thanks for your reply. Could you provide more information how to do this? I've noticed that in the ble_app_beacon_bcs example "on write()" method is called when I tap the write button in Master Control Panel app. Write name event is handle by ble_conn_params_on_ble_evt(p_ble_evt) as BLE_GATTS_EVT_WRITE case, however, I don't know what method is called when I tap the "read" button in Master Control Panel. I guess I have to write and red device name from flash memory using pstorage. Is it better in this case to use a new method for device name events handling (e.g. ble_dn_on_ble_evt for device name writing) instead of the default ble_conn_params_on_ble_evt that seems to recognize only the type of the event?

  • I added sample code to show the functionality. See above edited answer.

  • I would like to test a few things of the ble_app_beacon_bcs-keep_devicename project. When I try to build the project an error appears: Source\templates\arm\arm_startup_nrf51.s" could not be opened: No such file or directory.

    I will have to move the project to SDK 6.1 or 6.0 because there is a folder with templates and the source file arm_startup_nrf51.s

    Or how did you do that it is possible to build the project in the SDK 7.1?

Related