Skip to main content

BeaconPayload

Struct BeaconPayload 

Source
pub struct BeaconPayload {
Show 14 fields pub beacon_order: u8, pub superframe_order: u8, pub final_cap_slot: u8, pub battery_life_ext: bool, pub pan_coordinator: bool, pub assoc_permit: bool, pub gts_desc_count: u8, pub gts_permit: bool, pub gts_dir_mask: u8, pub gts_descriptors: Vec<GtsDescriptor>, pub pa_num_short: u8, pub pa_num_long: u8, pub pa_short_addresses: Vec<u16>, pub pa_long_addresses: Vec<u64>,
}
Expand description

Parsed beacon frame payload.

Fields§

§beacon_order: u8

Beacon order (4 bits).

§superframe_order: u8

Superframe order (4 bits).

§final_cap_slot: u8

Final CAP slot (4 bits).

§battery_life_ext: bool

Battery life extension (1 bit).

§pan_coordinator: bool

PAN coordinator (1 bit).

§assoc_permit: bool

Association permit (1 bit).

§gts_desc_count: u8

GTS descriptor count (3 bits).

§gts_permit: bool

GTS permit (1 bit).

§gts_dir_mask: u8

GTS direction mask (7 bits), present if gts_desc_count > 0.

§gts_descriptors: Vec<GtsDescriptor>

GTS descriptors (3 bytes each).

§pa_num_short: u8

Number of short addresses pending (3 bits).

§pa_num_long: u8

Number of extended (long) addresses pending (3 bits).

§pa_short_addresses: Vec<u16>

Short addresses pending (2 bytes each).

§pa_long_addresses: Vec<u64>

Long addresses pending (8 bytes each).

Implementations§

Source§

impl BeaconPayload

Source

pub fn parse(buf: &[u8], offset: usize) -> Result<(Self, usize), FieldError>

Parse a beacon payload from the buffer at the given offset. Returns the parsed payload and the number of bytes consumed.

Source

pub fn build(&self) -> Vec<u8>

Build the beacon payload bytes.

Source

pub fn summary(&self) -> String

Get a human-readable summary of this beacon.

Trait Implementations§

Source§

impl Clone for BeaconPayload

Source§

fn clone(&self) -> BeaconPayload

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BeaconPayload

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BeaconPayload

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for BeaconPayload

Source§

fn eq(&self, other: &BeaconPayload) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for BeaconPayload

Source§

impl StructuralPartialEq for BeaconPayload

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V