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

automatic reload the device name

Hi,

I'm trying to change the device name of the board. I'm able to write the new name into the characteristic. When the name was written in the characteristic the advertised name doesn't change. The name changes after I reinitialize the advertising and restart it (was described here). This is done by the button_event_handler.

My problem is that I had to use a Button to reinitialize the advertising. Is there a different way, so I don't have to push a button and it does the reinitialisation automaticly after the new name is written into the characteristic?

I tought of 3 ways. Is any of this possible or are there different approaches?

  1. Can I implement a handler for the device name. If the value of this characteristic changes the handler would reinitailize the advertising. I didn't found a way to implement a handler for the Device Name characteristic. Is it even possible?
  2. Or is it possible display the name without reinitializing the advertising with something like 
    ble_advertising_advdata_update(); 
    ? But the data would be updated even if the device name didn't changed.
  3. This is more like a workaround. I would implement a characteristic with a handler that restarts and reinitializes the advertising. But in my opinion this is not a nice way to solve this problem

I'm using:

nRF52840-DK

peripheral/ble_app_blinky/s140

SDK 15.2.0

Thank you in advance

Parents Reply Children
No Data
Related