pub struct WifiApConfig {
pub ap_config: AccessPointConfig,
pub channel: u8,
pub secondary_channel: Option<SecondaryChannel>,
pub ap_ipv4: Ipv4Addr,
pub lease_ipv4: Ipv4Addr,
pub lease_count: u8,
pub serve_dhcp: bool,
pub sync_burst: bool,
}Expand description
Configuration for self-contained softAP CSI collector mode.
Wraps esp-radio’s AccessPointConfig (SSID, channel, auth, secondary
channel) and the static IPv4 addressing used by the built-in DHCP server.
The AP hands associating stations addresses from a lease pool in the AP’s /24
subnet with the gateway set to the AP itself.
channel/secondary_channel are duplicated here because esp-radio’s
AccessPointConfig fields are not externally readable; CSINode needs them
for band/HT40 setup.
Fields§
§ap_config: AccessPointConfigUnderlying esp-radio access-point configuration.
channel: u8Primary channel the AP operates on (mirror of ap_config’s channel).
secondary_channel: Option<SecondaryChannel>Optional HT40 secondary channel (mirror of ap_config’s secondary).
ap_ipv4: Ipv4AddrAP’s static IPv4 address; also the gateway and DHCP server identifier.
lease_ipv4: Ipv4AddrFirst IPv4 address in the DHCP lease pool (typically .2).
lease_count: u8Number of consecutive lease addresses starting at Self::lease_ipv4
(e.g. 3 → .2, .3, .4). Default 1 preserves the original
single-client behaviour.
serve_dhcp: boolWhether to run the built-in DHCP server. When false, the AP only starts
- collects CSI (clients must self-assign IPs).
sync_burst: boolWhen true, every flood tick fires one unicast frame back-to-back to
all active leases instead of advancing one lease per tick (round-robin).
All associated stations then receive their downlink PPDU within tens of
microseconds of each other — temporally-synchronized multi-receiver CSI —
instead of being spread across the whole tick interval.
This is the workable path to synchronized multi-receiver CSI. A single group-addressed broadcast frame does not work on an ESP32 softAP: broadcast/multicast is DTIM-buffered, dropped under a high-rate flood, and only ever sent at the legacy basic rate — so it mostly never leaves the radio and never honours a forced high-throughput TX rate. Only unicast transmits immediately and honours the configured TX rate, so N unicast frames per tick keep near-simultaneous arrival across receivers. Stations must be associated — an unassociated receiver does not reliably produce CSI from overheard frames.
Per-receiver rate is the configured ping rate; total offered rate is
rate * lease_count, so lower the rate if airtime saturates. Default
false preserves per-lease round-robin. Set by Self::with_sync_burst.
Implementations§
Source§impl WifiApConfig
impl WifiApConfig
Sourcepub fn new(
ap_config: AccessPointConfig,
channel: u8,
secondary: Option<SecondaryChannel>,
) -> WifiApConfig
pub fn new( ap_config: AccessPointConfig, channel: u8, secondary: Option<SecondaryChannel>, ) -> WifiApConfig
Create a config from an AccessPointConfig, its primary channel, and
optional HT40 secondary channel. Defaults the AP to 192.168.13.1/24,
leases 192.168.13.2, and enables the DHCP server.
Sourcepub fn with_ipv4(self, ap: Ipv4Addr, lease: Ipv4Addr) -> WifiApConfig
pub fn with_ipv4(self, ap: Ipv4Addr, lease: Ipv4Addr) -> WifiApConfig
Override the AP/lease IPv4 addresses (must share a /24).
Sourcepub fn with_lease_pool(self, count: u8) -> WifiApConfig
pub fn with_lease_pool(self, count: u8) -> WifiApConfig
Set the DHCP lease pool size (consecutive addresses from lease_ipv4).
Sourcepub fn lease_ip_at(&self, index: u8) -> Ipv4Addr
pub fn lease_ip_at(&self, index: u8) -> Ipv4Addr
Lease address at index (0 = lease_ipv4, 1 = next host, …).
Sourcepub fn lease_pool(&self) -> Vec<Ipv4Addr, 8>
pub fn lease_pool(&self) -> Vec<Ipv4Addr, 8>
All configured pool addresses (up to Self::lease_count).
Sourcepub fn with_dhcp_server(self, enabled: bool) -> WifiApConfig
pub fn with_dhcp_server(self, enabled: bool) -> WifiApConfig
Enable or disable the built-in DHCP server (default enabled).
Sourcepub fn with_sync_burst(self, enabled: bool) -> WifiApConfig
pub fn with_sync_burst(self, enabled: bool) -> WifiApConfig
Fire one unicast frame back-to-back to every active lease per flood tick, instead of unicasting round-robin (one lease per tick).
All associated stations then receive their downlink PPDU within
microseconds of each other — synchronized multi-receiver CSI without the
round-robin spread. This is the workable substitute for a single broadcast
PPDU, which an ESP32 softAP can’t reliably deliver (see Self::sync_burst).
Keep the DHCP server / lease pool enabled so stations associate as genuine
BSS members; only the per-tick transmit pattern changes.
Sourcepub fn secondary_channel(&self) -> Option<SecondaryChannel>
pub fn secondary_channel(&self) -> Option<SecondaryChannel>
Configured HT40 secondary channel, or None for HT20.