start/stop dfu buttonless service

good day,

i am using nrf52832 (pca10040) with sdk17.1 and would like to hide/stop the buttonless du service and only make it appear when a command is received. but based on some previous question, it can only be done if we unintialize and initialize the BLE stack.

is there an example on how to uninitialize/initialize the BLE stack?

another way is to make a condition to the dfu buttonless service to stop accepting command.

where can i insert the condition?

  • Hi,

    it can only be done if we unintialize and initialize the BLE stack.

    That is correct.

    is there an example on how to uninitialize/initialize the BLE stack?

    No, there are no examples of it, but the SoftDevice is disabled using sd_softdevice_disable(). Note that most SDK libraries (like the SoftDevice handler library - SDH) assumes that the SoftDevice is only enabled, so you will need to do a bit of changes to support this.

    There is a reason removing services is not supported though. It is not a common thing to do, and it does not fit well with typical Bluetooth LE use cases (for instance, the GATT client will need to do a service discovery to know what has changed). May I ask why you want to do it? What is the end goal? Could it be that there are other and perhaps even better ways to achieve your end goal?

  • we wanted the buttonless dfu service to be initially disabled/hidden and will only show up after receiving a command and will be hidden/disbled again after a certain time if the user did not update

  • I see. But may I ask why you want that? From a high-level perspective, what is the reasoning for it? The reason I ask is that this is not a common thing to do, and perhaps there would be another way to achieve your main goal (whatever the reason for wanting this feature is).

Related