ApConfig

Struct ApConfig 

Source
pub struct ApConfig<'a> {
    pub hidden: bool,
    pub security: SecurityMode,
    pub max_clients: u8,
    pub frequency_mhz: u16,
    pub address: [u8; 4],
    pub prefix: u8,
    pub ssid: &'a [u8],
    pub credential: &'a [u8],
}
Expand description

PROP_WIFI_AP_CONFIG: the network the device offers.

Secret-bearing, like NetworkEntry: the reported form stops at the SSID.

Fields§

§hidden: bool

Beacon without the name. A courtesy to neighbors’ pickers, not a secret: the name is in every association.

§security: SecurityMode§max_clients: u8

Stations admitted at once, or 0 for the device’s own limit. A device clamps a larger value to what it can hold rather than refusing it.

§frequency_mhz: u16

Preferred primary channel frequency, or 0 for the device’s choice. A preference, not a promise.

§address: [u8; 4]

The device’s own address on the offered subnet, or all-zero with prefix 0 for the device’s default.

§prefix: u8

Prefix of the offered subnet, 8 to 30, or 0 with an all-zero address.

§ssid: &'a [u8]§credential: &'a [u8]

Implementations§

Source§

impl<'a> ApConfig<'a>

Source

pub const DEFAULT_ADDRESS: [u8; 4]

The default subnet a device offers when address is all-zero: what a phone joining an embedded device has come to expect.

Source

pub const DEFAULT_PREFIX: u8 = 24u8

Prefix that goes with Self::DEFAULT_ADDRESS.

Source

pub const fn flags(&self) -> u8

Source

pub fn uses_default_subnet(&self) -> bool

Whether the device’s own address and prefix were left to it.

Source

pub fn validate(&self) -> Result<(), WifiError>

Whether this configuration is one a device may be asked to offer. Excludes the modes an access point may not offer, and the subnets that are not usable to hand addresses out on.

Whether the frequency is one the device may transmit on is a regulatory question this cannot answer, and belongs to the device.

Source

pub fn encode(&self, out: &mut [u8]) -> Result<usize, WifiError>

Encode the value, credential included.

Source

pub fn encode_reported(&self, out: &mut [u8]) -> Result<usize, WifiError>

Encode the reported form: the value through its SSID.

Source

pub fn decode(bytes: &'a [u8]) -> Result<Self, WifiError>

Trait Implementations§

Source§

impl<'a> Clone for ApConfig<'a>

Source§

fn clone(&self) -> ApConfig<'a>

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for ApConfig<'a>

Source§

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

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

impl<'a> PartialEq for ApConfig<'a>

Source§

fn eq(&self, other: &ApConfig<'a>) -> bool

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

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<'a> Copy for ApConfig<'a>

Source§

impl<'a> Eq for ApConfig<'a>

Source§

impl<'a> StructuralPartialEq for ApConfig<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for ApConfig<'a>

§

impl<'a> RefUnwindSafe for ApConfig<'a>

§

impl<'a> Send for ApConfig<'a>

§

impl<'a> Sync for ApConfig<'a>

§

impl<'a> Unpin for ApConfig<'a>

§

impl<'a> UnwindSafe for ApConfig<'a>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

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

§

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
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.