Struct capsules::ieee802154::xmac::XMac
[−]
[src]
pub struct XMac<'a, R: Radio + 'a, A: Alarm + 'a> { radio: &'a R, alarm: &'a A, rng: &'a RNG, tx_client: Cell<Option<&'static TxClient>>, rx_client: Cell<Option<&'static RxClient>>, state: Cell<XMacState>, delay_sleep: Cell<bool>, tx_header: Cell<Option<XMacHeaderInfo>>, tx_payload: TakeCell<'static, [u8]>, tx_len: Cell<usize>, tx_preamble_pending: Cell<bool>, tx_preamble_seq_num: Cell<u8>, tx_preamble_buf: TakeCell<'static, [u8]>, rx_pending: Cell<bool>, }
Fields
radio: &'a R
alarm: &'a A
rng: &'a RNG
tx_client: Cell<Option<&'static TxClient>>
rx_client: Cell<Option<&'static RxClient>>
state: Cell<XMacState>
delay_sleep: Cell<bool>
tx_header: Cell<Option<XMacHeaderInfo>>
tx_payload: TakeCell<'static, [u8]>
tx_len: Cell<usize>
tx_preamble_pending: Cell<bool>
tx_preamble_seq_num: Cell<u8>
tx_preamble_buf: TakeCell<'static, [u8]>
rx_pending: Cell<bool>
Methods
impl<'a, R: Radio + 'a, A: Alarm + 'a> XMac<'a, R, A>
[src]
pub fn new(radio: &'a R, alarm: &'a A, rng: &'a RNG) -> XMac<'a, R, A>
[src]
fn sleep_time(&self) -> u32
[src]
fn sleep(&self)
[src]
fn set_timer_ms<T: Time>(&self, ms: u32)
[src]
fn transmit_preamble(&self)
[src]
fn transmit_packet(&self)
[src]
fn call_tx_client(
&self,
buf: &'static mut [u8],
acked: bool,
result: ReturnCode
)
[src]
&self,
buf: &'static mut [u8],
acked: bool,
result: ReturnCode
)
fn call_rx_client(
&self,
buf: &'static mut [u8],
len: usize,
crc_valid: bool,
result: ReturnCode
)
[src]
&self,
buf: &'static mut [u8],
len: usize,
crc_valid: bool,
result: ReturnCode
)
Trait Implementations
impl<'a, R: Radio + 'a, A: Alarm + 'a> Client for XMac<'a, R, A>
[src]
fn randomness_available(
&self,
randomness: &mut Iterator<Item = u32>
) -> Continue
[src]
&self,
randomness: &mut Iterator<Item = u32>
) -> Continue
Called by the (RNG)[trait.RNG.html] when there are one or more random numbers available Read more
impl<'a, R: Radio + 'a, A: Alarm> Mac for XMac<'a, R, A>
[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, A: Alarm + 'a> Client for XMac<'a, R, A>
[src]
fn fired(&self)
[src]
Callback signaled when the alarm's clock reaches the value set in Alarm#set_alarm
. Read more
impl<'a, R: Radio + 'a, A: Alarm + 'a> PowerClient for XMac<'a, R, A>
[src]
impl<'a, R: Radio + 'a, A: Alarm + 'a> TxClient for XMac<'a, R, A>
[src]
fn send_done(&self, buf: &'static mut [u8], acked: bool, result: ReturnCode)
[src]
impl<'a, R: Radio + 'a, A: Alarm + 'a> RxClient for XMac<'a, R, A>
[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
)