Trait AsyncMavConnection

Source
pub trait AsyncMavConnection<M>
where M: Message + Sync + Send,
{ // Required methods fn recv<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(MavHeader, M), MessageReadError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn send<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, header: &'life1 MavHeader, data: &'life2 M, ) -> Pin<Box<dyn Future<Output = Result<usize, MessageWriteError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait; fn set_protocol_version(&mut self, version: MavlinkVersion); fn protocol_version(&self) -> MavlinkVersion; fn set_allow_recv_any_version(&mut self, allow: bool); fn allow_recv_any_version(&self) -> bool; fn setup_signing(&mut self, signing_data: Option<SigningConfig>); // Provided methods fn send_frame<'life0, 'life1, 'async_trait>( &'life0 self, frame: &'life1 MavFrame<M>, ) -> Pin<Box<dyn Future<Output = Result<usize, MessageWriteError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait { ... } fn recv_frame<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<MavFrame<M>, MessageReadError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: Sync + 'async_trait { ... } fn send_default<'life0, 'life1, 'async_trait>( &'life0 self, data: &'life1 M, ) -> Pin<Box<dyn Future<Output = Result<usize, MessageWriteError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait { ... } }
Expand description

An async MAVLink connection

Required Methods§

Source

fn recv<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(MavHeader, M), MessageReadError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Receive a mavlink message.

Yield until a valid frame is received, ignoring invalid messages.

Source

fn send<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, header: &'life1 MavHeader, data: &'life2 M, ) -> Pin<Box<dyn Future<Output = Result<usize, MessageWriteError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Send a mavlink message

Source

fn set_protocol_version(&mut self, version: MavlinkVersion)

Sets the MAVLink version to use for receiving (when allow_recv_any_version() is false) and sending messages.

Source

fn protocol_version(&self) -> MavlinkVersion

Gets the currently used MAVLink version

Source

fn set_allow_recv_any_version(&mut self, allow: bool)

Set wether MAVLink messages of either version may be received.

If set to false only messages of the version configured with set_protocol_version() are received.

Source

fn allow_recv_any_version(&self) -> bool

Wether messages of any MAVLink version may be received

Source

fn setup_signing(&mut self, signing_data: Option<SigningConfig>)

Setup secret key used for message signing, or disable message signing

Provided Methods§

Source

fn send_frame<'life0, 'life1, 'async_trait>( &'life0 self, frame: &'life1 MavFrame<M>, ) -> Pin<Box<dyn Future<Output = Result<usize, MessageWriteError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Write whole frame

Source

fn recv_frame<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<MavFrame<M>, MessageReadError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Read whole frame

Source

fn send_default<'life0, 'life1, 'async_trait>( &'life0 self, data: &'life1 M, ) -> Pin<Box<dyn Future<Output = Result<usize, MessageWriteError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Send a message with default header

Implementors§