Struct capsules_extra::ieee802154::mac::AwakeMac

source ·
pub struct AwakeMac<'a, R: Radio<'a>> { /* private fields */ }
Expand description

Default implementation of a Mac layer. Acts as a pass-through between a MacDevice implementation and the underlying radio::Radio device. Does not change the power state of the radio during operation.

Implementations§

source§

impl<'a, R: Radio<'a>> AwakeMac<'a, R>

source

pub fn new(radio: &'a R) -> AwakeMac<'a, R>

Trait Implementations§

source§

impl<'a, R: Radio<'a>> Mac<'a> for AwakeMac<'a, R>

source§

fn initialize(&self) -> Result<(), ErrorCode>

Initializes the layer.
source§

fn is_on(&self) -> bool

Indicates whether or not the MAC protocol is active and can send frames
source§

fn set_config_client(&self, client: &'a dyn ConfigClient)

Sets the notified client for configuration changes
source§

fn set_address(&self, addr: u16)

Sets the short 16-bit address of the radio
source§

fn set_address_long(&self, addr: [u8; 8])

Sets the long 64-bit address of the radio
source§

fn set_pan(&self, id: u16)

Sets the 16-bit PAN id of the radio
source§

fn get_address(&self) -> u16

The short 16-bit address of the radio
source§

fn get_address_long(&self) -> [u8; 8]

The long 64-bit address of the radio
source§

fn get_pan(&self) -> u16

The 16-bit PAN id of the radio
source§

fn config_commit(&self)

Must be called after one or more calls to set_*. If set_* is called without calling config_commit, there is no guarantee that the underlying hardware configuration (addresses, pan ID) is in line with this MAC protocol implementation. The specified config_client is notified on completed reconfiguration.
source§

fn set_transmit_client(&self, client: &'a dyn TxClient)

Sets the notified client for transmission completions
source§

fn set_receive_client(&self, client: &'a dyn RxClient)

Sets the notified client for frame receptions
source§

fn set_receive_buffer(&self, buffer: &'static mut [u8])

Sets the buffer for packet reception
source§

fn transmit( &self, full_mac_frame: &'static mut [u8], frame_len: usize, ) -> Result<(), (ErrorCode, &'static mut [u8])>

Transmits complete MAC frames, which must be prepared by an ieee802154::device::MacDevice before being passed to the Mac layer. Returns the frame buffer in case of an error.
source§

impl<'a, R: Radio<'a>> RxClient for AwakeMac<'a, R>

source§

fn receive( &self, buf: &'static mut [u8], frame_len: usize, lqi: u8, crc_valid: bool, result: Result<(), ErrorCode>, )

Packet was received. Read more
source§

impl<'a, R: Radio<'a>> TxClient for AwakeMac<'a, R>

source§

fn send_done( &self, buf: &'static mut [u8], acked: bool, result: Result<(), ErrorCode>, )

Send is complete or an error occurred during transmission. Read more

Auto Trait Implementations§

§

impl<'a, R> !Freeze for AwakeMac<'a, R>

§

impl<'a, R> !RefUnwindSafe for AwakeMac<'a, R>

§

impl<'a, R> !Send for AwakeMac<'a, R>

§

impl<'a, R> !Sync for AwakeMac<'a, R>

§

impl<'a, R> Unpin for AwakeMac<'a, R>

§

impl<'a, R> !UnwindSafe for AwakeMac<'a, R>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

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

§

type Error = Infallible

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

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

Performs the conversion.
source§

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.
source§

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

Performs the conversion.