LoraphyRadio

Struct LoraphyRadio 

Source
pub struct LoraphyRadio<M: RawMutex + 'static, const RX: usize, const TX: usize> { /* private fields */ }
Expand description

Implements umsh_hal::Radio over the shared Channels.

The actual TX power and modulation params live on the runner side (it owns the LoRa driver). This handle only carries:

  • the channel pair used to talk to the runner,
  • a precomputed worst-case airtime so the MAC’s scheduler doesn’t have to recompute it.

Implementations§

Source§

impl<M: RawMutex + 'static, const RX: usize, const TX: usize> LoraphyRadio<M, RX, TX>

Source

pub fn new(ch: &'static Channels<M, RX, TX>, t_frame_ms: u32) -> Self

Use airtime_ms with your modulation settings to compute t_frame_ms.

Trait Implementations§

Source§

impl<M: RawMutex + 'static, const RX: usize, const TX: usize> Radio for LoraphyRadio<M, RX, TX>

Source§

type Error = RadioError

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. Read more
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.

Auto Trait Implementations§

§

impl<M, const RX: usize, const TX: usize> Freeze for LoraphyRadio<M, RX, TX>

§

impl<M, const RX: usize, const TX: usize> !RefUnwindSafe for LoraphyRadio<M, RX, TX>

§

impl<M, const RX: usize, const TX: usize> Send for LoraphyRadio<M, RX, TX>
where M: Sync,

§

impl<M, const RX: usize, const TX: usize> Sync for LoraphyRadio<M, RX, TX>
where M: Sync,

§

impl<M, const RX: usize, const TX: usize> Unpin for LoraphyRadio<M, RX, TX>

§

impl<M, const RX: usize, const TX: usize> !UnwindSafe for LoraphyRadio<M, RX, TX>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.