Struct capsules::ieee802154::virtual_mac::MuxMac [] [src]

pub struct MuxMac<'a> {
    mac: &'a MacDevice<'a>,
    users: List<'a, MacUser<'a>>,
    inflight: Cell<Option<&'a MacUser<'a>>>,
}

IEE 802.15.4 MAC device muxer that keeps a list of MAC users and sequences any pending transmission requests. Any received frames from the underlying MAC device are sent to all users.

Fields

Methods

impl<'a> MuxMac<'a>
[src]

[src]

[src]

Registers a MAC user with this MAC mux device. Each MAC user should only be registered once.

[src]

Gets the next MacUser and operation to perform if an operation is not already underway.

[src]

Performs a non-idle operation on a MacUser asynchronously: that is, if the transmission operation results in immediate failure, then return the buffer to the MacUser via its transmit client.

[src]

Performs a non-idle operation on a MacUser synchronously, returning the error code and the buffer immediately.

[src]

Begins the next outstanding transmission if there is no ongoing operation and there is a user waiting to transmit a frame. Since this is being called asynchronously, return any buffers to the active tx_client via the send_done callback in the event of failure.

[src]

Begins the next outstanding transmission if there is no ongoing operation and there is a user waiting to transmit a frame. Since this is being called synchronously, there is a need to identify the MacUser that just queued its transmission request. This can only be done by comparing the raw pointer references of the two users, since there is no type-level way to guarantee that the enqueued user is actually in this Mux device's users list. It's safe because the raw pointer references are never dereferenced.

If the newly-enqueued transmission is immediately executed by this mux device but fails immediately, return the buffer synchronously.

Trait Implementations

impl<'a> TxClient for MuxMac<'a>
[src]

[src]

When transmission is complete or fails, return the buffer used for transmission to the client. result indicates whether or not the transmission was successful. Read more

impl<'a> RxClient for MuxMac<'a>
[src]

[src]

When a frame is received, this callback is triggered. The client only receives an immutable borrow of the buffer. Only completely valid, unsecured frames that have passed the incoming security procedure are exposed to the client. Read more