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§
Beacon without the name. A courtesy to neighbors’ pickers, not a secret: the name is in every association.
security: SecurityMode§max_clients: u8Stations 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: u16Preferred 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: u8Prefix 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>
impl<'a> ApConfig<'a>
Sourcepub const DEFAULT_ADDRESS: [u8; 4]
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.
Sourcepub const DEFAULT_PREFIX: u8 = 24u8
pub const DEFAULT_PREFIX: u8 = 24u8
Prefix that goes with Self::DEFAULT_ADDRESS.
pub const fn flags(&self) -> u8
Sourcepub fn uses_default_subnet(&self) -> bool
pub fn uses_default_subnet(&self) -> bool
Whether the device’s own address and prefix were left to it.
Sourcepub fn validate(&self) -> Result<(), WifiError>
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.
Sourcepub fn encode(&self, out: &mut [u8]) -> Result<usize, WifiError>
pub fn encode(&self, out: &mut [u8]) -> Result<usize, WifiError>
Encode the value, credential included.
Sourcepub fn encode_reported(&self, out: &mut [u8]) -> Result<usize, WifiError>
pub fn encode_reported(&self, out: &mut [u8]) -> Result<usize, WifiError>
Encode the reported form: the value through its SSID.
pub fn decode(bytes: &'a [u8]) -> Result<Self, WifiError>
Trait Implementations§
impl<'a> Copy for ApConfig<'a>
impl<'a> Eq for ApConfig<'a>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)