Skip to main content

WifiControl

Trait WifiControl 

Source
pub trait WifiControl {
    // Required methods
    fn connect(&mut self, ssid: &str, password: &str) -> Result<(), NetError>;
    fn disconnect(&mut self) -> Result<(), NetError>;
    fn start_ap_open(
        &mut self,
        ssid: &[u8],
        channel: u8,
    ) -> Result<(), NetError>;
    fn set_rx_wake(&mut self, wake: fn());
    fn link_policy(&self) -> Option<WifiLinkPolicy>;
}
Expand description

Optional control plane for a wireless Interface.

Bundles the wireless-specific capabilities (STA connect, SoftAP start, MAC, out-of-band RX wake, link policy) onto the same object that carries the data plane. A chip driver implements this on its Interface device so wireless devices need no bespoke lifecycle trait or registration path.

Required Methods§

Source

fn connect(&mut self, ssid: &str, password: &str) -> Result<(), NetError>

Connect to a network in STA mode (scan + associate + authenticate).

Source

fn disconnect(&mut self) -> Result<(), NetError>

Disconnect from the current STA network.

Source

fn start_ap_open(&mut self, ssid: &[u8], channel: u8) -> Result<(), NetError>

Start an open (unencrypted) SoftAP broadcasting ssid on channel.

Source

fn set_rx_wake(&mut self, wake: fn())

Register a wake callback for out-of-band RX.

SDIO Wi-Fi delivers RX outside the ethernet IRQ framework, so the driver calls this wake when a data frame has been enqueued, to nudge the stack’s per-device poll task.

The link policy this device wants applied once the stack is up. None means “no special policy” (e.g. a STA that will use DHCP like any NIC).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§