embassy-rs / nrf-softdevice

Apache License 2.0
269 stars 80 forks source link

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

Closed alexmoon closed 8 months ago

alexmoon commented 8 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.