radio_esp32::station
The ESP32 blob backend of [hal::wifi::Station].
This is phase 2 of the generalized Wi-Fi plan: the opt-in (“unsafe”) radio
backend, built on Espressif’s binary driver. An application holds a
&mut dyn hal::wifi::Station and this answers it — scan, connect,
disconnect, status — by translating to the blob’s esp_wifi_* calls and
translating its events back.
What works without a supplicant, and what does not
Section titled “What works without a supplicant, and what does not”Associating to an open network needs no key handshake: set the config,
call esp_wifi_connect, and the driver posts STA_CONNECTED. That path is
complete here.
WPA2/WPA3 needs the 4-way handshake, which is not in the blobs — see
[crate::wifi]’s WpaCallbacks, currently discovery-only stubs. Until the
supplicant is wired into that seam, a WPA2 connect associates and then times
out, surfacing honestly as [DisconnectReason::FourWayTimeout]. The config
and the connect are built correctly here regardless; only the handshake is
missing, and it plugs into the existing wpa_funcs table.
The dangerous struct
Section titled “The dangerous struct”[StaConfig] mirrors wifi_sta_config_t, which the blob reads by fixed
offset. As with [crate::wifi::WifiInitConfig], the layout is asserted
field by field against the v4.4 header rather than trusted — a field at the
wrong offset does not fail to compile and does not fault, it silently
configures the radio wrong.
Structs
Section titled “Structs”EspStation
Section titled “EspStation”struct EspStation { /* private fields */ }The ESP32 station. Zero-sized: all its state is the driver’s, reached
through the esp_wifi_* calls, plus the shared statics above.
One exists per system — the radio is a singleton — so this is a handle, not
an owner. bring_up is the normal way to get one; it does
the driver bring-up and hands back the handle only if every step succeeded.
Implements: Station, Clone, Copy
StaConfig
Section titled “StaConfig”struct StaConfig { /* private fields */ }wifi_sta_config_t — the station’s target network.
132 bytes at v4.4. The trailing caps word holds the rm_enabled,
btm_enabled, mbo_enabled bitfield; left zero, which is the default.
Implements: Clone, Copy