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§
sourcefn recv(&self) -> Result<(MavHeader, M), MessageReadError>
fn recv(&self) -> Result<(MavHeader, M), MessageReadError>
Receive a mavlink message.
Blocks until a valid frame is received, ignoring invalid messages.
sourcefn send(&self, header: &MavHeader, data: &M) -> Result<usize, MessageWriteError>
fn send(&self, header: &MavHeader, data: &M) -> Result<usize, MessageWriteError>
Send a mavlink message
fn set_protocol_version(&mut self, version: MavlinkVersion)
fn protocol_version(&self) -> MavlinkVersion
sourcefn setup_signing(&mut self, signing_data: Option<SigningConfig>)
Available on crate feature signing
only.
fn setup_signing(&mut self, signing_data: Option<SigningConfig>)
signing
only.Setup secret key used for message signing, or disable message signing
Provided Methods§
sourcefn send_frame(&self, frame: &MavFrame<M>) -> Result<usize, MessageWriteError>
fn send_frame(&self, frame: &MavFrame<M>) -> Result<usize, MessageWriteError>
Write whole frame
sourcefn recv_frame(&self) -> Result<MavFrame<M>, MessageReadError>
fn recv_frame(&self) -> Result<MavFrame<M>, MessageReadError>
Read whole frame
sourcefn send_default(&self, data: &M) -> Result<usize, MessageWriteError>
fn send_default(&self, data: &M) -> Result<usize, MessageWriteError>
Send a message with default header