pub struct Dot15d4Builder {
pub frame_type: u8,
pub security: bool,
pub pending: bool,
pub ackreq: bool,
pub panid_compress: bool,
pub frame_ver: u8,
pub seqnum: u8,
pub dest_panid: Option<u16>,
pub dest_addr: Dot15d4Addr,
pub src_panid: Option<u16>,
pub src_addr: Dot15d4Addr,
}Expand description
Builder for constructing IEEE 802.15.4 MAC frames.
Fields§
§frame_type: u8Frame type (3 bits).
security: boolSecurity enabled flag.
pending: boolFrame pending flag.
ackreq: boolACK request flag.
panid_compress: boolPAN ID compression flag.
frame_ver: u8Frame version (2 bits).
seqnum: u8Sequence number.
dest_panid: Option<u16>Destination PAN ID.
dest_addr: Dot15d4AddrDestination address.
src_panid: Option<u16>Source PAN ID.
src_addr: Dot15d4AddrSource address.
Implementations§
Source§impl Dot15d4Builder
impl Dot15d4Builder
Sourcepub fn frame_type(self, ft: u8) -> Self
pub fn frame_type(self, ft: u8) -> Self
Set the frame type.
Sourcepub fn panid_compress(self, val: bool) -> Self
pub fn panid_compress(self, val: bool) -> Self
Set the PAN ID compression flag.
Sourcepub fn dest_panid(self, panid: u16) -> Self
pub fn dest_panid(self, panid: u16) -> Self
Set the destination PAN ID.
Sourcepub fn dest_addr_short(self, addr: u16) -> Self
pub fn dest_addr_short(self, addr: u16) -> Self
Set the destination short address.
Sourcepub fn dest_addr_long(self, addr: u64) -> Self
pub fn dest_addr_long(self, addr: u64) -> Self
Set the destination long address.
Sourcepub fn no_dest_addr(self) -> Self
pub fn no_dest_addr(self) -> Self
Clear the destination address (set to None).
Sourcepub fn src_addr_short(self, addr: u16) -> Self
pub fn src_addr_short(self, addr: u16) -> Self
Set the source short address.
Sourcepub fn src_addr_long(self, addr: u64) -> Self
pub fn src_addr_long(self, addr: u64) -> Self
Set the source long address.
Sourcepub fn no_src_addr(self) -> Self
pub fn no_src_addr(self) -> Self
Clear the source address (set to None).
Sourcepub fn header_size(&self) -> usize
pub fn header_size(&self) -> usize
Get the expected header size for the current configuration.
Trait Implementations§
Source§impl Clone for Dot15d4Builder
impl Clone for Dot15d4Builder
Source§fn clone(&self) -> Dot15d4Builder
fn clone(&self) -> Dot15d4Builder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Dot15d4Builder
impl Debug for Dot15d4Builder
Auto Trait Implementations§
impl Freeze for Dot15d4Builder
impl RefUnwindSafe for Dot15d4Builder
impl Send for Dot15d4Builder
impl Sync for Dot15d4Builder
impl Unpin for Dot15d4Builder
impl UnsafeUnpin for Dot15d4Builder
impl UnwindSafe for Dot15d4Builder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more