Struct capsules::net::sixlowpan::Sixlowpan [] [src]

pub struct Sixlowpan<'a, A: Alarm + 'a, C: ContextStore> {
    pub radio: &'a MacDevice<'a>,
    ctx_store: C,
    clock: &'a A,
    client: Cell<Option<&'a SixlowpanClient>>,
    tx_state: TxState,
    rx_states: List<'a, RxState<'a>>,
}

Sends a receives IPv6 packets via 6loWPAN compression and fragmentation.

Initialization

The new method creates an instance of Sixlowpan that can send packets. To receive packets, Sixlowpan needs one or more RxStates which can be added with add_rx_state. More RxStates allow the Sixlowpan to receive more packets concurrently.

Finally, set_client controls the client that will receive transmission completion and reception callbacks.

Fields

Methods

impl<'a, A: Alarm, C: ContextStore> Sixlowpan<'a, A, C>
[src]

[src]

Creates a new Sixlowpan

Arguments

  • radio - An implementation of the MacDevice trait that manages the timing and frequency of sending a receiving 802.15.4 frames

  • ctx_store - Stores IPv6 address nextwork context mappings

  • tx_buf - A buffer used for storing individual fragments of a packet in transmission. This buffer must be at least the length of an 802.15.4 frame.

  • clock - A implementation of Alarm used for tracking the timing of frame arrival. The clock should be continue running during sleep and have an accuracy of at least 60 seconds.

[src]

Adds an additional RxState for reassembling IPv6 packets

Each RxState struct allows an additional IPv6 packet to be reassembled concurrently.

[src]

Sets the SixlowpanClient that will receive transmission completion and new packet reception callbacks.

[src]

Transmits the supplied IPv6 packet.

Transmitted IPv6 packets will be optionally secured via the security argument.

Only one transmission is allowed at a time. Calling this method while before a previous tranismission has completed will return an error.

Arguments

  • src_mac_addr - Why is the argument specified?

  • dst_mac_addr - Why is the argument specified?

  • ip6_packet - A buffer containing the IPv6 packet to transmit. This buffer will be passed back in the send_done callback.

  • ip6_packet_len - The length of the packet, in case the ip6_packet buffer is larger than the actual packet. Must be at most ip6_packet.len()

  • security - An optional tuple specifying the security level (encryption, MIC, or both) and key identifier to use. If elided, no security is used.

This function exposes the primary packet transmission fuctionality. The source and destination mac address arguments specify the link-layer addresses of the packet, while the security option specifies the security level (if any). This option is exposed to upper layers, as upper level protocols may want to set or manage the link-layer security options.

The ip6_packet argument contains a pointer to a buffer containing a valid IPv6 packet, while the ip6_packet_len argument specifies the number of bytes to send. Note that ip6_packet.len() > ip6_packet_len, but we check the invariant that ip6_packet_len <= ip6_packet.len().

[src]

[src]

[src]

[src]

[src]

Trait Implementations

impl<'a, A: Alarm, C: ContextStore> TxClient for Sixlowpan<'a, A, C>
[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, A: Alarm, C: ContextStore> RxClient for Sixlowpan<'a, A, C>
[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