From 424bf120a342baa095f0d433a936909e54c99b5e Mon Sep 17 00:00:00 2001 From: alanmaxwell Date: Thu, 7 Dec 2023 11:48:43 +0800 Subject: [PATCH 1/5] feat(wifi): support dump 802.11 ACK frame for CSI --- components/esp_wifi/include/esp_wifi_he_types.h | 3 ++- components/esp_wifi/include/esp_wifi_types.h | 1 + components/esp_wifi/lib | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/esp_wifi/include/esp_wifi_he_types.h b/components/esp_wifi/include/esp_wifi_he_types.h index 507367e53a..41d4424abd 100644 --- a/components/esp_wifi/include/esp_wifi_he_types.h +++ b/components/esp_wifi/include/esp_wifi_he_types.h @@ -54,7 +54,8 @@ typedef struct { 1- acquire the complete HE-LTF2 2- sample evenly among the HE-LTF1 and HE-LTF2 */ uint32_t val_scale_cfg : 2; /**< value 0-3 */ - uint32_t reserved : 20; /**< reserved */ + uint32_t dump_ack_en : 1; /**< enable to dump 802.11 ACK frame, default disabled */ + uint32_t reserved : 19; /**< reserved */ } wifi_csi_acquire_config_t; /** diff --git a/components/esp_wifi/include/esp_wifi_types.h b/components/esp_wifi/include/esp_wifi_types.h index 2a0e69c519..ac7d50dce6 100644 --- a/components/esp_wifi/include/esp_wifi_types.h +++ b/components/esp_wifi/include/esp_wifi_types.h @@ -566,6 +566,7 @@ typedef struct { bool channel_filter_en; /**< enable to turn on channel filter to smooth adjacent sub-carrier. Disable it to keep independence of adjacent sub-carrier. Default enabled */ bool manu_scale; /**< manually scale the CSI data by left shifting or automatically scale the CSI data. If set true, please set the shift bits. false: automatically. true: manually. Default false */ uint8_t shift; /**< manually left shift bits of the scale of the CSI data. The range of the left shift bits is 0~15 */ + bool dump_ack_en; /**< enable to dump 802.11 ACK frame, default disabled */ } wifi_csi_config_t; #endif diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index b8965b78b1..ac919987da 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit b8965b78b189369de1ac22b86aab1356fad01d1a +Subproject commit ac919987dae823fe86cc9b325f8455bf60d9345a From 1427e14b724292ee8ceede6523d98cdee7c06037 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Wed, 15 Nov 2023 11:44:43 +0800 Subject: [PATCH 2/5] feat(wifi): add wifi channel change event Closes https://github.com/espressif/esp-idf/issues/12538 --- components/esp_common/src/esp_err_to_name.c | 3 +++ components/esp_wifi/include/esp_now.h | 6 ++++-- components/esp_wifi/include/esp_wifi_types.h | 9 +++++++++ components/esp_wifi/lib | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/components/esp_common/src/esp_err_to_name.c b/components/esp_common/src/esp_err_to_name.c index 69fe53fb1f..b99fbd6d3e 100644 --- a/components/esp_common/src/esp_err_to_name.c +++ b/components/esp_common/src/esp_err_to_name.c @@ -457,6 +457,9 @@ static const esp_err_msg_t esp_err_msg_table[] = { # endif # ifdef ESP_ERR_ESPNOW_IF ERR_TBL_IT(ESP_ERR_ESPNOW_IF), /* 12396 0x306c Interface error */ +# endif +# ifdef ESP_ERR_ESPNOW_CHAN + ERR_TBL_IT(ESP_ERR_ESPNOW_CHAN), /* 12397 0x306d Channel error */ # endif // components/wpa_supplicant/esp_supplicant/include/esp_dpp.h # ifdef ESP_ERR_DPP_FAILURE diff --git a/components/esp_wifi/include/esp_now.h b/components/esp_wifi/include/esp_now.h index 3e8e8e299d..0f01054d8c 100644 --- a/components/esp_wifi/include/esp_now.h +++ b/components/esp_wifi/include/esp_now.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -41,6 +41,7 @@ extern "C" { #define ESP_ERR_ESPNOW_INTERNAL (ESP_ERR_ESPNOW_BASE + 6) /*!< Internal error */ #define ESP_ERR_ESPNOW_EXIST (ESP_ERR_ESPNOW_BASE + 7) /*!< ESPNOW peer has existed */ #define ESP_ERR_ESPNOW_IF (ESP_ERR_ESPNOW_BASE + 8) /*!< Interface error */ +#define ESP_ERR_ESPNOW_CHAN (ESP_ERR_ESPNOW_BASE + 9) /*!< Channel error */ #define ESP_NOW_ETH_ALEN 6 /*!< Length of ESPNOW peer MAC address */ #define ESP_NOW_KEY_LEN 16 /*!< Length of ESPNOW peer local master key */ @@ -205,7 +206,8 @@ esp_err_t esp_now_unregister_send_cb(void); * - ESP_ERR_ESPNOW_INTERNAL : internal error * - ESP_ERR_ESPNOW_NO_MEM : out of memory, when this happens, you can delay a while before sending the next data * - ESP_ERR_ESPNOW_NOT_FOUND : peer is not found - * - ESP_ERR_ESPNOW_IF : current WiFi interface doesn't match that of peer + * - ESP_ERR_ESPNOW_IF : current Wi-Fi interface doesn't match that of peer + * - ESP_ERR_ESPNOW_CHAN: current Wi-Fi channel doesn't match that of peer */ esp_err_t esp_now_send(const uint8_t *peer_addr, const uint8_t *data, size_t len); diff --git a/components/esp_wifi/include/esp_wifi_types.h b/components/esp_wifi/include/esp_wifi_types.h index ac7d50dce6..b5d9affc5b 100644 --- a/components/esp_wifi/include/esp_wifi_types.h +++ b/components/esp_wifi/include/esp_wifi_types.h @@ -903,6 +903,7 @@ typedef enum { WIFI_EVENT_NDP_INDICATION, /**< Received NDP Request from a NAN Peer */ WIFI_EVENT_NDP_CONFIRM, /**< NDP Confirm Indication */ WIFI_EVENT_NDP_TERMINATED, /**< NAN Datapath terminated indication */ + WIFI_EVENT_HOME_CHANNEL_CHANGE, /**< WiFi home channel change,doesn't occur when scanning */ WIFI_EVENT_MAX, /**< Invalid WiFi event ID */ } wifi_event_t; @@ -995,6 +996,14 @@ typedef struct { int32_t rssi; /**< RSSI value of bss */ } wifi_event_bss_rssi_low_t; +/** Argument structure for WIFI_EVENT_HOME_CHANNEL_CHANGE event */ +typedef struct { + uint8_t old_chan; /**< old home channel of the device */ + wifi_second_chan_t old_snd; /**< old second channel of the device */ + uint8_t new_chan; /**< new home channel of the device */ + wifi_second_chan_t new_snd; /**< new second channel of the device */ +} wifi_event_home_channel_change_t; + /** * @brief FTM operation status types * diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index ac919987da..eb14a403c8 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit ac919987dae823fe86cc9b325f8455bf60d9345a +Subproject commit eb14a403c863d7f2161b92efb45bbb82d0008b02 From 13c548cefa8dfc9dc2966cb046aa90918f50f850 Mon Sep 17 00:00:00 2001 From: jgujarathi Date: Mon, 4 Dec 2023 18:01:56 +0530 Subject: [PATCH 3/5] fix(esp_wifi): Correct wifi lib docs for esp_wifi_crypto_types.h - Wifi lib changes for docs of some APIs in esp_wifi_crypto_types.h --- components/esp_wifi/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index eb14a403c8..0105d2a2df 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit eb14a403c863d7f2161b92efb45bbb82d0008b02 +Subproject commit 0105d2a2df2735a121bb1cd585658e59be03cf61 From 2b475022c52ed76b407a0062444d515c80b1072e Mon Sep 17 00:00:00 2001 From: Vikram Dattu Date: Mon, 27 Nov 2023 11:57:55 +0530 Subject: [PATCH 4/5] fix(esp_srp): Use `@file` for file documentation and missing doc Using @brief for file description wrongly associates the documentation to an API. Correct way to add file description is to use `@file` and then `@brief`. Corrected the same. - Also added missing doc for esp_srp_handle_t --- components/protocomm/include/crypto/srp6a/esp_srp.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/protocomm/include/crypto/srp6a/esp_srp.h b/components/protocomm/include/crypto/srp6a/esp_srp.h index 23db7db35c..b02d78a5b5 100644 --- a/components/protocomm/include/crypto/srp6a/esp_srp.h +++ b/components/protocomm/include/crypto/srp6a/esp_srp.h @@ -13,6 +13,7 @@ extern "C" { #endif /** + * @file esp_srp.h * @brief SRP-6a protocol implementation * * More information on protocol can be found: https://datatracker.ietf.org/doc/html/rfc5054 @@ -98,6 +99,13 @@ typedef enum { ESP_NG_3072 = 0, } esp_ng_type_t; +/** + * @brief esp_srp handle as the result of `esp_srp_init` + * + * The handle is returned by `esp_srp_init` on successful init. It is then + * passed for subsequent API calls as an argument. `esp_srp_free` can be used to + * clean up the handle. After `esp_srp_free` the handle becomes invalid. + */ typedef struct esp_srp_handle esp_srp_handle_t; /** From 504c6a09e134d556a6eb84af2fdd76f03905b862 Mon Sep 17 00:00:00 2001 From: Vikram Dattu Date: Wed, 29 Nov 2023 11:28:45 +0530 Subject: [PATCH 5/5] fix(docs): fixed doxygen warnings in few headers - non-matching arguments in `i2c_types.h` and `esp_wifi_crypto_types.h` - Fixed unended `@cond` macro in `esp_err.h` --- components/driver/i2c/include/driver/i2c_types.h | 2 +- components/esp_common/include/esp_err.h | 1 - components/esp_wifi/include/esp_wifi_crypto_types.h | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/components/driver/i2c/include/driver/i2c_types.h b/components/driver/i2c/include/driver/i2c_types.h index 8e31bbfe59..81b3c239c1 100644 --- a/components/driver/i2c/include/driver/i2c_types.h +++ b/components/driver/i2c/include/driver/i2c_types.h @@ -86,7 +86,7 @@ typedef struct { * * @param[in] i2c_slave Handle for I2C slave. * @param[out] evt_data I2C capture event data, fed by driver - * @param[in] user_ctx User data, set in `i2c_slave_register_event_callbacks()` + * @param[in] arg User data, set in `i2c_slave_register_event_callbacks()` * * @return Whether a high priority task has been waken up by this function */ diff --git a/components/esp_common/include/esp_err.h b/components/esp_common/include/esp_err.h index 30789475a5..039dc5552a 100644 --- a/components/esp_common/include/esp_err.h +++ b/components/esp_common/include/esp_err.h @@ -79,7 +79,6 @@ const char *esp_err_to_name_r(esp_err_t code, char *buf, size_t buflen); /** @cond */ void _esp_error_check_failed(esp_err_t rc, const char *file, int line, const char *function, const char *expression) __attribute__((__noreturn__)); -/** @cond */ void _esp_error_check_failed_without_abort(esp_err_t rc, const char *file, int line, const char *function, const char *expression); #ifndef __ASSERT_FUNC diff --git a/components/esp_wifi/include/esp_wifi_crypto_types.h b/components/esp_wifi/include/esp_wifi_crypto_types.h index 1c7ec82a8f..6b41cc524a 100644 --- a/components/esp_wifi/include/esp_wifi_crypto_types.h +++ b/components/esp_wifi/include/esp_wifi_crypto_types.h @@ -134,7 +134,7 @@ typedef int (*esp_sha256_prf_t)(const unsigned char *key, int key_len, const cha * * @param key Key for HMAC operations * @param key_len Length of the key in bytes - * @param dataPointers to the data area + * @param data Pointers to the data area * @param data_len Length of the data area * @param mac Buffer for the hash (16 bytes) * Returns: 0 on success, -1 on failure @@ -327,7 +327,7 @@ typedef int (*esp_omac1_aes_128_t)(const uint8_t *key, const uint8_t *data, size * Counter Mode Cipher Block Chaining Message Authentication * Code Protocol) which is used in IEEE 802.11i RSN standard. * @param tk 128-bit Temporal Key for obtained during 4-way handshake - * @param hdr Pointer to IEEE802.11 frame headeri needed for AAD + * @param ieee80211_hdr Pointer to IEEE802.11 frame headeri needed for AAD * @param data Pointer to encrypted data buffer * @param data_len Encrypted data length in bytes * @param decrypted_len Length of decrypted data @@ -373,7 +373,7 @@ typedef int (*esp_aes_gmac_t)(const uint8_t *key, size_t keylen, const uint8_t * * @param num_elem Number of elements in the data vector * @param addr Pointers to the data areas * @param len Lengths of the data blocks - * @param mac Buffer for the hash + * @param buf Buffer for the hash * Returns: 0 on success, -1 on failure */ typedef int (*esp_sha256_vector_t)(size_t num_elem, const uint8_t *addr[], const size_t *len, uint8_t *buf);