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>
impl<'a, A: Alarm<'a>, C: ContextStore> Sixlowpan<'a, A, C>
sourcepub fn new(ctx_store: C, clock: &'a A) -> Sixlowpan<'a, A, C>
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 ofAlarm
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>
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,
)
fn receive<'b>( &self, buf: &'b [u8], header: Header<'b>, _lqi: u8, data_offset: usize, data_len: usize, )
source§impl<'a, A: Alarm<'a>, C: ContextStore> SixlowpanState<'a> for Sixlowpan<'a, A, C>
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>)
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)
fn set_rx_client(&'a self, client: &'a dyn SixlowpanRxClient)
Sets the SixlowpanClient that will receive transmission completion and new packet reception callbacks.