capsules_extra::net::sixlowpan::sixlowpan_state

Struct 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>,

Source§

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>,

Source§

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.