mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-02 16:11:41 +01:00
esp_wifi: Merge wpa_supplicant and esp_wifi Kconfig
This commit is contained in:
committed by
Jiang Jiang Jian
parent
db59ab5000
commit
30a2558450
@@ -7,7 +7,7 @@
|
||||
|
||||
/* Notes about WiFi Programming
|
||||
*
|
||||
* The esp32 WiFi programming model can be depicted as following picture:
|
||||
* WiFi programming model can be depicted as following picture:
|
||||
*
|
||||
*
|
||||
* default handler user handler
|
||||
@@ -113,49 +113,49 @@ typedef struct {
|
||||
int magic; /**< WiFi init magic number, it should be the last field */
|
||||
} wifi_init_config_t;
|
||||
|
||||
#ifdef CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM
|
||||
#define WIFI_STATIC_TX_BUFFER_NUM CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM
|
||||
#ifdef CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM
|
||||
#define WIFI_STATIC_TX_BUFFER_NUM CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM
|
||||
#else
|
||||
#define WIFI_STATIC_TX_BUFFER_NUM 0
|
||||
#endif
|
||||
|
||||
#if CONFIG_SPIRAM
|
||||
#define WIFI_CACHE_TX_BUFFER_NUM CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM
|
||||
#define WIFI_CACHE_TX_BUFFER_NUM CONFIG_ESP_WIFI_CACHE_TX_BUFFER_NUM
|
||||
#else
|
||||
#define WIFI_CACHE_TX_BUFFER_NUM 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM
|
||||
#define WIFI_DYNAMIC_TX_BUFFER_NUM CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM
|
||||
#ifdef CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM
|
||||
#define WIFI_DYNAMIC_TX_BUFFER_NUM CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM
|
||||
#else
|
||||
#define WIFI_DYNAMIC_TX_BUFFER_NUM 0
|
||||
#endif
|
||||
|
||||
#if CONFIG_ESP32_WIFI_CSI_ENABLED
|
||||
#if CONFIG_ESP_WIFI_CSI_ENABLED
|
||||
#define WIFI_CSI_ENABLED 1
|
||||
#else
|
||||
#define WIFI_CSI_ENABLED 0
|
||||
#endif
|
||||
|
||||
#if CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED
|
||||
#if CONFIG_ESP_WIFI_AMPDU_RX_ENABLED
|
||||
#define WIFI_AMPDU_RX_ENABLED 1
|
||||
#else
|
||||
#define WIFI_AMPDU_RX_ENABLED 0
|
||||
#endif
|
||||
|
||||
#if CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED
|
||||
#if CONFIG_ESP_WIFI_AMPDU_TX_ENABLED
|
||||
#define WIFI_AMPDU_TX_ENABLED 1
|
||||
#else
|
||||
#define WIFI_AMPDU_TX_ENABLED 0
|
||||
#endif
|
||||
|
||||
#if CONFIG_ESP32_WIFI_AMSDU_TX_ENABLED
|
||||
#if CONFIG_ESP_WIFI_AMSDU_TX_ENABLED
|
||||
#define WIFI_AMSDU_TX_ENABLED 1
|
||||
#else
|
||||
#define WIFI_AMSDU_TX_ENABLED 0
|
||||
#endif
|
||||
|
||||
#if CONFIG_ESP32_WIFI_NVS_ENABLED
|
||||
#if CONFIG_ESP_WIFI_NVS_ENABLED
|
||||
#define WIFI_NVS_ENABLED 1
|
||||
#else
|
||||
#define WIFI_NVS_ENABLED 0
|
||||
@@ -172,26 +172,26 @@ extern uint64_t g_wifi_feature_caps;
|
||||
|
||||
#define WIFI_INIT_CONFIG_MAGIC 0x1F2F3F4F
|
||||
|
||||
#ifdef CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED
|
||||
#define WIFI_DEFAULT_RX_BA_WIN CONFIG_ESP32_WIFI_RX_BA_WIN
|
||||
#ifdef CONFIG_ESP_WIFI_AMPDU_RX_ENABLED
|
||||
#define WIFI_DEFAULT_RX_BA_WIN CONFIG_ESP_WIFI_RX_BA_WIN
|
||||
#else
|
||||
#define WIFI_DEFAULT_RX_BA_WIN 0 /* unused if ampdu_rx_enable == false */
|
||||
#endif
|
||||
|
||||
#if CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1
|
||||
#if CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_1
|
||||
#define WIFI_TASK_CORE_ID 1
|
||||
#else
|
||||
#define WIFI_TASK_CORE_ID 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN
|
||||
#define WIFI_SOFTAP_BEACON_MAX_LEN CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN
|
||||
#ifdef CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN
|
||||
#define WIFI_SOFTAP_BEACON_MAX_LEN CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN
|
||||
#else
|
||||
#define WIFI_SOFTAP_BEACON_MAX_LEN 752
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP32_WIFI_MGMT_SBUF_NUM
|
||||
#define WIFI_MGMT_SBUF_NUM CONFIG_ESP32_WIFI_MGMT_SBUF_NUM
|
||||
#ifdef CONFIG_ESP_WIFI_MGMT_SBUF_NUM
|
||||
#define WIFI_MGMT_SBUF_NUM CONFIG_ESP_WIFI_MGMT_SBUF_NUM
|
||||
#else
|
||||
#define WIFI_MGMT_SBUF_NUM 32
|
||||
#endif
|
||||
@@ -210,9 +210,9 @@ extern uint64_t g_wifi_feature_caps;
|
||||
#define WIFI_INIT_CONFIG_DEFAULT() { \
|
||||
.osi_funcs = &g_wifi_osi_funcs, \
|
||||
.wpa_crypto_funcs = g_wifi_default_wpa_crypto_funcs, \
|
||||
.static_rx_buf_num = CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM,\
|
||||
.dynamic_rx_buf_num = CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM,\
|
||||
.tx_buf_type = CONFIG_ESP32_WIFI_TX_BUFFER_TYPE,\
|
||||
.static_rx_buf_num = CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM,\
|
||||
.dynamic_rx_buf_num = CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM,\
|
||||
.tx_buf_type = CONFIG_ESP_WIFI_TX_BUFFER_TYPE,\
|
||||
.static_tx_buf_num = WIFI_STATIC_TX_BUFFER_NUM,\
|
||||
.dynamic_tx_buf_num = WIFI_DYNAMIC_TX_BUFFER_NUM,\
|
||||
.cache_tx_buf_num = WIFI_CACHE_TX_BUFFER_NUM,\
|
||||
@@ -337,15 +337,15 @@ esp_err_t esp_wifi_stop(void);
|
||||
esp_err_t esp_wifi_restore(void);
|
||||
|
||||
/**
|
||||
* @brief Connect the ESP32 WiFi station to the AP.
|
||||
* @brief Connect WiFi station to the AP.
|
||||
*
|
||||
* @attention 1. This API only impact WIFI_MODE_STA or WIFI_MODE_APSTA mode
|
||||
* @attention 2. If the ESP32 is connected to an AP, call esp_wifi_disconnect to disconnect.
|
||||
* @attention 3. The scanning triggered by esp_wifi_scan_start() will not be effective until connection between ESP32 and the AP is established.
|
||||
* If ESP32 is scanning and connecting at the same time, ESP32 will abort scanning and return a warning message and error
|
||||
* @attention 2. If station interface is connected to an AP, call esp_wifi_disconnect to disconnect.
|
||||
* @attention 3. The scanning triggered by esp_wifi_scan_start() will not be effective until connection between device and the AP is established.
|
||||
* If device is scanning and connecting at the same time, it will abort scanning and return a warning message and error
|
||||
* number ESP_ERR_WIFI_STATE.
|
||||
* If you want to do reconnection after ESP32 received disconnect event, remember to add the maximum retry time, otherwise the called
|
||||
* scan will not work. This is especially true when the AP doesn't exist, and you still try reconnection after ESP32 received disconnect
|
||||
* If you want to do reconnection after device received disconnect event, remember to add the maximum retry time, otherwise the called
|
||||
* scan will not work. This is especially true when the AP doesn't exist, and you still try reconnection after device received disconnect
|
||||
* event with the reason code WIFI_REASON_NO_AP_FOUND.
|
||||
*
|
||||
* @return
|
||||
@@ -358,7 +358,7 @@ esp_err_t esp_wifi_restore(void);
|
||||
esp_err_t esp_wifi_connect(void);
|
||||
|
||||
/**
|
||||
* @brief Disconnect the ESP32 WiFi station from the AP.
|
||||
* @brief Disconnect WiFi station from the AP.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: succeed
|
||||
@@ -473,7 +473,7 @@ esp_err_t esp_wifi_clear_ap_list(void);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get information of AP which the ESP32 station is associated with
|
||||
* @brief Get information of AP to which the device is associated with
|
||||
*
|
||||
* @attention When the obtained country information is empty, it means that the AP does not carry country information
|
||||
*
|
||||
@@ -545,7 +545,7 @@ esp_err_t esp_wifi_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap);
|
||||
esp_err_t esp_wifi_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap);
|
||||
|
||||
/**
|
||||
* @brief Set the bandwidth of ESP32 specified interface
|
||||
* @brief Set the bandwidth of specified interface
|
||||
*
|
||||
* @attention 1. API return false if try to configure an interface that is not enabled
|
||||
* @attention 2. WIFI_BW_HT40 is supported only when the interface support 11N
|
||||
@@ -563,7 +563,7 @@ esp_err_t esp_wifi_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap);
|
||||
esp_err_t esp_wifi_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw);
|
||||
|
||||
/**
|
||||
* @brief Get the bandwidth of ESP32 specified interface
|
||||
* @brief Get the bandwidth of specified interface
|
||||
*
|
||||
* @attention 1. API return false if try to get a interface that is not enable
|
||||
*
|
||||
@@ -579,12 +579,12 @@ esp_err_t esp_wifi_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw);
|
||||
esp_err_t esp_wifi_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw);
|
||||
|
||||
/**
|
||||
* @brief Set primary/secondary channel of ESP32
|
||||
* @brief Set primary/secondary channel of device
|
||||
*
|
||||
* @attention 1. This API should be called after esp_wifi_start()
|
||||
* @attention 2. When ESP32 is in STA mode, this API should not be called when STA is scanning or connecting to an external AP
|
||||
* @attention 3. When ESP32 is in softAP mode, this API should not be called when softAP has connected to external STAs
|
||||
* @attention 4. When ESP32 is in STA+softAP mode, this API should not be called when in the scenarios described above
|
||||
* @attention 2. When device is in STA mode, this API should not be called when STA is scanning or connecting to an external AP
|
||||
* @attention 3. When device is in softAP mode, this API should not be called when softAP has connected to external STAs
|
||||
* @attention 4. When device is in STA+softAP mode, this API should not be called when in the scenarios described above
|
||||
* @attention 5. The channel info set by this API will not be stored in NVS. So If you want to remeber the channel used before wifi stop,
|
||||
* you need to call this API again after wifi start, or you can call `esp_wifi_set_config()` to store the channel info in NVS.
|
||||
*
|
||||
@@ -600,7 +600,7 @@ esp_err_t esp_wifi_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw);
|
||||
esp_err_t esp_wifi_set_channel(uint8_t primary, wifi_second_chan_t second);
|
||||
|
||||
/**
|
||||
* @brief Get the primary/secondary channel of ESP32
|
||||
* @brief Get the primary/secondary channel of device
|
||||
*
|
||||
* @attention 1. API return false if try to get a interface that is not enable
|
||||
*
|
||||
@@ -658,11 +658,11 @@ esp_err_t esp_wifi_get_country(wifi_country_t *country);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Set MAC address of the ESP32 WiFi station or the soft-AP interface.
|
||||
* @brief Set MAC address of WiFi station or the soft-AP interface.
|
||||
*
|
||||
* @attention 1. This API can only be called when the interface is disabled
|
||||
* @attention 2. ESP32 soft-AP and station have different MAC addresses, do not set them to be the same.
|
||||
* @attention 3. The bit 0 of the first byte of ESP32 MAC address can not be 1. For example, the MAC address
|
||||
* @attention 2. Soft-AP and station have different MAC addresses, do not set them to be the same.
|
||||
* @attention 3. The bit 0 of the first byte of MAC address can not be 1. For example, the MAC address
|
||||
* can set to be "1a:XX:XX:XX:XX:XX", but can not be "15:XX:XX:XX:XX:XX".
|
||||
*
|
||||
* @param ifx interface
|
||||
@@ -790,12 +790,12 @@ esp_err_t esp_wifi_set_promiscuous_ctrl_filter(const wifi_promiscuous_filter_t *
|
||||
esp_err_t esp_wifi_get_promiscuous_ctrl_filter(wifi_promiscuous_filter_t *filter);
|
||||
|
||||
/**
|
||||
* @brief Set the configuration of the ESP32 STA or AP
|
||||
* @brief Set the configuration of the STA or AP
|
||||
*
|
||||
* @attention 1. This API can be called only when specified interface is enabled, otherwise, API fail
|
||||
* @attention 2. For station configuration, bssid_set needs to be 0; and it needs to be 1 only when users need to check the MAC address of the AP.
|
||||
* @attention 3. ESP32 is limited to only one channel, so when in the soft-AP+station mode, the soft-AP will adjust its channel automatically to be the same as
|
||||
* the channel of the ESP32 station.
|
||||
* @attention 3. ESP devices are limited to only one channel, so when in the soft-AP+station mode, the soft-AP will adjust its channel automatically to be the same as
|
||||
* the channel of the station.
|
||||
* @attention 4. The configuration will be stored in NVS
|
||||
*
|
||||
* @param interface interface
|
||||
@@ -1121,7 +1121,7 @@ esp_err_t esp_wifi_get_ant(wifi_ant_config_t *config);
|
||||
int64_t esp_wifi_get_tsf_time(wifi_interface_t interface);
|
||||
|
||||
/**
|
||||
* @brief Set the inactive time of the ESP32 STA or AP
|
||||
* @brief Set the inactive time of the STA or AP
|
||||
*
|
||||
* @attention 1. For Station, If the station does not receive a beacon frame from the connected SoftAP during the inactive time,
|
||||
* disconnect from SoftAP. Default 6s.
|
||||
|
||||
Reference in New Issue
Block a user