Skip to content

Add wait_disconnect method to Crazyflie class for graceful disconnection#7

Merged
gemenerik merged 2 commits intomainfrom
rik/wait_disconnect
Mar 9, 2026
Merged

Add wait_disconnect method to Crazyflie class for graceful disconnection#7
gemenerik merged 2 commits intomainfrom
rik/wait_disconnect

Conversation

@gemenerik
Copy link
Copy Markdown
Member

@gemenerik gemenerik commented Mar 9, 2026

Adds an async wait_disconnect() method that blocks until the Crazyflie disconnects, returning a human-readable reason string. Useful for graceful shutdown flows, e.g. waiting for link loss before cleaning up resources.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new async Python-exposed API on Crazyflie to allow callers to await a graceful/complete disconnect and retrieve a human-readable disconnect reason.

Changes:

  • Add Crazyflie.wait_disconnect() to the Rust PyO3 bindings, returning an awaitable that resolves to a string reason.
  • Update the generated Python type stub (_rust.pyi) to include the new async method and its docstring.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
rust/src/crazyflie.rs Exposes a new wait_disconnect() async binding via future_into_py.
cflib2/_rust.pyi Adds the wait_disconnect() declaration/documentation to the Python stubs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@gemenerik gemenerik merged commit 526d0ab into main Mar 9, 2026
1 check passed
@gemenerik gemenerik deleted the rik/wait_disconnect branch March 9, 2026 15:08
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.

2 participants