Struct capsules::ieee802154::mac::AwakeMac
[−]
[src]
pub struct AwakeMac<'a, R: Radio + 'a> { radio: &'a R, tx_client: Cell<Option<&'static TxClient>>, rx_client: Cell<Option<&'static RxClient>>, }
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.
Fields
radio: &'a R
tx_client: Cell<Option<&'static TxClient>>
rx_client: Cell<Option<&'static RxClient>>
Methods
impl<'a, R: Radio + 'a> AwakeMac<'a, R>
[src]
Trait Implementations
impl<'a, R: Radio + 'a> Mac for AwakeMac<'a, R>
[src]
fn initialize(&self, _mac_buf: &'static mut [u8]) -> ReturnCode
[src]
Initializes the layer; may require a buffer to temporarily retaining frames to be transmitted Read more
fn is_on(&self) -> bool
[src]
Indicates whether or not the MAC protocol is active and can send frames
fn set_config_client(&self, client: &'static ConfigClient)
[src]
Sets the notified client for configuration changes
fn set_address(&self, addr: u16)
[src]
Sets the short 16-bit address of the radio
fn set_address_long(&self, addr: [u8; 8])
[src]
Sets the long 64-bit address of the radio
fn set_pan(&self, id: u16)
[src]
Sets the 16-bit PAN id of the radio
fn get_address(&self) -> u16
[src]
The short 16-bit address of the radio
fn get_address_long(&self) -> [u8; 8]
[src]
The long 64-bit address of the radio
fn get_pan(&self) -> u16
[src]
The 16-bit PAN id of the radio
fn config_commit(&self)
[src]
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 specificed config_client is notified on completed reconfiguration. Read more
fn set_transmit_client(&self, client: &'static TxClient)
[src]
Sets the notified client for transmission completions
fn set_receive_client(&self, client: &'static RxClient)
[src]
Sets the notified client for frame receptions
fn set_receive_buffer(&self, buffer: &'static mut [u8])
[src]
Sets the buffer for packet reception
fn transmit(
&self,
full_mac_frame: &'static mut [u8],
frame_len: usize
) -> (ReturnCode, Option<&'static mut [u8]>)
[src]
&self,
full_mac_frame: &'static mut [u8],
frame_len: usize
) -> (ReturnCode, Option<&'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. Read more
impl<'a, R: Radio + 'a> TxClient for AwakeMac<'a, R>
[src]
fn send_done(&self, buf: &'static mut [u8], acked: bool, result: ReturnCode)
[src]
impl<'a, R: Radio + 'a> RxClient for AwakeMac<'a, R>
[src]
fn receive(
&self,
buf: &'static mut [u8],
frame_len: usize,
crc_valid: bool,
result: ReturnCode
)
[src]
&self,
buf: &'static mut [u8],
frame_len: usize,
crc_valid: bool,
result: ReturnCode
)