Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cflib2/_rust.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,12 @@ class Crazyflie:
r"""
Disconnect from the Crazyflie
"""
async def wait_disconnect(self) -> builtins.str:
r"""
Wait for the Crazyflie to be disconnected

Returns a human-readable string describing the reason for disconnection.
"""
def commander(self) -> Commander:
r"""
Get the commander subsystem
Expand Down
12 changes: 12 additions & 0 deletions rust/src/crazyflie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,18 @@ impl Crazyflie {
})
}

/// Wait for the Crazyflie to be disconnected
///
/// Returns a human-readable string describing the reason for disconnection.
#[gen_stub(override_return_type(type_repr = "collections.abc.Coroutine[typing.Any, typing.Any, builtins.str]"))]
fn wait_disconnect<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyAny>> {
let inner = self.inner.clone();
pyo3_async_runtimes::tokio::future_into_py(py, async move {
let reason = inner.wait_disconnect().await;
Ok(reason)
})
}

/// Get the commander subsystem
fn commander(&self) -> Commander {
Commander {
Expand Down
Loading