Hello Nordic
I am developing a sensor application using nRF52833. The user must be able to connect to the nRF52833 and give it a new name. I have a name characteristic that the user will write the new name to. When the nRF52833 receives the new name, it should disconnect and start advertising the new name. Then the user will reconnect using the new name.
I have read a lot of post on this subject. But none of them seems to work for me. I get the general idea about how to do it:
- Set the new name using sd_ble_gap_device_name_set
- Restart the advertising, several ways to do it are described in posts
I am using: SDK 17.1.0
Code starting point: examples\ble_peripheral\ble_app_template
I can rename the nRF52833, but nothing happens until a power cycling takes place.
This is my code:
In the main file I check whether the user has requested a new name. Then I set the new name and run the advertisement initialization again (suggested in this forum)
The set_device_name function is shown below:
The advertising_init function is shown below: