ControllerConfig

Struct ControllerConfig 

Source
#[non_exhaustive]
pub struct ControllerConfig { /* private fields */ }
Available on crate feature wifi only.
Expand description

Wi-Fi configuration.

Implementations§

Source§

impl ControllerConfig

Source

pub fn with_country_info(self, country_info: impl Into<CountryInfo>) -> Self

Available on crate feature unstable only.

Assign the given value to the country_info field.

Source

pub fn country_info(&self) -> CountryInfo

Available on crate feature unstable only.

Country info.

Source

pub fn with_rx_queue_size(self, rx_queue_size: usize) -> Self

Available on crate feature unstable only.

Assign the given value to the rx_queue_size field.

Source

pub fn rx_queue_size(&self) -> usize

Available on crate feature unstable only.

Size of the RX queue in frames.

Source

pub fn with_tx_queue_size(self, tx_queue_size: usize) -> Self

Available on crate feature unstable only.

Assign the given value to the tx_queue_size field.

Source

pub fn tx_queue_size(&self) -> usize

Available on crate feature unstable only.

Size of the TX queue in frames.

Source

pub fn with_static_rx_buf_num(self, static_rx_buf_num: u8) -> Self

Available on crate feature unstable only.

Assign the given value to the static_rx_buf_num field.

Source

pub fn static_rx_buf_num(&self) -> u8

Available on crate feature unstable only.

Max number of Wi-Fi static RX buffers.

Each buffer takes approximately 1.6KB of RAM. The static rx buffers are allocated when esp_wifi_init is called, they are not freed until esp_wifi_deinit is called.

Wi-Fi hardware use these buffers to receive all 802.11 frames. A higher number may allow higher throughput but increases memory use. If Self::ampdu_rx_enable is enabled, this value is recommended to set equal or bigger than Self::rx_ba_win in order to achieve better throughput and compatibility with both stations and APs.

Source

pub fn with_dynamic_rx_buf_num(self, dynamic_rx_buf_num: u16) -> Self

Available on crate feature unstable only.

Assign the given value to the dynamic_rx_buf_num field.

Source

pub fn dynamic_rx_buf_num(&self) -> u16

Available on crate feature unstable only.

Max number of Wi-Fi dynamic RX buffers

Set the number of Wi-Fi dynamic RX buffers, 0 means unlimited RX buffers will be allocated (provided sufficient free RAM). The size of each dynamic RX buffer depends on the size of the received data frame.

For each received data frame, the Wi-Fi driver makes a copy to an RX buffer and then delivers it to the high layer TCP/IP stack. The dynamic RX buffer is freed after the higher layer has successfully received the data frame.

For some applications, Wi-Fi data frames may be received faster than the application can process them. In these cases we may run out of memory if RX buffer number is unlimited (0).

If a dynamic RX buffer limit is set, it should be at least the number of static RX buffers.

Source

pub fn with_static_tx_buf_num(self, static_tx_buf_num: u8) -> Self

Available on crate feature unstable only.

Assign the given value to the static_tx_buf_num field.

Source

pub fn static_tx_buf_num(&self) -> u8

Available on crate feature unstable only.

Set the number of Wi-Fi static TX buffers.

Each buffer takes approximately 1.6KB of RAM. The static RX buffers are allocated when esp_wifi_init() is called, they are not released until esp_wifi_deinit() is called.

For each transmitted data frame from the higher layer TCP/IP stack, the Wi-Fi driver makes a copy of it in a TX buffer.

For some applications especially UDP applications, the upper layer can deliver frames faster than Wi-Fi layer can transmit. In these cases, we may run out of TX buffers.

Source

pub fn with_dynamic_tx_buf_num(self, dynamic_tx_buf_num: u16) -> Self

Available on crate feature unstable only.

Assign the given value to the dynamic_tx_buf_num field.

Source

pub fn dynamic_tx_buf_num(&self) -> u16

Available on crate feature unstable only.

Set the number of Wi-Fi dynamic TX buffers.

The size of each dynamic TX buffer is not fixed, it depends on the size of each transmitted data frame.

For each transmitted frame from the higher layer TCP/IP stack, the Wi-Fi driver makes a copy of it in a TX buffer.

For some applications, especially UDP applications, the upper layer can deliver frames faster than Wi-Fi layer can transmit. In these cases, we may run out of TX buffers.

Source

pub fn with_ampdu_rx_enable(self, ampdu_rx_enable: bool) -> Self

Available on crate feature unstable only.

Assign the given value to the ampdu_rx_enable field.

Source

pub fn ampdu_rx_enable(&self) -> bool

Available on crate feature unstable only.

Select this option to enable AMPDU RX feature.

Source

pub fn with_ampdu_tx_enable(self, ampdu_tx_enable: bool) -> Self

Available on crate feature unstable only.

Assign the given value to the ampdu_tx_enable field.

Source

pub fn ampdu_tx_enable(&self) -> bool

Available on crate feature unstable only.

Select this option to enable AMPDU TX feature.

Source

pub fn with_amsdu_tx_enable(self, amsdu_tx_enable: bool) -> Self

Available on crate feature unstable only.

Assign the given value to the amsdu_tx_enable field.

Source

pub fn amsdu_tx_enable(&self) -> bool

Available on crate feature unstable only.

Select this option to enable AMSDU TX feature.

Source

pub fn with_rx_ba_win(self, rx_ba_win: u8) -> Self

Available on crate feature unstable only.

Assign the given value to the rx_ba_win field.

Source

pub fn rx_ba_win(&self) -> u8

Available on crate feature unstable only.

Set the size of Wi-Fi Block Ack RX window.

Generally a bigger value means higher throughput and better compatibility but more memory. Most of time we should NOT change the default value unless special reason, e.g. test the maximum UDP RX throughput with iperf etc. For iperf test in shieldbox, the recommended value is 9~12.

If PSRAM is used and Wi-Fi memory is preferred to allocate in PSRAM first, the default and minimum value should be 16 to achieve better throughput and compatibility with both stations and APs.

Source

pub fn with_initial_config(self, initial_config: Config) -> Self

Assign the given value to the initial_config field.

Source

pub fn initial_config(&self) -> &Config

Initial Wi-Fi configuration.

Trait Implementations§

Source§

impl Clone for ControllerConfig

Source§

fn clone(&self) -> ControllerConfig

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ControllerConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ControllerConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Format for ControllerConfig

Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.
Source§

impl Hash for ControllerConfig

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
Source§

impl PartialEq for ControllerConfig

Source§

fn eq(&self, other: &ControllerConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for ControllerConfig

Source§

impl StructuralPartialEq for ControllerConfig

Auto Trait Implementations§

§

impl Freeze for ControllerConfig

§

impl RefUnwindSafe for ControllerConfig

§

impl Send for ControllerConfig

§

impl Sync for ControllerConfig

§

impl Unpin for ControllerConfig

§

impl UnwindSafe for ControllerConfig

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.