[][src]Trait radio::nonblocking::AsyncTransmit

pub trait AsyncTransmit<E> {
    fn async_transmit<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        data: &'life1 [u8],
        tx_options: AsyncOptions
    ) -> Pin<Box<dyn Future<Output = Result<(), E>> + Send + 'async_trait>>
    where
        E: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; }

Async transmit function implemented over radio::Transmit and radio::Power using the provided AsyncOptions

extern crate async_std;
use async_std::task;

use radio::nonblocking::{AsyncTransmit, AsyncOptions};

task::block_on(async {
    // Transmit using a future
    let res = radio.async_transmit(&[0xaa, 0xbb], AsyncOptions::default()).await;
    
    assert_eq!(res, Ok(()));
});

Required methods

fn async_transmit<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    data: &'life1 [u8],
    tx_options: AsyncOptions
) -> Pin<Box<dyn Future<Output = Result<(), E>> + Send + 'async_trait>> where
    E: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 

Loading content...

Implementors

impl<T, E> AsyncTransmit<E> for T where
    T: Transmit<Error = E> + Power<Error = E> + Send,
    E: Debug + Send + Unpin
[src]

Loading content...