pub async fn send(&self, header: &MavHeader, message: &M) -> Result<(), AsyncMavlinkError> {
        let (backchannel, receiver) = oneshot::channel();
        self.task_dispatcher
            .clone() // TODO get rid of clone
            .send(Task::Emit {
                header: *header,
                message: message.clone(),
                backchannel,
            })
            .await
            .map_err(AsyncMavlinkError::from)?;
        receiver.await.map_err(AsyncMavlinkError::from)?
    }
/// Send a `MavMessage` to the vehicle
///
/// # Arguments
///
/// * `message` - `MavMessage` to send
///
/// # Examples
///
/// ```
/// # use std::time::Duration;
/// # use futures::prelude::*;
/// # use async_mavlink::AsyncMavConn;
/// # use async_mavlink::prelude::*;
/// # use mavlink::{MavHeader, MavlinkVersion, common::*};
/// # fn main() -> Result<(),AsyncMavlinkError> {
/// # smol::block_on(async {
/// # let (conn, future) = AsyncMavConn::new("udpbcast:127.0.0.5:14551", MavlinkVersion::V1)?;
/// # smol::spawn(async move { future.await; }).detach();
/// let header = MavHeader::default();
/// let message = MavMessage::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA {
///     target_component: 0,
///     target_system: 0,
/// });
///
/// conn.send(&header, &message).await?;
/// # Ok(())
/// # })}
/// ```
Send a `MavMessage` to the vehicle
Send a ` MavMessage ` to the vehicle
pub async fn send(&self, header: &MavHeader, message: &M) -> Result<(), AsyncMavlinkError> {
        let (backchannel, receiver) = oneshot::channel();
        self.task_dispatcher
            .clone() // TODO get rid of clone
            .send(Task::Emit {
                header: *header,
                message: message.clone(),
                backchannel,
            })
            .await
            .map_err(AsyncMavlinkError::from)?;
        receiver.await.map_err(AsyncMavlinkError::from)?
    }
pub async fn send ( & self , header : & MavHeader , message : & M ) -> Result < ( ) , AsyncMavlinkError > { let ( backchannel , receiver ) = oneshot :: channel ( ) ; self . task_dispatcher . clone ( ) // TODO get rid of clone . send ( Task :: Emit { header : * header , message : message . clone ( ) , backchannel , } ) . await . map_err ( AsyncMavlinkError :: from ) ? ; receiver . await . map_err ( AsyncMavlinkError :: from ) ? }
Send a `MavMessage` to the vehicle
Send a ` MavMessage ` to the vehicle
&self
header
&MavHeader
message
&M
&self
header
&MavHeader
message
&M
examples
None
use std::time::duration;
None
use futures::prelude::*;
None
use async_mavlink::asyncmavconn;
None
use async_mavlink::prelude::*;
None
use mavlink::{mavheader, mavlinkversion, common::*};
None
fn main() -> result<(),asyncmavlinkerror> {
None
smol::block_on(async {
None
let (conn, future) = asyncmavconn::new("udpbcast:127.0.0.5:14551", mavlinkversion::v1)?;
None
smol::spawn(async move { future.await; }).detach();
let header = MavHeader::default();
let message = MavMessage::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA {
target_component: 0,
target_system: 0,
}).

conn.send(&header, &message).await?.
let header = MavHeader :: default () ; let message = MavMessage :: PARAM_REQUEST_LIST ( PARAM_REQUEST_LIST_DATA { target_component : 0 target_system : 0 } ) . conn . send ( &header &message ) . await? .
ok(())
None
})}
None