fix(esp_wifi): Making action tx and roc API's public and modifying os_time_t datatype for platform and compiler independence

This commit is contained in:
tarun.kumar
2025-09-19 15:14:30 +05:30
parent ad3355e915
commit 767273f264
7 changed files with 51 additions and 17 deletions
+24 -1
View File
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -1789,6 +1789,29 @@ esp_err_t esp_wifi_set_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t* bw);
*/
esp_err_t esp_wifi_get_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw);
/**
* @brief Send action frame on target channel
*
* @param req action tx request structure containing relevant fields
*
* @return
* - ESP_OK: succeed
* - ESP_ERR_NO_MEM: failed to allocate memory
* - ESP_FAIL: failed to send frame
*/
esp_err_t esp_wifi_action_tx_req(wifi_action_tx_req_t *req);
/**
* @brief Remain on the target channel for required duration
*
* @param req roc request structure containing relevant fields
*
* @return
* - ESP_OK: succeed
* - ESP_ERR_NO_MEM: failed to allocate memory
* - ESP_FAIL: failed to perform roc operation
*/
esp_err_t esp_wifi_remain_on_channel(wifi_roc_req_t * req);
#ifdef __cplusplus
}
#endif
@@ -41,15 +41,15 @@ typedef enum {
WIFI_IF_MAX /**< Maximum number of interfaces */
} wifi_interface_t;
enum {
typedef enum {
WIFI_OFFCHAN_TX_CANCEL, /**< Cancel off-channel transmission */
WIFI_OFFCHAN_TX_REQ, /**< Request off-channel transmission */
};
} wifi_action_tx_t;
enum {
typedef enum {
WIFI_ROC_CANCEL, /**< Cancel remain on channel */
WIFI_ROC_REQ, /**< Request remain on channel */
};
} wifi_roc_t;
/**
* @brief Wi-Fi country policy
*/
@@ -776,8 +776,11 @@ typedef int (* wifi_action_rx_cb_t)(uint8_t *hdr, uint8_t *payload,
typedef struct {
wifi_interface_t ifx; /**< Wi-Fi interface to send request to */
uint8_t dest_mac[6]; /**< Destination MAC address */
wifi_action_tx_t type; /**< ACTION TX operation type */
uint8_t channel; /**< Channel on which to perform ACTION TX Operation */
uint32_t wait_time_ms; /**< Duration to wait for on target channel */
bool no_ack; /**< Indicates no ack required */
wifi_action_rx_cb_t rx_cb; /**< Rx Callback to receive any response */
wifi_action_rx_cb_t rx_cb; /**< Rx Callback to receive action frames */
uint8_t op_id; /**< Unique Identifier for operation provided by wifi driver */
uint32_t data_len; /**< Length of the appended Data */
uint8_t data[0]; /**< Appended Data payload */
@@ -807,7 +810,7 @@ typedef void (* wifi_action_roc_done_cb_t)(uint32_t context, uint8_t op_id,
*/
typedef struct {
wifi_interface_t ifx; /**< WiFi interface to send request to */
uint8_t type; /**< ROC operation type */
wifi_roc_t type; /**< ROC operation type */
uint8_t channel; /**< Channel on which to perform ROC Operation */
wifi_second_chan_t sec_channel; /**< Secondary channel */
uint32_t wait_time_ms; /**< Duration to wait for on target channel */
@@ -1274,6 +1277,7 @@ typedef struct {
#define WIFI_STATIS_ALL (-1) /**< All status */
/** Status codes for WIFI_EVENT_ACTION_TX_STATUS evt */
/** There will be back to back events in success case TX_DONE and TX_DURATION_COMPLETED */
typedef enum {
WIFI_ACTION_TX_DONE = 0, /**< ACTION_TX operation was completed successfully */
WIFI_ACTION_TX_FAILED, /**< ACTION_TX operation failed during tx */