Struct capsules::ieee802154::framer::Framer [] [src]

pub struct Framer<'a, M: Mac + 'a, A: AES128CCM<'a> + 'a> {
    mac: &'a M,
    aes_ccm: &'a A,
    data_sequence: Cell<u8>,
    key_procedure: Cell<Option<&'a KeyProcedure>>,
    device_procedure: Cell<Option<&'a DeviceProcedure>>,
    tx_state: MapCell<TxState>,
    tx_client: Cell<Option<&'a TxClient>>,
    rx_state: MapCell<RxState>,
    rx_client: Cell<Option<&'a RxClient>>,
}

This struct wraps an IEEE 802.15.4 radio device kernel::hil::radio::Radio and exposes IEEE 802.15.4 MAC device functionality as the trait capsules::mac::Mac. It hides header preparation, transmission and processing logic from the user by essentially maintaining multiple state machines corresponding to the transmission, reception and encryption/decryption pipelines. See the documentation in capsules/src/mac.rs for more details.

Fields

KeyDescriptor lookup procedure

DeviceDescriptor lookup procedure

Transmision pipeline state. This should never be None, except when transitioning between states. That is, any method that consumes the current state should always remember to replace it along with the associated state information.

Reception pipeline state. Similar to the above, this should never be None, except when transitioning between states.

Methods

impl<'a, M: Mac + 'a, A: AES128CCM<'a> + 'a> Framer<'a, M, A>
[src]

[src]

[src]

Sets the IEEE 802.15.4 key lookup procedure to be used.

[src]

Sets the IEEE 802.15.4 key lookup procedure to be used.

[src]

Look up the key using the IEEE 802.15.4 KeyDescriptor lookup prodecure implemented elsewhere.

[src]

Look up the extended address of a device using the IEEE 802.15.4 DeviceDescriptor lookup prodecure implemented elsewhere.

[src]

IEEE 802.15.4-2015, 9.2.1, outgoing frame security procedure Performs the first checks in the security procedure. The rest of the steps are performed as part of the transmission pipeline. Returns the next TxState to enter.

[src]

IEEE 802.15.4-2015, 9.2.3, incoming frame security procedure

[src]

Advances the transmission pipeline if it can be advanced.

[src]

Advances the reception pipeline if it can be advanced.

Trait Implementations

impl<'a, M: Mac + 'a, A: AES128CCM<'a> + 'a> MacDevice<'a> for Framer<'a, M, A>
[src]

[src]

Sets the transmission client of this MAC device

[src]

Sets the receive client of this MAC device

[src]

The short 16-bit address of the MAC device

[src]

The long 64-bit address (EUI-64) of the MAC device

[src]

The 16-bit PAN ID of the MAC device

[src]

Set the short 16-bit address of the MAC device

[src]

Set the long 64-bit address (EUI-64) of the MAC device

[src]

Set the 16-bit PAN ID of the MAC device

[src]

This method 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 device implementation. Read more

[src]

Returns if the MAC device is currently on.

[src]

Prepares a mutable buffer slice as an 802.15.4 frame by writing the appropriate header bytes into the buffer. This needs to be done before adding the payload because the length of the header is not fixed. Read more

[src]

Transmits a frame that has been prepared by the above process. If the transmission process fails, the buffer inside the frame is returned so that it can be re-used. Read more

impl<'a, M: Mac + 'a, A: AES128CCM<'a> + 'a> TxClient for Framer<'a, M, A>
[src]

[src]

impl<'a, M: Mac + 'a, A: AES128CCM<'a> + 'a> RxClient for Framer<'a, M, A>
[src]

[src]

impl<'a, M: Mac + 'a, A: AES128CCM<'a> + 'a> ConfigClient for Framer<'a, M, A>
[src]

[src]

impl<'a, M: Mac + 'a, A: AES128CCM<'a> + 'a> CCMClient for Framer<'a, M, A>
[src]

[src]

res is SUCCESS if the encryption/decryption process succeeded. This does not mean that the message has been verified in the case of decryption. If we are encrypting: tag_is_valid is true iff res is SUCCESS. If we are decrypting: tag_is_valid is true iff res is SUCCESS and the message authentication tag is valid. Read more