Trait mavlink::MavConnection

source ·
pub trait MavConnection<M>
where M: Message,
{ // Required methods fn recv(&self) -> Result<(MavHeader, M), MessageReadError>; fn send( &self, header: &MavHeader, data: &M, ) -> Result<usize, MessageWriteError>; fn set_protocol_version(&mut self, version: MavlinkVersion); fn protocol_version(&self) -> MavlinkVersion; fn setup_signing(&mut self, signing_data: Option<SigningConfig>); // Provided methods fn send_frame( &self, frame: &MavFrame<M>, ) -> Result<usize, MessageWriteError> { ... } fn recv_frame(&self) -> Result<MavFrame<M>, MessageReadError> { ... } fn send_default(&self, data: &M) -> Result<usize, MessageWriteError> { ... } }
Expand description

A MAVLink connection

Required Methods§

source

fn recv(&self) -> Result<(MavHeader, M), MessageReadError>

Receive a mavlink message.

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

source

fn send(&self, header: &MavHeader, data: &M) -> Result<usize, MessageWriteError>

Send a mavlink message

source

fn set_protocol_version(&mut self, version: MavlinkVersion)

source

fn protocol_version(&self) -> MavlinkVersion

source

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

Available on crate feature signing only.

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

Provided Methods§

source

fn send_frame(&self, frame: &MavFrame<M>) -> Result<usize, MessageWriteError>

Write whole frame

source

fn recv_frame(&self) -> Result<MavFrame<M>, MessageReadError>

Read whole frame

source

fn send_default(&self, data: &M) -> Result<usize, MessageWriteError>

Send a message with default header

Implementors§