Closed mini-ninja-64 closed 6 months ago
Unfortunately it’s not possible to disable the softdevice without introducing UB because the Softdevice is returned as a static reference. The current recommendation if you need to reconfigure the softdevice is to restart the microcontroller. It is pretty rare in practice for this the be an issue.
that makes sense, thank you, i have learned more from when i raised this issue and now understand :bowing_woman:
My understanding is disabling the
SoftDevice
is useful as it allows for runtime configuration changes of the BLE stack, as config cannot be changed while the BLE SoftDevice is enabled.source
However this does not seem to currently be exposed safely through the crate.
I am still fairly new to Rust & the nRF5 series in general but can try and raise a PR for this (ノ◕ヮ◕)ノ*:・゚✧, if it would be a useful feature.
I am not sure what the API should look like for this? maybe like
pub async fn disable(&self)
onSoftDevice
with either noop or panic if its not currently enabled :thinking:, but maybe there is a better option.