forked from espressif/arduino-esp32
Update IDF, tools and toolchains
This commit is contained in:
@ -119,15 +119,6 @@ esp_err_t esp_wifi_init_internal(const wifi_init_config_t *config);
|
||||
*/
|
||||
esp_err_t esp_wifi_deinit_internal(void);
|
||||
|
||||
/**
|
||||
* @brief get whether the wifi driver is allowed to transmit data or not
|
||||
*
|
||||
* @return
|
||||
* - true : upper layer should stop to transmit data to wifi driver
|
||||
* - false : upper layer can transmit data to wifi driver
|
||||
*/
|
||||
bool esp_wifi_internal_tx_is_stop(void);
|
||||
|
||||
/**
|
||||
* @brief free the rx buffer which allocated by wifi driver
|
||||
*
|
||||
@ -138,18 +129,79 @@ void esp_wifi_internal_free_rx_buffer(void* buffer);
|
||||
/**
|
||||
* @brief transmit the buffer via wifi driver
|
||||
*
|
||||
* This API makes a copy of the input buffer and then forwards the buffer
|
||||
* copy to WiFi driver.
|
||||
*
|
||||
* @param wifi_interface_t wifi_if : wifi interface id
|
||||
* @param void *buffer : the buffer to be tansmit
|
||||
* @param uint16_t len : the length of buffer
|
||||
*
|
||||
* @return
|
||||
* - ERR_OK : Successfully transmit the buffer to wifi driver
|
||||
* - ERR_MEM : Out of memory
|
||||
* - ERR_IF : WiFi driver error
|
||||
* - ERR_ARG : Invalid argument
|
||||
* - ESP_OK : Successfully transmit the buffer to wifi driver
|
||||
* - ESP_ERR_NO_MEM: out of memory
|
||||
* - ESP_ERR_WIFI_ARG: invalid argument
|
||||
* - ESP_ERR_WIFI_IF : WiFi interface is invalid
|
||||
* - ESP_ERR_WIFI_CONN : WiFi interface is not created, e.g. send the data to STA while WiFi mode is AP mode
|
||||
* - ESP_ERR_WIFI_NOT_STARTED : WiFi is not started
|
||||
* - ESP_ERR_WIFI_STATE : WiFi internal state is not ready, e.g. WiFi is not started
|
||||
* - ESP_ERR_WIFI_NOT_ASSOC : WiFi is not associated
|
||||
* - ESP_ERR_WIFI_TX_DISALLOW : WiFi TX is disallowed, e.g. WiFi hasn't pass the authentication
|
||||
* - ESP_ERR_WIFI_POST : caller fails to post event to WiFi task
|
||||
*/
|
||||
int esp_wifi_internal_tx(wifi_interface_t wifi_if, void *buffer, uint16_t len);
|
||||
|
||||
/**
|
||||
* @brief The net stack buffer reference counter callback function
|
||||
*
|
||||
*/
|
||||
typedef void (*wifi_netstack_buf_ref_cb_t)(void *netstack_buf);
|
||||
|
||||
/**
|
||||
* @brief The net stack buffer free callback function
|
||||
*
|
||||
*/
|
||||
typedef void (*wifi_netstack_buf_free_cb_t)(void *netstack_buf);
|
||||
|
||||
/**
|
||||
* @brief transmit the buffer by reference via wifi driver
|
||||
*
|
||||
* This API firstly increases the reference counter of the input buffer and
|
||||
* then forwards the buffer to WiFi driver. The WiFi driver will free the buffer
|
||||
* after processing it. Use esp_wifi_internal_tx() if the uplayer buffer doesn't
|
||||
* supports reference counter.
|
||||
*
|
||||
* @param wifi_if : wifi interface id
|
||||
* @param buffer : the buffer to be tansmit
|
||||
* @param len : the length of buffer
|
||||
* @param netstack_buf : the netstack buffer related to bufffer
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK : Successfully transmit the buffer to wifi driver
|
||||
* - ESP_ERR_NO_MEM: out of memory
|
||||
* - ESP_ERR_WIFI_ARG: invalid argument
|
||||
* - ESP_ERR_WIFI_IF : WiFi interface is invalid
|
||||
* - ESP_ERR_WIFI_CONN : WiFi interface is not created, e.g. send the data to STA while WiFi mode is AP mode
|
||||
* - ESP_ERR_WIFI_NOT_STARTED : WiFi is not started
|
||||
* - ESP_ERR_WIFI_STATE : WiFi internal state is not ready, e.g. WiFi is not started
|
||||
* - ESP_ERR_WIFI_NOT_ASSOC : WiFi is not associated
|
||||
* - ESP_ERR_WIFI_TX_DISALLOW : WiFi TX is disallowed, e.g. WiFi hasn't pass the authentication
|
||||
* - ESP_ERR_WIFI_POST : caller fails to post event to WiFi task
|
||||
*/
|
||||
esp_err_t esp_wifi_internal_tx_by_ref(wifi_interface_t ifx, void *buffer, size_t len, void *netstack_buf);
|
||||
|
||||
/**
|
||||
* @brief register the net stack buffer reference increasing and free callback
|
||||
*
|
||||
* @param ref : net stack buffer reference callback
|
||||
* @param free: net stack buffer free callback
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK : Successfully transmit the buffer to wifi driver
|
||||
* - others : failed to register the callback
|
||||
*/
|
||||
esp_err_t esp_wifi_internal_reg_netstack_buf_cb(wifi_netstack_buf_ref_cb_t ref, wifi_netstack_buf_free_cb_t free);
|
||||
|
||||
|
||||
/**
|
||||
* @brief The WiFi RX callback function
|
||||
*
|
||||
|
@ -21,7 +21,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define ESP_WIFI_OS_ADAPTER_VERSION 0x00000006
|
||||
#define ESP_WIFI_OS_ADAPTER_VERSION 0x00000007
|
||||
#define ESP_WIFI_OS_ADAPTER_MAGIC 0xDEADBEAF
|
||||
|
||||
#define OSI_FUNCS_TIME_BLOCKING 0xffffffff
|
||||
@ -133,6 +133,7 @@ typedef struct {
|
||||
void (* _coex_condition_set)(uint32_t type, bool dissatisfy);
|
||||
int32_t (* _coex_wifi_request)(uint32_t event, uint32_t latency, uint32_t duration);
|
||||
int32_t (* _coex_wifi_release)(uint32_t event);
|
||||
bool (* _is_from_isr)(void);
|
||||
int32_t _magic;
|
||||
} wifi_osi_funcs_t;
|
||||
|
||||
|
@ -88,6 +88,8 @@ extern "C" {
|
||||
#define ESP_ERR_WIFI_POST (ESP_ERR_WIFI_BASE + 18) /*!< Failed to post the event to WiFi task */
|
||||
#define ESP_ERR_WIFI_INIT_STATE (ESP_ERR_WIFI_BASE + 19) /*!< Invalod WiFi state when init/deinit is called */
|
||||
#define ESP_ERR_WIFI_STOP_STATE (ESP_ERR_WIFI_BASE + 20) /*!< Returned when WiFi is stopping */
|
||||
#define ESP_ERR_WIFI_NOT_ASSOC (ESP_ERR_WIFI_BASE + 21) /*!< The WiFi connection is not associated */
|
||||
#define ESP_ERR_WIFI_TX_DISALLOW (ESP_ERR_WIFI_BASE + 22) /*!< The WiFi TX is disallowed */
|
||||
|
||||
/**
|
||||
* @brief WiFi stack configuration parameters passed to esp_wifi_init call.
|
||||
@ -101,12 +103,12 @@ typedef struct {
|
||||
int tx_buf_type; /**< WiFi TX buffer type */
|
||||
int static_tx_buf_num; /**< WiFi static TX buffer number */
|
||||
int dynamic_tx_buf_num; /**< WiFi dynamic TX buffer number */
|
||||
int cache_tx_buf_num; /**< WiFi TX cache buffer number */
|
||||
int csi_enable; /**< WiFi channel state information enable flag */
|
||||
int ampdu_rx_enable; /**< WiFi AMPDU RX feature enable flag */
|
||||
int ampdu_tx_enable; /**< WiFi AMPDU TX feature enable flag */
|
||||
int nvs_enable; /**< WiFi NVS flash enable flag */
|
||||
int nano_enable; /**< Nano option for printf/scan family enable flag */
|
||||
int tx_ba_win; /**< WiFi Block Ack TX window size */
|
||||
int rx_ba_win; /**< WiFi Block Ack RX window size */
|
||||
int wifi_task_core_id; /**< WiFi Task Core ID */
|
||||
int beacon_max_len; /**< WiFi softAP maximum length of the beacon */
|
||||
@ -121,6 +123,12 @@ typedef struct {
|
||||
#define WIFI_STATIC_TX_BUFFER_NUM 0
|
||||
#endif
|
||||
|
||||
#if (CONFIG_ESP32_SPIRAM_SUPPORT | CONFIG_ESP32S2_SPIRAM_SUPPORT)
|
||||
#define WIFI_CACHE_TX_BUFFER_NUM CONFIG_ESP32_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
|
||||
#else
|
||||
@ -162,12 +170,6 @@ extern uint64_t g_wifi_feature_caps;
|
||||
|
||||
#define WIFI_INIT_CONFIG_MAGIC 0x1F2F3F4F
|
||||
|
||||
#ifdef CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED
|
||||
#define WIFI_DEFAULT_TX_BA_WIN CONFIG_ESP32_WIFI_TX_BA_WIN
|
||||
#else
|
||||
#define WIFI_DEFAULT_TX_BA_WIN 0 /* unused if ampdu_tx_enable == false */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED
|
||||
#define WIFI_DEFAULT_RX_BA_WIN CONFIG_ESP32_WIFI_RX_BA_WIN
|
||||
#else
|
||||
@ -193,6 +195,7 @@ extern uint64_t g_wifi_feature_caps;
|
||||
#endif
|
||||
|
||||
#define CONFIG_FEATURE_WPA3_SAE_BIT (1<<0)
|
||||
#define CONFIG_FEATURE_CACHE_TX_BUF_BIT (1<<1)
|
||||
|
||||
#define WIFI_INIT_CONFIG_DEFAULT() { \
|
||||
.event_handler = &esp_event_send_internal, \
|
||||
@ -203,12 +206,12 @@ extern uint64_t g_wifi_feature_caps;
|
||||
.tx_buf_type = CONFIG_ESP32_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,\
|
||||
.csi_enable = WIFI_CSI_ENABLED,\
|
||||
.ampdu_rx_enable = WIFI_AMPDU_RX_ENABLED,\
|
||||
.ampdu_tx_enable = WIFI_AMPDU_TX_ENABLED,\
|
||||
.nvs_enable = WIFI_NVS_ENABLED,\
|
||||
.nano_enable = WIFI_NANO_FORMAT_ENABLED,\
|
||||
.tx_ba_win = WIFI_DEFAULT_TX_BA_WIN,\
|
||||
.rx_ba_win = WIFI_DEFAULT_RX_BA_WIN,\
|
||||
.wifi_task_core_id = WIFI_TASK_CORE_ID,\
|
||||
.beacon_max_len = WIFI_SOFTAP_BEACON_MAX_LEN, \
|
||||
@ -1093,6 +1096,63 @@ esp_err_t esp_wifi_set_ant(const wifi_ant_config_t *config);
|
||||
*/
|
||||
esp_err_t esp_wifi_get_ant(wifi_ant_config_t *config);
|
||||
|
||||
/**
|
||||
* @brief Get the TSF time
|
||||
* In Station mode or SoftAP+Station mode if station is not connected or station doesn't receive at least
|
||||
* one beacon after connected, will return 0
|
||||
*
|
||||
* @attention Enabling power save may cause the return value inaccurate, except WiFi modem sleep
|
||||
*
|
||||
* @param interface The interface whose tsf_time is to be retrieved.
|
||||
*
|
||||
* @return 0 or the TSF time
|
||||
*/
|
||||
int64_t esp_wifi_get_tsf_time(wifi_interface_t interface);
|
||||
|
||||
/**
|
||||
* @brief Set the inactive time of the ESP32 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.
|
||||
* @attention 2. For SoftAP, If the softAP doesn't receive any data from the connected STA during inactive time,
|
||||
* the softAP will force deauth the STA. Default is 300s.
|
||||
* @attention 3. The inactive time configuration is not stored into flash
|
||||
*
|
||||
* @param ifx interface to be configured.
|
||||
* @param sec Inactive time. Unit seconds.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: succeed
|
||||
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
|
||||
* - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start
|
||||
* - ESP_ERR_WIFI_ARG: invalid argument, For Station, if sec is less than 3. For SoftAP, if sec is less than 10.
|
||||
*/
|
||||
esp_err_t esp_wifi_set_inactive_time(wifi_interface_t ifx, uint16_t sec);
|
||||
|
||||
/**
|
||||
* @brief Get inactive time of specified interface
|
||||
*
|
||||
* @param ifx Interface to be configured.
|
||||
* @param sec Inactive time. Unit seconds.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: succeed
|
||||
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
|
||||
* - ESP_ERR_WIFI_ARG: invalid argument
|
||||
*/
|
||||
esp_err_t esp_wifi_get_inactive_time(wifi_interface_t ifx, uint16_t *sec);
|
||||
|
||||
/**
|
||||
* @brief Dump WiFi statistics
|
||||
*
|
||||
* @param modules statistic modules to be dumped
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: succeed
|
||||
* - others: failed
|
||||
*/
|
||||
esp_err_t esp_wifi_statis_dump(uint32_t modules);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -94,7 +94,7 @@ typedef enum {
|
||||
WIFI_REASON_ASSOC_FAIL = 203,
|
||||
WIFI_REASON_HANDSHAKE_TIMEOUT = 204,
|
||||
WIFI_REASON_CONNECTION_FAIL = 205,
|
||||
WIFI_REASON_AUTH_CHANGED = 206,
|
||||
WIFI_REASON_AP_TSF_RESET = 206,
|
||||
} wifi_err_reason_t;
|
||||
|
||||
typedef enum {
|
||||
@ -581,6 +581,19 @@ typedef enum {
|
||||
WPS_FAIL_REASON_MAX
|
||||
} wifi_event_sta_wps_fail_reason_t;
|
||||
|
||||
#define MAX_SSID_LEN 32
|
||||
#define MAX_PASSPHRASE_LEN 64
|
||||
#define MAX_WPS_AP_CRED 3
|
||||
|
||||
/** Argument structure for WIFI_EVENT_STA_WPS_ER_SUCCESS event */
|
||||
typedef struct {
|
||||
uint8_t ap_cred_cnt; /**< Number of AP credentials received */
|
||||
struct {
|
||||
uint8_t ssid[MAX_SSID_LEN]; /**< SSID of AP */
|
||||
uint8_t passphrase[MAX_PASSPHRASE_LEN]; /**< Passphrase for the AP */
|
||||
} ap_cred[MAX_WPS_AP_CRED]; /**< All AP credentials received from WPS handshake */
|
||||
} wifi_event_sta_wps_er_success_t;
|
||||
|
||||
/** Argument structure for WIFI_EVENT_AP_STACONNECTED event */
|
||||
typedef struct {
|
||||
uint8_t mac[6]; /**< MAC address of the station connected to ESP32 soft-AP */
|
||||
@ -599,6 +612,12 @@ typedef struct {
|
||||
uint8_t mac[6]; /**< MAC address of the station which send probe request */
|
||||
} wifi_event_ap_probe_req_rx_t;
|
||||
|
||||
#define WIFI_STATIS_BUFFER (1<<0)
|
||||
#define WIFI_STATIS_RXTX (1<<1)
|
||||
#define WIFI_STATIS_HW (1<<2)
|
||||
#define WIFI_STATIS_DIAG (1<<3)
|
||||
#define WIFI_STATIS_ALL (-1)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user