pub struct Config { /* private fields */ }Expand description
Wi-Fi configuration.
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_power_save_mode(self, power_save_mode: PowerSaveMode) -> Self
pub fn with_power_save_mode(self, power_save_mode: PowerSaveMode) -> Self
Assign the given value to the power_save_mode field.
Sourcepub fn power_save_mode(&self) -> PowerSaveMode
pub fn power_save_mode(&self) -> PowerSaveMode
Power save mode.
Sourcepub fn with_country_code(self, country_code: impl Into<CountryInfo>) -> Self
Available on crate feature unstable only.
pub fn with_country_code(self, country_code: impl Into<CountryInfo>) -> Self
unstable only.Assign the given value to the country_code field.
Sourcepub fn country_code(&self) -> CountryInfo
Available on crate feature unstable only.
pub fn country_code(&self) -> CountryInfo
unstable only.Country code.
Sourcepub fn with_rx_queue_size(self, rx_queue_size: usize) -> Self
Available on crate feature unstable only.
pub fn with_rx_queue_size(self, rx_queue_size: usize) -> Self
unstable only.Assign the given value to the rx_queue_size field.
Sourcepub fn rx_queue_size(&self) -> usize
Available on crate feature unstable only.
pub fn rx_queue_size(&self) -> usize
unstable only.Size of the RX queue in frames.
Sourcepub fn with_tx_queue_size(self, tx_queue_size: usize) -> Self
Available on crate feature unstable only.
pub fn with_tx_queue_size(self, tx_queue_size: usize) -> Self
unstable only.Assign the given value to the tx_queue_size field.
Sourcepub fn tx_queue_size(&self) -> usize
Available on crate feature unstable only.
pub fn tx_queue_size(&self) -> usize
unstable only.Size of the TX queue in frames.
Sourcepub fn with_static_rx_buf_num(self, static_rx_buf_num: u8) -> Self
Available on crate feature unstable only.
pub fn with_static_rx_buf_num(self, static_rx_buf_num: u8) -> Self
unstable only.Assign the given value to the static_rx_buf_num field.
Sourcepub fn static_rx_buf_num(&self) -> u8
Available on crate feature unstable only.
pub fn static_rx_buf_num(&self) -> u8
unstable only.Max number of WiFi 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.
WiFi 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.
Sourcepub fn with_dynamic_rx_buf_num(self, dynamic_rx_buf_num: u16) -> Self
Available on crate feature unstable only.
pub fn with_dynamic_rx_buf_num(self, dynamic_rx_buf_num: u16) -> Self
unstable only.Assign the given value to the dynamic_rx_buf_num field.
Sourcepub fn dynamic_rx_buf_num(&self) -> u16
Available on crate feature unstable only.
pub fn dynamic_rx_buf_num(&self) -> u16
unstable only.Max number of WiFi dynamic RX buffers
Set the number of WiFi 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 WiFi 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, WiFi 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.
Sourcepub fn with_static_tx_buf_num(self, static_tx_buf_num: u8) -> Self
Available on crate feature unstable only.
pub fn with_static_tx_buf_num(self, static_tx_buf_num: u8) -> Self
unstable only.Assign the given value to the static_tx_buf_num field.
Sourcepub fn static_tx_buf_num(&self) -> u8
Available on crate feature unstable only.
pub fn static_tx_buf_num(&self) -> u8
unstable only.Set the number of WiFi 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 WiFi driver makes a copy of it in a TX buffer.
For some applications especially UDP applications, the upper layer can deliver frames faster than WiFi layer can transmit. In these cases, we may run out of TX buffers.
Sourcepub fn with_dynamic_tx_buf_num(self, dynamic_tx_buf_num: u16) -> Self
Available on crate feature unstable only.
pub fn with_dynamic_tx_buf_num(self, dynamic_tx_buf_num: u16) -> Self
unstable only.Assign the given value to the dynamic_tx_buf_num field.
Sourcepub fn dynamic_tx_buf_num(&self) -> u16
Available on crate feature unstable only.
pub fn dynamic_tx_buf_num(&self) -> u16
unstable only.Set the number of WiFi 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 WiFi driver makes a copy of it in a TX buffer.
For some applications, especially UDP applications, the upper layer can deliver frames faster than WiFi layer can transmit. In these cases, we may run out of TX buffers.
Sourcepub fn with_ampdu_rx_enable(self, ampdu_rx_enable: bool) -> Self
Available on crate feature unstable only.
pub fn with_ampdu_rx_enable(self, ampdu_rx_enable: bool) -> Self
unstable only.Assign the given value to the ampdu_rx_enable field.
Sourcepub fn ampdu_rx_enable(&self) -> bool
Available on crate feature unstable only.
pub fn ampdu_rx_enable(&self) -> bool
unstable only.Select this option to enable AMPDU RX feature.
Sourcepub fn with_ampdu_tx_enable(self, ampdu_tx_enable: bool) -> Self
Available on crate feature unstable only.
pub fn with_ampdu_tx_enable(self, ampdu_tx_enable: bool) -> Self
unstable only.Assign the given value to the ampdu_tx_enable field.
Sourcepub fn ampdu_tx_enable(&self) -> bool
Available on crate feature unstable only.
pub fn ampdu_tx_enable(&self) -> bool
unstable only.Select this option to enable AMPDU TX feature.
Sourcepub fn with_amsdu_tx_enable(self, amsdu_tx_enable: bool) -> Self
Available on crate feature unstable only.
pub fn with_amsdu_tx_enable(self, amsdu_tx_enable: bool) -> Self
unstable only.Assign the given value to the amsdu_tx_enable field.
Sourcepub fn amsdu_tx_enable(&self) -> bool
Available on crate feature unstable only.
pub fn amsdu_tx_enable(&self) -> bool
unstable only.Select this option to enable AMSDU TX feature.
Sourcepub fn with_rx_ba_win(self, rx_ba_win: u8) -> Self
Available on crate feature unstable only.
pub fn with_rx_ba_win(self, rx_ba_win: u8) -> Self
unstable only.Assign the given value to the rx_ba_win field.
Sourcepub fn rx_ba_win(&self) -> u8
Available on crate feature unstable only.
pub fn rx_ba_win(&self) -> u8
unstable only.Set the size of WiFi 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 WiFi 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.
Trait Implementations§
impl Copy for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)