pub struct WifiController<'d> { /* private fields */ }
Expand description
A wifi controller
Implementations§
Source§impl WifiController<'_>
impl WifiController<'_>
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 WifiEvent
s. 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 WifiEvent
s.
Source§impl<'d> WifiController<'d>
impl<'d> WifiController<'d>
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 is_sta_enabled(&self) -> Result<bool, WifiError>
pub fn is_sta_enabled(&self) -> Result<bool, WifiError>
Checks if Wi-Fi is enabled as a station.
Sourcepub fn is_ap_enabled(&self) -> Result<bool, WifiError>
pub fn is_ap_enabled(&self) -> Result<bool, WifiError>
Checks if Wi-Fi is enabled as an access p.
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 disconnect(&mut self) -> Result<(), WifiError>
pub fn disconnect(&mut self) -> Result<(), WifiError>
Disconnects the WiFi controller from a network.
Source§impl WifiController<'_>
impl WifiController<'_>
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 configuration(&self) -> Result<Configuration, WifiError>
pub fn configuration(&self) -> Result<Configuration, WifiError>
Get the currently used configuration.
Sourcepub fn set_configuration(
&mut self,
conf: &Configuration,
) -> Result<(), WifiError>
pub fn set_configuration( &mut self, conf: &Configuration, ) -> Result<(), WifiError>
Set the configuration, you need to use Wifi::connect() for connecting to an AP.
This will replace any previously 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 a configured network.
This function should be called after the connect
method to verify if
the connection was successful.