[][src]Trait radio_sx128x::Receive

pub trait Receive {
    type Error;
    type Info;
    fn start_receive(&mut self) -> Result<(), Self::Error>;
fn check_receive(&mut self, restart: bool) -> Result<bool, Self::Error>;
fn get_received(
        &mut self,
        &mut Self::Info,
        &'a mut [u8]
    ) -> Result<usize, Self::Error>; }

Receive trait for radios that can receive packets

Associated Types

type Error

Radio error

type Info

Packet received info

Loading content...

Required methods

fn start_receive(&mut self) -> Result<(), Self::Error>

Set receiving on the specified channel

Returns an error if receive mode was not entered

fn check_receive(&mut self, restart: bool) -> Result<bool, Self::Error>

Check for reception

The restart flag indicates on (recoverable) error conditions (such as invalid CRC) the radio should re-enter receive mode if required and continue reception.

This returns true for received, false for not received, or the provided error

fn get_received(
    &mut self,
    &mut Self::Info,
    &'a mut [u8]
) -> Result<usize, Self::Error>

Fetch a received packet if rx is complete

This copies received data into the provided buffer and returns the number of bytes received as well as information about the received packet

Loading content...

Implementors

impl<Hal, CommsError, PinError> Receive for Sx128x<Hal, CommsError, PinError> where
    Hal: Hal<CommsError, PinError>, 
[src]

radio::Receive implementation for the SX128x

type Info = Info

Receive info structure

type Error = Error<CommsError, PinError>

RF Error object

fn start_receive(&mut self) -> Result<(), Self::Error>[src]

Start radio in receive mode

fn check_receive(&mut self, restart: bool) -> Result<bool, Self::Error>[src]

Check for a received packet

fn get_received<'a>(
    &mut self,
    info: &mut Self::Info,
    data: &'a mut [u8]
) -> Result<usize, Self::Error>
[src]

Fetch a received packet

Loading content...