Skip to main content

Module wifi

Module wifi 

Source
Expand description

WiFi sub-function of the shared radio.

Layered, fully-async surface built on esp-radio:

  • wifi featureWifi: owns the WifiController and exposes on-demand scanning (Wifi::scan). No IP stack, no embassy-net.
  • wifi-sta featureWifi::into_sta: consumes the handle and returns a DHCP/static embassy_net::Stack, a WifiControl command handle, and a WifiRunner you spawn via wifi_task. The runner owns the single controller and manages association (auto-connect + reconnect), so scanning while associated is routed through WifiControl::scan — there is never more than one owner of the controller.

§Mode roadmap

Only station (STA) is wired today. The actor in wifi_task is the single controller owner, so AP mode (wifi-ap) slots in as an into_ap constructor plus a Config::AccessPoint; ESP-NOW / sniffer / CSI are separate esp-radio features layered the same way.

§Variant differences (Fire27 / ESP32 vs CoreS3 / ESP32-S3)

The esp-radio WiFi API is identical on both chips; the differences are RAM:

  • The RX/TX buffer counts in [controller_config] are trimmed on Fire27 (ESP32) where internal SRAM is tighter, and left at the esp-radio defaults on CoreS3 (ESP32-S3).
  • Fire27 cannot DMA out of PSRAM — the application must keep the embassy_net::StackResources and socket buffers in internal RAM. CoreS3 has headroom and may place large app buffers in PSRAM (see crate::mem).
  • With BLE coexistence (coex), budget the extra controller heap (~96 KB reclaimed on ESP32, less on S3).

Structs§

AccessPointInfo
Information about a detected Wi-Fi access point.
StaCredentials
Station credentials for Wifi::into_sta.
Wifi
Low-level WiFi handle: owns the controller and its interfaces.
WifiControl
Cloneable-free command handle for the running station.
WifiRunner
The owned controller + network runner. Hand to wifi_task.

Enums§

AuthenticationMethod
Supported Wi-Fi authentication methods.
IpSetup
How the station obtains its IPv4 configuration.
WifiError
Errors from the WiFi sub-system.

Functions§

wifi_task
Drive the network stack and manage station association.

Type Aliases§

ScanList
Scan results, capped at 16 access points.