Trait capsules::ieee802154::mac::Mac [] [src]

pub trait Mac {
    fn initialize(&self, mac_buf: &'static mut [u8]) -> ReturnCode;
fn set_config_client(&self, client: &'static ConfigClient);
fn set_transmit_client(&self, client: &'static TxClient);
fn set_receive_client(&self, client: &'static RxClient);
fn set_receive_buffer(&self, buffer: &'static mut [u8]);
fn get_address(&self) -> u16;
fn get_address_long(&self) -> [u8; 8];
fn get_pan(&self) -> u16;
fn set_address(&self, addr: u16);
fn set_address_long(&self, addr: [u8; 8]);
fn set_pan(&self, id: u16);
fn config_commit(&self);
fn is_on(&self) -> bool;
fn transmit(
        &self,
        full_mac_frame: &'static mut [u8],
        frame_len: usize
    ) -> (ReturnCode, Option<&'static mut [u8]>); }

Required Methods

Initializes the layer; may require a buffer to temporarily retaining frames to be transmitted

Sets the notified client for configuration changes

Sets the notified client for transmission completions

Sets the notified client for frame receptions

Sets the buffer for packet reception

The short 16-bit address of the radio

The long 64-bit address of the radio

The 16-bit PAN id of the radio

Sets the short 16-bit address of the radio

Sets the long 64-bit address of the radio

Sets the 16-bit PAN id of the radio

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.

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

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.

Implementors