Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a disconnect_reason method to Connection #248

Merged
merged 4 commits into from
Mar 26, 2024

Conversation

alexmoon
Copy link
Contributor

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.

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 returns it in the `DisconnectedError`.

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.
Allows the `Disconnected` state to be represented by all zeros so `ConnectionState` can be put in bss.
L2cap errors are omitted due to ambiguity between channel disconnection vs connection disconnection.
@alexmoon alexmoon added this pull request to the merge queue Mar 26, 2024
Merged via the queue into embassy-rs:master with commit 30a5084 Mar 26, 2024
1 check passed
@alexmoon alexmoon deleted the disconnect-reasons branch March 26, 2024 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant