#[non_exhaustive]pub struct WifiController<'d> { /* private fields */ }Implementations§
Source§impl WifiController<'_>
 
impl WifiController<'_>
Sourcepub fn take_sniffer(&self) -> Option<Sniffer>
 
pub fn take_sniffer(&self) -> Option<Sniffer>
Attempts to take the sniffer, returns Some(Sniffer) if successful,
otherwise None.
Sourcepub fn set_protocol(
    &mut self,
    protocols: EnumSet<Protocol>,
) -> Result<(), WifiError>
 
pub fn set_protocol( &mut self, protocols: EnumSet<Protocol>, ) -> Result<(), WifiError>
Sourcepub fn set_power_saving(&mut self, ps: PowerSaveMode) -> Result<(), WifiError>
 
pub fn set_power_saving(&mut self, ps: PowerSaveMode) -> Result<(), WifiError>
Configures modem power saving
Sourcepub fn scan_with_config_sync<const N: usize>(
    &mut self,
    config: ScanConfig<'_>,
) -> Result<(Vec<AccessPointInfo, N>, usize), WifiError>
 
pub fn scan_with_config_sync<const N: usize>( &mut self, config: ScanConfig<'_>, ) -> Result<(Vec<AccessPointInfo, N>, usize), WifiError>
A blocking wifi network scan with caller-provided scanning options.
Sourcepub fn scan_n<const N: usize>(
    &mut self,
) -> Result<(Vec<AccessPointInfo, N>, usize), WifiError>
 
pub fn scan_n<const N: usize>( &mut self, ) -> Result<(Vec<AccessPointInfo, N>, usize), WifiError>
A blocking wifi network scan with default scanning options.
Sourcepub fn connect(&mut self) -> Result<(), WifiError>
 
pub fn connect(&mut self) -> Result<(), WifiError>
Connect WiFi station to the AP.
- If station is connected , call Self::disconnect to disconnect.
 - Scanning will not be effective until connection between device and the AP is established.
 - If device is scanning and connecting at the same time, it will abort scanning and return a warning message and error
 
Sourcepub fn disconnect(&mut self) -> Result<(), WifiError>
 
pub fn disconnect(&mut self) -> Result<(), WifiError>
Disconnect WiFi station from the AP.
Sourcepub fn capabilities(&self) -> Result<EnumSet<Capability>, WifiError>
 
pub fn capabilities(&self) -> Result<EnumSet<Capability>, WifiError>
Get the supported capabilities of the controller.
Sourcepub fn set_configuration(
    &mut self,
    conf: &Configuration,
) -> Result<(), WifiError>
 
pub fn set_configuration( &mut self, conf: &Configuration, ) -> Result<(), WifiError>
Set the configuration.
This will set the mode accordingly. You need to use Wifi::connect() for connecting to an AP.
Sourcepub fn set_mode(&mut self, mode: WifiMode) -> Result<(), WifiError>
 
pub fn set_mode(&mut self, mode: WifiMode) -> Result<(), WifiError>
Set the WiFi mode.
This will override the mode inferred by Self::set_configuration.
Sourcepub fn is_started(&self) -> Result<bool, WifiError>
 
pub fn is_started(&self) -> Result<bool, WifiError>
Checks if the WiFi controller has started.
This function should be called after the start method to verify if the
WiFi has started successfully.
Sourcepub fn is_connected(&self) -> Result<bool, WifiError>
 
pub fn is_connected(&self) -> Result<bool, WifiError>
Checks if the WiFi controller is connected to an AP.
This function should be called after the connect method to verify if
the connection was successful.
Sourcepub async fn scan_n_async<const N: usize>(
    &mut self,
) -> Result<(Vec<AccessPointInfo, N>, usize), WifiError>
 
pub async fn scan_n_async<const N: usize>( &mut self, ) -> Result<(Vec<AccessPointInfo, N>, usize), WifiError>
Async version of crate::wifi::WifiController’s scan_n method
Sourcepub async fn scan_with_config_async<const N: usize>(
    &mut self,
    config: ScanConfig<'_>,
) -> Result<(Vec<AccessPointInfo, N>, usize), WifiError>
 
pub async fn scan_with_config_async<const N: usize>( &mut self, config: ScanConfig<'_>, ) -> Result<(Vec<AccessPointInfo, N>, usize), WifiError>
An async wifi network scan with caller-provided scanning options.
Sourcepub async fn start_async(&mut self) -> Result<(), WifiError>
 
pub async fn start_async(&mut self) -> Result<(), WifiError>
Async version of crate::wifi::WifiController’s start method
Sourcepub async fn stop_async(&mut self) -> Result<(), WifiError>
 
pub async fn stop_async(&mut self) -> Result<(), WifiError>
Async version of crate::wifi::WifiController’s stop method
Sourcepub async fn connect_async(&mut self) -> Result<(), WifiError>
 
pub async fn connect_async(&mut self) -> Result<(), WifiError>
Async version of crate::wifi::WifiController’s connect method
Sourcepub async fn disconnect_async(&mut self) -> Result<(), WifiError>
 
pub async fn disconnect_async(&mut self) -> Result<(), WifiError>
Async version of crate::wifi::WifiController’s Disconnect
method
Sourcepub async fn wait_for_event(&mut self, event: WifiEvent)
 
pub async fn wait_for_event(&mut self, event: WifiEvent)
Wait for one WifiEvent.
Sourcepub async fn wait_for_events(
    &mut self,
    events: EnumSet<WifiEvent>,
    clear_pending: bool,
) -> EnumSet<WifiEvent>
 
pub async fn wait_for_events( &mut self, events: EnumSet<WifiEvent>, clear_pending: bool, ) -> EnumSet<WifiEvent>
Wait for one of multiple WifiEvents. Returns the events that
occurred while waiting.
Sourcepub async fn wait_for_all_events(
    &mut self,
    events: EnumSet<WifiEvent>,
    clear_pending: bool,
)
 
pub async fn wait_for_all_events( &mut self, events: EnumSet<WifiEvent>, clear_pending: bool, )
Wait for multiple WifiEvents.