Skip to main content

esp_wifi_set_bandwidth

Function esp_wifi_set_bandwidth 

Source
pub unsafe extern "C" fn esp_wifi_set_bandwidth(
    ifx: wifi_interface_t,
    bw: wifi_bandwidth_t,
) -> esp_err_t
Expand description

@brief Set the bandwidth of specified interface

@attention 1. WIFI_BW_HT40 is supported only when the interface support 11N @attention 2. When the interface supports 11AX/11AC, it only supports setting WIFI_BW_HT20. @attention 3. Can not set WiFi bandwidth under band mode 2.4G + 5G (WIFI_BAND_MODE_AUTO), you can use esp_wifi_set_bandwidths instead @attention 4. API return ESP_ERR_NOT_SUPPORTED if the band mode is set to 2.4G + 5G (WIFI_BAND_MODE_AUTO)

@param ifx interface to be configured @param bw bandwidth

@return

  • ESP_OK: succeed
  • ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
  • ESP_ERR_WIFI_IF: invalid interface
  • ESP_ERR_INVALID_ARG: invalid argument
  • ESP_ERR_NOT_SUPPORTED: This API is not supported when the band mode is set to 2.4G + 5G (WIFI_BAND_MODE_AUTO)
  • others: refer to error codes in esp_err.h