Skip to main content

LoraRadio

Trait LoraRadio 

Source
pub trait LoraRadio {
    type Error: Debug;

    // Required methods
    fn send(&mut self, payload: &[u8]) -> Result<(), Self::Error>;
    fn recv(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>;
}
Expand description

LoRa-style packet radio. Send/receive are independent so a half- duplex driver implements both methods.

Required Associated Types§

Required Methods§

Source

fn send(&mut self, payload: &[u8]) -> Result<(), Self::Error>

Transmit payload as a single LoRa frame. Blocks until the frame has been handed to the radio’s TX queue.

Source

fn recv(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>

Read the next received frame into buf and return its size in bytes. Should block until at least one frame is available, or return an Error on timeout per implementation policy.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§