Trait radio::blocking::BlockingReceive

source ·
pub trait BlockingReceive<I, E> {
    // Required method
    fn do_receive(
        &mut self,
        buff: &mut [u8],
        rx_options: BlockingOptions
    ) -> Result<(usize, I), BlockingError<E>>;
}
Expand description

Blocking receive function implemented over radio::Receive using the provided BlockingOptions and radio-internal DelayUs impl to poll for completion

use radio::{BlockingReceive, BlockingOptions};

let data = [0xaa, 0xbb];
let info = BasicInfo::new(-81, 0);


// Setup buffer to read into
let mut buff = [0u8; 128];

// Receive using a blocking call
let (n, info) = radio.do_receive(&mut buff, BlockingOptions::default())?;

assert_eq!(n, data.len());
assert_eq!(&buff[..data.len()], &data);

Required Methods§

source

fn do_receive( &mut self, buff: &mut [u8], rx_options: BlockingOptions ) -> Result<(usize, I), BlockingError<E>>

Implementors§

source§

impl<T, I, E> BlockingReceive<I, E> for T
where T: Receive<Info = I, Error = E> + DelayNs, <T as Receive>::Info: Debug, I: Debug, E: Debug,