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

Runtime change service and characteristic

Like the title, Is it possible to disconnect ble link or stop advertising at runtime, then change the service uuid and characteristics?

I wanna to do OTA service in application code because there is more complicate control on the same time, like pwm control to show the updating process, so I think it is no need to add pwm module to both application and bootloader.

Beside the pwm module - it will causes the bootloader size overflow.

Parents
  • You can disconnect the link and change the services available and then reconnect. Would recommend you to implement a way for you to notify the central that you have changed the services and that it should do a new service discovery. This is to prevent the central from trying to access characteristics and services that aren't there anymore or have changed.

    Alternatively you make sure that the services and characteristics related to you DFU operation is placed in the top of the attribute table after the GAP and GATT services. Then your DFU services will always have the same handles for your central to access.

  • Could you please elaborate how to "disconnect the link and change the services?" I don't see any api supporting that.

Reply Children
Related