[][src]Struct jnet::ieee802154::Frame

pub struct Frame<BUFFER> where
    BUFFER: AsSlice<Element = u8>, 
{ /* fields omitted */ }

IEEE 802.15.4 MAC frame

Methods

impl<B> Frame<B> where
    B: AsSlice<Element = u8>, 
[src]

pub fn parse(bytes: B) -> Result<Self, B>[src]

Parses bytes into an 802.15.4 frame

pub fn get_type(&self) -> Type[src]

Reads the 'Frame type' field

pub fn get_security_enabled(&self) -> bool[src]

Reads the 'Security enabled' field

pub fn get_frame_pending(&self) -> bool[src]

Reads the 'Frame pending' field

pub fn get_ack_request(&self) -> bool[src]

Reads the 'Ack. request' field

pub fn get_intra_pan(&self) -> bool[src]

Reads the 'Intra-PAN' field

pub fn get_dest_addr_mode(&self) -> AddrMode[src]

Reads the 'Dest. addressing mode' field

pub fn get_src_addr_mode(&self) -> AddrMode[src]

Reads the 'Source addressing mode' field

pub fn get_sequence_number(&self) -> u8[src]

Reads the 'Sequence number' field

pub fn get_dest_pan_id(&self) -> Option<PanId>[src]

Reads the 'Destination PAN identifier' field

pub fn get_dest_addr(&self) -> Option<Addr>[src]

Reads the 'Destination address' field

pub fn get_src_pan_id(&self) -> Option<PanId>[src]

Reads the 'Source PAN identifier' field

pub fn get_src_addr(&self) -> Option<Addr>[src]

Reads the 'Source address' field

pub fn header(&self) -> &[u8][src]

Returns an immutable view into the header

pub fn payload(&self) -> &[u8][src]

Returns an immutable view into the payload

pub fn as_bytes(&self) -> &[u8][src]

Returns the byte representation of this frame

pub fn free(self) -> B[src]

Frees the underlying buffer

impl<B> Frame<B> where
    B: AsMutSlice<Element = u8>, 
[src]

pub fn data(buffer: B, src_dest: SrcDest) -> Self[src]

Creates a new data frame from the given buffer

pub fn set_ack_request(&mut self, ack: bool)[src]

Sets the 'Ack. request' field to ack

pub fn set_sequence_number(&mut self, seq: u8)[src]

Sets the 'Sequence number' field to seq

pub fn payload_mut(&mut self) -> &mut [u8][src]

Returns a mutable view into the payload

impl<B> Frame<B> where
    B: AsMutSlice<Element = u8> + Truncate<u8>, 
[src]

pub fn set_payload(&mut self, payload: &[u8])[src]

Fills the payload with the given data and adjusts the length of the frame

pub fn echo_reply<F>(&mut self, src: Addr, dest: Addr, f: F) where
    F: FnOnce(&mut Message<&mut [u8], EchoReply>), 
[src]

Fills the buffer with an 'Echo Reply' ICMPv6 message

pub fn neighbor_advertisement<F>(
    &mut self,
    src: Addr,
    dest: Addr,
    target_ll_addr: Option<ExtendedAddr>,
    f: F
) where
    F: FnOnce(&mut Message<&mut [u8], NeighborAdvertisement>), 
[src]

Fills the payload with a 'Neighbor Advertisement' ICMPv6 message

pub fn udp<F>(
    &mut self,
    src_addr: Addr,
    src_port: u16,
    dest_addr: Addr,
    dest_port: u16,
    elide_checksum: bool,
    f: F
) where
    F: FnOnce(&mut UdpPacket<&mut [u8]>), 
[src]

Fills the payload with a UDP packet

Trait Implementations

impl<B> Debug for Frame<B> where
    B: AsSlice<Element = u8>, 
[src]

impl<BUFFER: Copy> Copy for Frame<BUFFER> where
    BUFFER: AsSlice<Element = u8>, 
[src]

impl<BUFFER: Clone> Clone for Frame<BUFFER> where
    BUFFER: AsSlice<Element = u8>, 
[src]

Auto Trait Implementations

impl<BUFFER> Unpin for Frame<BUFFER> where
    BUFFER: Unpin

impl<BUFFER> Send for Frame<BUFFER> where
    BUFFER: Send

impl<BUFFER> Sync for Frame<BUFFER> where
    BUFFER: Sync

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self