Struct capsules_extra::net::sixlowpan::sixlowpan_state::Sixlowpan

source ·
pub struct Sixlowpan<'a, A: Alarm<'a>, C: ContextStore> {
    pub ctx_store: C,
    /* private fields */
}
Expand description

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§

§ctx_store: C

Implementations§

source§

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

source

pub fn new(ctx_store: C, clock: &'a A) -> Sixlowpan<'a, A, C>

Creates a new Sixlowpan

§Arguments
  • 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.

Trait Implementations§

source§

impl<'a, A: Alarm<'a>, C: ContextStore> RxClient for Sixlowpan<'a, A, C>

source§

fn receive<'b>( &self, buf: &'b [u8], header: Header<'b>, _lqi: u8, data_offset: usize, data_len: usize, )

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
source§

impl<'a, A: Alarm<'a>, C: ContextStore> SixlowpanState<'a> for Sixlowpan<'a, A, C>

source§

fn add_rx_state(&self, rx_state: &'a RxState<'a>)

Adds an additional RxState for reassembling IPv6 packets

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

source§

fn set_rx_client(&'a self, client: &'a dyn SixlowpanRxClient)

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

source§

fn next_dgram_tag(&self) -> u16

source§

fn get_ctx_store(&self) -> &dyn ContextStore

Auto Trait Implementations§

§

impl<'a, A, C> !Freeze for Sixlowpan<'a, A, C>

§

impl<'a, A, C> !RefUnwindSafe for Sixlowpan<'a, A, C>

§

impl<'a, A, C> !Send for Sixlowpan<'a, A, C>

§

impl<'a, A, C> !Sync for Sixlowpan<'a, A, C>

§

impl<'a, A, C> Unpin for Sixlowpan<'a, A, C>
where C: Unpin,

§

impl<'a, A, C> !UnwindSafe for Sixlowpan<'a, A, C>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.