mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
fix(esp_wifi): NAN improvements and bugfixes
- Add NDP Peer inactivity detection and termination support - Add NDP Action frames internal retries - Fix NAN API return status to match with Tx status - Fix false wait events during NAN datapath setup - Replace NAN default event handlers with callbacks to avoid race conditions between wifi and user tasks - Fix parsing Availability of third party devices Closes https://github.com/espressif/esp-idf/issues/17529 Co-authored-by: akshat <akshat.agrawal@espressif.com>
This commit is contained in:
co-authored by
akshat
parent
f54682b979
commit
774cd19a60
@@ -39,6 +39,19 @@ typedef struct {
|
||||
void *storage; /**< storage for FreeRTOS queue */
|
||||
} wifi_static_queue_t;
|
||||
|
||||
struct nan_callbacks {
|
||||
void (* service_match)(uint8_t sub_id, uint8_t pub_id, uint8_t pub_mac[6], uint16_t capab,
|
||||
uint8_t ssi_ver, uint8_t *ssi, uint16_t ssi_len);
|
||||
void (* replied)(uint8_t pub_id, uint8_t sub_id, uint8_t pub_mac[6], uint8_t *ssi, uint16_t ssi_len);
|
||||
void (* receive)(uint8_t svc_id, uint8_t peer_svc_id, uint8_t peer_mac[6], uint8_t *ssi, uint16_t ssi_len);
|
||||
void (* ndp_indication)(uint8_t pub_id, uint8_t ndp_id, uint8_t peer_nmi[6], uint8_t peer_ndi[6],
|
||||
uint8_t *ssi, uint16_t ssi_len);
|
||||
void (* ndp_confirm)(uint8_t status, uint8_t ndp_id, uint8_t peer_nmi[6], uint8_t peer_ndi[6],
|
||||
uint8_t own_ndi[6], uint8_t *ssi, uint16_t ssi_len);
|
||||
void (* ndp_terminated)(uint8_t reason, uint8_t ndp_id, uint8_t init_ndi[6]);
|
||||
void (* action_txdone)(uint32_t context, bool tx_status);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief WiFi log level
|
||||
*
|
||||
@@ -703,13 +716,14 @@ esp_err_t esp_nan_internal_subscribe_service(const wifi_nan_subscribe_cfg_t *sub
|
||||
*
|
||||
* @attention This API should be called after WIFI_EVENT_NAN_SVC_MATCH event is received.
|
||||
*
|
||||
* @param fup_params Configuration parameters for sending a Follow-up to the Peer.
|
||||
* @param[in] fup_params Configuration parameters for sending a Follow-up to the Peer.
|
||||
* @param[out] context Context returned for Follow-up frame to be matched in Tx done.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: succeed
|
||||
* - others: failed
|
||||
*/
|
||||
esp_err_t esp_nan_internal_send_followup(const wifi_nan_followup_params_t *fup_params);
|
||||
esp_err_t esp_nan_internal_send_followup(const wifi_nan_followup_params_t *fup_params, uint32_t *context);
|
||||
|
||||
/**
|
||||
* @brief Send Datapath Request to the Publisher with matching service
|
||||
@@ -750,6 +764,19 @@ esp_err_t esp_nan_internal_datapath_resp(wifi_nan_datapath_resp_t *resp);
|
||||
*/
|
||||
esp_err_t esp_nan_internal_datapath_end(wifi_nan_datapath_end_req_t *req);
|
||||
|
||||
/**
|
||||
* @brief End NAN Datapath that is active
|
||||
*
|
||||
* @attention This API should be called after receiving WIFI_EVENT_NDP_CONFIRM event.
|
||||
*
|
||||
* @param req NAN Datapath end request parameters.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK: succeed
|
||||
* - others: failed
|
||||
*/
|
||||
esp_err_t esp_nan_internal_register_callbacks(struct nan_callbacks *cb);
|
||||
|
||||
/**
|
||||
* @brief Connect WiFi station to the AP.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user