Radio

Trait Radio 

Source
pub trait Radio {
    type Error;

    // Required methods
    async fn transmit(
        &mut self,
        data: &[u8],
        options: TxOptions,
    ) -> Result<(), TxError<Self::Error>>;
    fn poll_receive(
        &mut self,
        cx: &mut Context<'_>,
        buf: &mut [u8],
    ) -> Poll<Result<RxInfo, Self::Error>>;
    fn max_frame_size(&self) -> usize;
    fn t_frame_ms(&self) -> u32;
}
Expand description

Half-duplex radio abstraction used by the MAC coordinator.

Required Associated Types§

Required Methods§

Source

async fn transmit( &mut self, data: &[u8], options: TxOptions, ) -> Result<(), TxError<Self::Error>>

Transmit a complete raw UMSH frame.

Source

fn poll_receive( &mut self, cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll<Result<RxInfo, Self::Error>>

Poll reception of one frame into buf.

Poll::Pending means no frame is currently available right now. The call does not reserve any receive state; a later poll after transmit completion can resume probing immediately.

Source

fn max_frame_size(&self) -> usize

Return the largest supported raw frame size.

Source

fn t_frame_ms(&self) -> u32

Return the approximate airtime for a maximum-length frame.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§