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?

Parents
  • 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?

Reply
  • 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?

Children
Related