Skip to main content

WifiApConfig

Struct WifiApConfig 

Source
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: AccessPointConfig

Underlying esp-radio access-point configuration.

§channel: u8

Primary 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: Ipv4Addr

AP’s static IPv4 address; also the gateway and DHCP server identifier.

§lease_ipv4: Ipv4Addr

First IPv4 address in the DHCP lease pool (typically .2).

§lease_count: u8

Number 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: bool

Whether to run the built-in DHCP server. When false, the AP only starts

  • collects CSI (clients must self-assign IPs).
§sync_burst: bool

When 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

Source

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.

Source

pub fn with_ipv4(self, ap: Ipv4Addr, lease: Ipv4Addr) -> WifiApConfig

Override the AP/lease IPv4 addresses (must share a /24).

Source

pub fn with_lease_pool(self, count: u8) -> WifiApConfig

Set the DHCP lease pool size (consecutive addresses from lease_ipv4).

Source

pub fn lease_ip_at(&self, index: u8) -> Ipv4Addr

Lease address at index (0 = lease_ipv4, 1 = next host, …).

Source

pub fn lease_pool(&self) -> Vec<Ipv4Addr, 8>

All configured pool addresses (up to Self::lease_count).

Source

pub fn with_dhcp_server(self, enabled: bool) -> WifiApConfig

Enable or disable the built-in DHCP server (default enabled).

Source

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.

Source

pub fn channel(&self) -> u8

Configured primary channel.

Source

pub fn secondary_channel(&self) -> Option<SecondaryChannel>

Configured HT40 secondary channel, or None for HT20.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.