embassy-rs / nrf-softdevice

Apache License 2.0
254 stars 74 forks source link

Add a `disconnect_reason` method to `Connection` #248

Closed alexmoon closed 3 months ago

alexmoon commented 3 months ago

It is useful in some applications to know why the connection was disconnected. This keeps track of the disconnection reason provided by the Softdevice and allows the application to query it.

A new method Connection::disconnect_with_reason() has also been added to allow the user to indicate the reason for a locally initiated disconnection to the remote device.