diff --git a/.github/workflows/smoke_compat.yml b/.github/workflows/smoke_compat.yml index 52434bd..0404114 100644 --- a/.github/workflows/smoke_compat.yml +++ b/.github/workflows/smoke_compat.yml @@ -14,7 +14,7 @@ jobs: name: Check API compatibility of WiFi Remote strategy: matrix: - idf_ver: ["latest", "release-v5.5", "release-v5.4", "release-v5.3", "v5.4", "v5.4.1", "v5.3.3", "v5.3.2", "v5.3.1"] + idf_ver: ["latest", "release-v5.5", "release-v5.4", "release-v5.3", "v5.4", "v5.4.1", "v5.4.2", "v5.3.3", "v5.3.2", "v5.3.1"] runs-on: ubuntu-latest container: espressif/idf:${{ matrix.idf_ver }} steps: @@ -33,7 +33,7 @@ jobs: name: Build IDF examples with WiFi Remote strategy: matrix: - idf_ver: ["latest", "release-v5.5", "release-v5.4", "release-v5.3", "v5.4.1", "v5.3.3", "v5.3.1", "v5.3.2", "v5.4"] + idf_ver: ["latest", "release-v5.5", "release-v5.4", "release-v5.3", "v5.4.1", "v5.3.3", "v5.3.1", "v5.3.2", "v5.4", "v5.4.2"] idf_target: ["esp32p4", "esp32h2", "esp32s3"] test: [ { app: idf_mqtt_example, path: "examples/protocols/mqtt/tcp" }, { app: wifi_enterprise, path: "examples/wifi/wifi_enterprise" }] runs-on: ubuntu-latest diff --git a/components/esp_wifi_remote/.cz.yaml b/components/esp_wifi_remote/.cz.yaml index 3d84730..04dff5f 100644 --- a/components/esp_wifi_remote/.cz.yaml +++ b/components/esp_wifi_remote/.cz.yaml @@ -3,6 +3,6 @@ commitizen: bump_message: 'bump(wifi_remote): $current_version -> $new_version' pre_bump_hooks: python ../../ci/changelog.py esp_wifi_remote tag_format: wifi_remote-v$version - version: 0.14.5 + version: 0.15.0 version_files: - idf_component.yml diff --git a/components/esp_wifi_remote/CHANGELOG.md b/components/esp_wifi_remote/CHANGELOG.md index 07945a5..bcd8c51 100644 --- a/components/esp_wifi_remote/CHANGELOG.md +++ b/components/esp_wifi_remote/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [0.15.0](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.15.0) + +### Bug Fixes + +- Add support for v5.4.2 IDF release tag ([4809209](https://github.com/espressif/esp-wifi-remote/commit/4809209)) + ## [0.14.5](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.14.5) ### Bug Fixes diff --git a/components/esp_wifi_remote/idf_component.yml b/components/esp_wifi_remote/idf_component.yml index 9116171..2db58dd 100644 --- a/components/esp_wifi_remote/idf_component.yml +++ b/components/esp_wifi_remote/idf_component.yml @@ -1,4 +1,4 @@ -version: 0.14.5 +version: 0.15.0 url: https://github.com/espressif/esp-wifi-remote description: Utility wrapper for esp_wifi functionality on remote targets dependencies: diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/Kconfig.slave_select.in b/components/esp_wifi_remote/idf_tag_v5.4.2/Kconfig.slave_select.in new file mode 100644 index 0000000..5b2cc42 --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/Kconfig.slave_select.in @@ -0,0 +1,23 @@ +# This file is auto-generated + choice SLAVE_IDF_TARGET + prompt "choose slave target" + default SLAVE_IDF_TARGET_ESP32C6 if IDF_TARGET_ESP32P4 # To support common use-cases + default SLAVE_IDF_TARGET_ESP32 + + config SLAVE_IDF_TARGET_ESP32 + bool "esp32" + config SLAVE_IDF_TARGET_ESP32S2 + bool "esp32s2" + config SLAVE_IDF_TARGET_ESP32C3 + bool "esp32c3" + config SLAVE_IDF_TARGET_ESP32S3 + bool "esp32s3" + config SLAVE_IDF_TARGET_ESP32C2 + bool "esp32c2" + config SLAVE_IDF_TARGET_ESP32C6 + bool "esp32c6" + config SLAVE_IDF_TARGET_ESP32C5 + bool "esp32c5" + config SLAVE_IDF_TARGET_ESP32C61 + bool "esp32c61" + endchoice diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/Kconfig.soc_wifi_caps.in b/components/esp_wifi_remote/idf_tag_v5.4.2/Kconfig.soc_wifi_caps.in new file mode 100644 index 0000000..34ed3d9 --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/Kconfig.soc_wifi_caps.in @@ -0,0 +1,385 @@ +# This file is auto-generated + +if SLAVE_IDF_TARGET_ESP32 + + config SLAVE_SOC_WIFI_SUPPORTED # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_WAPI_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_CSI_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_MESH_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_NAN_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_IDF_TARGET_ARCH_XTENSA # ignore: multiple-definition + bool + default y + +endif # ESP32 + +if SLAVE_IDF_TARGET_ESP32S2 + + config SLAVE_SOC_WIFI_SUPPORTED # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH # ignore: multiple-definition + int + default 12 + + config SLAVE_SOC_WIFI_HW_TSF # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_FTM_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_WAPI_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_CSI_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_MESH_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_NAN_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_FREERTOS_UNICORE # ignore: multiple-definition + bool + default y + + config SLAVE_IDF_TARGET_ARCH_XTENSA # ignore: multiple-definition + bool + default y + +endif # ESP32S2 + +if SLAVE_IDF_TARGET_ESP32C3 + + config SLAVE_SOC_WIFI_SUPPORTED # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH # ignore: multiple-definition + int + default 12 + + config SLAVE_SOC_WIFI_HW_TSF # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_FTM_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_GCMP_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_WAPI_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_CSI_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_MESH_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_PHY_NEEDS_USB_WORKAROUND # ignore: multiple-definition + bool + default y + + config SLAVE_FREERTOS_UNICORE # ignore: multiple-definition + bool + default y + + config SLAVE_IDF_TARGET_ARCH_RISCV # ignore: multiple-definition + bool + default y + +endif # ESP32C3 + +if SLAVE_IDF_TARGET_ESP32S3 + + config SLAVE_SOC_WIFI_SUPPORTED # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH # ignore: multiple-definition + int + default 12 + + config SLAVE_SOC_WIFI_HW_TSF # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_FTM_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_GCMP_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_WAPI_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_CSI_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_MESH_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_PHY_NEEDS_USB_WORKAROUND # ignore: multiple-definition + bool + default y + + config SLAVE_IDF_TARGET_ARCH_XTENSA # ignore: multiple-definition + bool + default y + +endif # ESP32S3 + +if SLAVE_IDF_TARGET_ESP32C2 + + config SLAVE_SOC_WIFI_SUPPORTED # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH # ignore: multiple-definition + int + default 12 + + config SLAVE_SOC_WIFI_HW_TSF # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_FTM_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_PHY_NEEDS_USB_WORKAROUND # ignore: multiple-definition + bool + default y + + config SLAVE_FREERTOS_UNICORE # ignore: multiple-definition + bool + default y + + config SLAVE_IDF_TARGET_ARCH_RISCV # ignore: multiple-definition + bool + default y + +endif # ESP32C2 + +if SLAVE_IDF_TARGET_ESP32C6 + + config SLAVE_SOC_WIFI_SUPPORTED # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH # ignore: multiple-definition + int + default 12 + + config SLAVE_SOC_WIFI_HW_TSF # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_FTM_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_GCMP_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_WAPI_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_CSI_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_MESH_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_HE_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_MAC_VERSION_NUM # ignore: multiple-definition + int + default 2 + + config SLAVE_FREERTOS_UNICORE # ignore: multiple-definition + bool + default y + + config SLAVE_IDF_TARGET_ARCH_RISCV # ignore: multiple-definition + bool + default y + +endif # ESP32C6 + +if SLAVE_IDF_TARGET_ESP32C5 + + config SLAVE_SOC_WIFI_SUPPORTED # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH # ignore: multiple-definition + int + default 12 + + config SLAVE_SOC_WIFI_HW_TSF # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_FTM_SUPPORT # ignore: multiple-definition + bool + default n + + config SLAVE_SOC_WIFI_GCMP_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_WAPI_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_CSI_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_MESH_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_HE_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_SUPPORT_5G # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_MAC_VERSION_NUM # ignore: multiple-definition + int + default 3 + + config SLAVE_SOC_WIFI_NAN_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_FREERTOS_UNICORE # ignore: multiple-definition + bool + default y + + config SLAVE_IDF_TARGET_ARCH_RISCV # ignore: multiple-definition + bool + default y + +endif # ESP32C5 + +if SLAVE_IDF_TARGET_ESP32C61 + + config SLAVE_SOC_WIFI_SUPPORTED # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH # ignore: multiple-definition + int + default 12 + + config SLAVE_SOC_WIFI_HW_TSF # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_FTM_SUPPORT # ignore: multiple-definition + bool + default n + + config SLAVE_SOC_WIFI_GCMP_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_WAPI_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_CSI_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_MESH_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_HE_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_SOC_WIFI_MAC_VERSION_NUM # ignore: multiple-definition + int + default 3 + + config SLAVE_SOC_WIFI_NAN_SUPPORT # ignore: multiple-definition + bool + default y + + config SLAVE_FREERTOS_UNICORE # ignore: multiple-definition + bool + default y + + config SLAVE_IDF_TARGET_ARCH_RISCV # ignore: multiple-definition + bool + default y + +endif # ESP32C61 diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/Kconfig.wifi.in b/components/esp_wifi_remote/idf_tag_v5.4.2/Kconfig.wifi.in new file mode 100644 index 0000000..ba67a78 --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/Kconfig.wifi.in @@ -0,0 +1,1168 @@ +# Wi-Fi configuration +# This file is auto-generated + +config WIFI_RMT_STATIC_RX_BUFFER_NUM + int "Max number of WiFi static RX buffers" + range 2 25 if !SLAVE_SOC_WIFI_HE_SUPPORT + range 2 128 if SLAVE_SOC_WIFI_HE_SUPPORT + default 10 if !(SPIRAM_TRY_ALLOCATE_WIFI_LWIP && !SPIRAM_IGNORE_NOTFOUND) + default 16 if (SPIRAM_TRY_ALLOCATE_WIFI_LWIP && !SPIRAM_IGNORE_NOTFOUND) + help + Set the number of WiFi static RX buffers. Each buffer takes approximately 1.6KB of RAM. + The static rx buffers are allocated when esp_wifi_init is called, they are not freed + until esp_wifi_deinit is called. + + WiFi hardware use these buffers to receive all 802.11 frames. + A higher number may allow higher throughput but increases memory use. If WIFI_RMT_AMPDU_RX_ENABLED + is enabled, this value is recommended to set equal or bigger than WIFI_RMT_RX_BA_WIN in order to + achieve better throughput and compatibility with both stations and APs. + +config WIFI_RMT_DYNAMIC_RX_BUFFER_NUM + int "Max number of WiFi dynamic RX buffers" + range 0 128 if !LWIP_WND_SCALE + range 0 1024 if LWIP_WND_SCALE + default 32 + help + Set the number of WiFi dynamic RX buffers, 0 means unlimited RX buffers will be allocated + (provided sufficient free RAM). The size of each dynamic RX buffer depends on the size of + the received data frame. + + For each received data frame, the WiFi driver makes a copy to an RX buffer and then delivers + it to the high layer TCP/IP stack. The dynamic RX buffer is freed after the higher layer has + successfully received the data frame. + + For some applications, WiFi data frames may be received faster than the application can + process them. In these cases we may run out of memory if RX buffer number is unlimited (0). + + If a dynamic RX buffer limit is set, it should be at least the number of static RX buffers. + +choice WIFI_RMT_TX_BUFFER + prompt "Type of WiFi TX buffers" + default WIFI_RMT_DYNAMIC_TX_BUFFER + help + Select type of WiFi TX buffers: + + If "Static" is selected, WiFi TX buffers are allocated when WiFi is initialized and released + when WiFi is de-initialized. The size of each static TX buffer is fixed to about 1.6KB. + + If "Dynamic" is selected, each WiFi TX buffer is allocated as needed when a data frame is + delivered to the Wifi driver from the TCP/IP stack. The buffer is freed after the data frame + has been sent by the WiFi driver. The size of each dynamic TX buffer depends on the length + of each data frame sent by the TCP/IP layer. + + If PSRAM is enabled, "Static" should be selected to guarantee enough WiFi TX buffers. + If PSRAM is disabled, "Dynamic" should be selected to improve the utilization of RAM. + + config WIFI_RMT_STATIC_TX_BUFFER + bool "Static" + config WIFI_RMT_DYNAMIC_TX_BUFFER + bool "Dynamic" + depends on !(SPIRAM_TRY_ALLOCATE_WIFI_LWIP && !SPIRAM_IGNORE_NOTFOUND) +endchoice + +config WIFI_RMT_TX_BUFFER_TYPE + int + default 0 if WIFI_RMT_STATIC_TX_BUFFER + default 1 if WIFI_RMT_DYNAMIC_TX_BUFFER + +config WIFI_RMT_STATIC_TX_BUFFER_NUM + int "Max number of WiFi static TX buffers" + depends on WIFI_RMT_STATIC_TX_BUFFER + range 1 64 + default 16 + help + Set the number of WiFi static TX buffers. Each buffer takes approximately 1.6KB of RAM. + The static RX buffers are allocated when esp_wifi_init() is called, they are not released + until esp_wifi_deinit() is called. + + For each transmitted data frame from the higher layer TCP/IP stack, the WiFi driver makes a + copy of it in a TX buffer. For some applications especially UDP applications, the upper + layer can deliver frames faster than WiFi layer can transmit. In these cases, we may run out + of TX buffers. + +config WIFI_RMT_CACHE_TX_BUFFER_NUM + int "Max number of WiFi cache TX buffers" + depends on (SPIRAM_TRY_ALLOCATE_WIFI_LWIP && !SPIRAM_IGNORE_NOTFOUND) + range 0 128 + default 32 + help + Set the number of WiFi cache TX buffer number. + + For each TX packet from uplayer, such as LWIP etc, WiFi driver needs to allocate a static TX + buffer and makes a copy of uplayer packet. If WiFi driver fails to allocate the static TX buffer, + it caches the uplayer packets to a dedicated buffer queue, this option is used to configure the + size of the cached TX queue. + +config WIFI_RMT_DYNAMIC_TX_BUFFER_NUM + int "Max number of WiFi dynamic TX buffers" + depends on WIFI_RMT_DYNAMIC_TX_BUFFER + range 1 128 + default 32 + help + Set the number of WiFi dynamic TX buffers. The size of each dynamic TX buffer is not fixed, + it depends on the size of each transmitted data frame. + + For each transmitted frame from the higher layer TCP/IP stack, the WiFi driver makes a copy + of it in a TX buffer. For some applications, especially UDP applications, the upper layer + can deliver frames faster than WiFi layer can transmit. In these cases, we may run out of TX + buffers. + +choice WIFI_RMT_MGMT_RX_BUFFER + prompt "Type of WiFi RX MGMT buffers" + default WIFI_RMT_STATIC_RX_MGMT_BUFFER + help + Select type of WiFi RX MGMT buffers: + + If "Static" is selected, WiFi RX MGMT buffers are allocated when WiFi is initialized and released + when WiFi is de-initialized. The size of each static RX MGMT buffer is fixed to about 500 Bytes. + + If "Dynamic" is selected, each WiFi RX MGMT buffer is allocated as needed when a MGMT data frame is + received. The MGMT buffer is freed after the MGMT data frame has been processed by the WiFi driver. + + + config WIFI_RMT_STATIC_RX_MGMT_BUFFER + bool "Static" + config WIFI_RMT_DYNAMIC_RX_MGMT_BUFFER + bool "Dynamic" +endchoice + +config WIFI_RMT_DYNAMIC_RX_MGMT_BUF + int + default 0 if WIFI_RMT_STATIC_RX_MGMT_BUFFER + default 1 if WIFI_RMT_DYNAMIC_RX_MGMT_BUFFER + +config WIFI_RMT_RX_MGMT_BUF_NUM_DEF + int "Max number of WiFi RX MGMT buffers" + range 1 10 + default 5 + help + Set the number of WiFi RX_MGMT buffers. + + For Management buffers, the number of dynamic and static management buffers is the same. + In order to prevent memory fragmentation, the management buffer type should be set to static first. + +config WIFI_RMT_CSI_ENABLED + bool "WiFi CSI(Channel State Information)" + depends on SLAVE_SOC_WIFI_CSI_SUPPORT + default n + help + Select this option to enable CSI(Channel State Information) feature. CSI takes about + CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM KB of RAM. If CSI is not used, it is better to disable + this feature in order to save memory. + +config WIFI_RMT_AMPDU_TX_ENABLED + bool "WiFi AMPDU TX" + default y + help + Select this option to enable AMPDU TX feature + + +config WIFI_RMT_TX_BA_WIN + int "WiFi AMPDU TX BA window size" + depends on WIFI_RMT_AMPDU_TX_ENABLED + range 2 32 if !SLAVE_SOC_WIFI_HE_SUPPORT + range 2 64 if SLAVE_SOC_WIFI_HE_SUPPORT + default 6 + help + Set the size of WiFi Block Ack TX window. Generally a bigger value means higher throughput but + more memory. Most of time we should NOT change the default value unless special reason, e.g. + test the maximum UDP TX throughput with iperf etc. For iperf test in shieldbox, the recommended + value is 9~12. + +config WIFI_RMT_AMPDU_RX_ENABLED + bool "WiFi AMPDU RX" + default y + help + Select this option to enable AMPDU RX feature + +config WIFI_RMT_RX_BA_WIN + int "WiFi AMPDU RX BA window size" + depends on WIFI_RMT_AMPDU_RX_ENABLED + range 2 32 if !SLAVE_SOC_WIFI_HE_SUPPORT + range 2 64 if SLAVE_SOC_WIFI_HE_SUPPORT + default 6 if !(SPIRAM_TRY_ALLOCATE_WIFI_LWIP && !SPIRAM_IGNORE_NOTFOUND) + default 16 if (SPIRAM_TRY_ALLOCATE_WIFI_LWIP && !SPIRAM_IGNORE_NOTFOUND) + help + Set the size of WiFi Block Ack RX window. Generally a bigger value means higher throughput and better + compatibility but more memory. Most of time we should NOT change the default value unless special + reason, e.g. test the maximum UDP RX throughput with iperf etc. For iperf test in shieldbox, the + recommended value is 9~12. If PSRAM is used and WiFi memory is preferred to allocate in PSRAM first, + the default and minimum value should be 16 to achieve better throughput and compatibility with both + stations and APs. + +config WIFI_RMT_AMSDU_TX_ENABLED + bool "WiFi AMSDU TX" + depends on (WIFI_RMT_CACHE_TX_BUFFER_NUM >= 2) + default n + help + Select this option to enable AMSDU TX feature + +config WIFI_RMT_NVS_ENABLED + bool "WiFi NVS flash" + default y + help + Select this option to enable WiFi NVS flash + +choice WIFI_RMT_TASK_CORE_ID + depends on !SLAVE_FREERTOS_UNICORE + prompt "WiFi Task Core ID" + default WIFI_RMT_TASK_PINNED_TO_CORE_0 + help + Pinned WiFi task to core 0 or core 1. + + config WIFI_RMT_TASK_PINNED_TO_CORE_0 + bool "Core 0" + config WIFI_RMT_TASK_PINNED_TO_CORE_1 + bool "Core 1" +endchoice + +config WIFI_RMT_SOFTAP_BEACON_MAX_LEN + int "Max length of WiFi SoftAP Beacon" + range 752 1256 + default 752 + help + ESP-MESH utilizes beacon frames to detect and resolve root node conflicts (see documentation). However + the default length of a beacon frame can simultaneously hold only five root node identifier structures, + meaning that a root node conflict of up to five nodes can be detected at one time. In the occurrence of + more root nodes conflict involving more than five root nodes, the conflict resolution process will + detect five of the root nodes, resolve the conflict, and re-detect more root nodes. This process will + repeat until all root node conflicts are resolved. However this process can generally take a very long + time. + + To counter this situation, the beacon frame length can be increased such that more root nodes can be + detected simultaneously. Each additional root node will require 36 bytes and should be added on top of + the default beacon frame length of + 752 bytes. For example, if you want to detect 10 root nodes simultaneously, you need to set the beacon + frame length as + 932 (752+36*5). + + Setting a longer beacon length also assists with debugging as the conflicting root nodes can be + identified more quickly. + +config WIFI_RMT_MGMT_SBUF_NUM + int "WiFi mgmt short buffer number" + range 6 32 + default 32 + help + Set the maximum number of Wi-Fi management short buffers. These buffers are dynamically allocated, + with their size determined by the length of the management packet to be sent. When a management + packet is less than 64 bytes, the Wi-Fi driver classifies it as a short management packet and + assigns it to one of these buffers. + +config WIFI_RMT_IRAM_OPT + bool "WiFi IRAM speed optimization" + default n if (BT_ENABLED && SPIRAM && SLAVE_IDF_TARGET_ESP32) + default y + help + Select this option to place frequently called Wi-Fi library functions in IRAM. + When this option is disabled, more than 10Kbytes of IRAM memory will be saved + but Wi-Fi throughput will be reduced. + +config WIFI_RMT_EXTRA_IRAM_OPT + bool "WiFi EXTRA IRAM speed optimization" + default y if SLAVE_SOC_WIFI_HE_SUPPORT + default n + help + Select this option to place additional frequently called Wi-Fi library functions + in IRAM. When this option is disabled, more than 5Kbytes of IRAM memory will be saved + but Wi-Fi throughput will be reduced. + +config WIFI_RMT_RX_IRAM_OPT + bool "WiFi RX IRAM speed optimization" + default n if (BT_ENABLED && SPIRAM && SLAVE_IDF_TARGET_ESP32) + default y + help + Select this option to place frequently called Wi-Fi library RX functions in IRAM. + When this option is disabled, more than 17Kbytes of IRAM memory will be saved + but Wi-Fi performance will be reduced. + +config WIFI_RMT_ENABLE_WPA3_SAE + bool "Enable WPA3-Personal" + default y + select WIFI_RMT_MBEDTLS_CRYPTO + help + Select this option to allow the device to establish a WPA3-Personal connection with eligible AP's. + PMF (Protected Management Frames) is a prerequisite feature for a WPA3 connection, it needs to be + explicitly configured before attempting connection. Please refer to the Wi-Fi Driver API Guide + for details. + +config WIFI_RMT_ENABLE_SAE_PK + bool "Enable SAE-PK" + default y + depends on WIFI_RMT_ENABLE_WPA3_SAE + help + Select this option to enable SAE-PK + +config WIFI_RMT_SOFTAP_SAE_SUPPORT + bool "Enable WPA3 Personal(SAE) SoftAP" + default y + depends on WIFI_RMT_ENABLE_WPA3_SAE + depends on WIFI_RMT_SOFTAP_SUPPORT + help + Select this option to enable SAE support in softAP mode. + +config WIFI_RMT_ENABLE_WPA3_OWE_STA + bool "Enable OWE STA" + default y + select WIFI_RMT_MBEDTLS_CRYPTO + help + Select this option to allow the device to establish OWE connection with eligible AP's. + PMF (Protected Management Frames) is a prerequisite feature for a WPA3 connection, it needs to be + explicitly configured before attempting connection. Please refer to the Wi-Fi Driver API Guide + for details. + +config WIFI_RMT_SLP_IRAM_OPT + bool "WiFi SLP IRAM speed optimization" + select PM_SLP_DEFAULT_PARAMS_OPT + select PERIPH_CTRL_FUNC_IN_IRAM + default y if SLAVE_SOC_WIFI_HE_SUPPORT + help + Select this option to place called Wi-Fi library TBTT process and receive beacon functions in IRAM. + Some functions can be put in IRAM either by WIFI_RMT_IRAM_OPT and WIFI_RMT_RX_IRAM_OPT, or this one. + If already enabled WIFI_RMT_IRAM_OPT, the other 7.3KB IRAM memory would be taken by this option. + If already enabled WIFI_RMT_RX_IRAM_OPT, the other 1.3KB IRAM memory would be taken by this option. + If neither of them are enabled, the other 7.4KB IRAM memory would be taken by this option. + Wi-Fi power-save mode average current would be reduced if this option is enabled. + +config WIFI_RMT_SLP_DEFAULT_MIN_ACTIVE_TIME + int "Minimum active time" + range 8 60 + default 50 + help + Only for station in WIFI_PS_MIN_MODEM or WIFI_PS_MAX_MODEM. When the station enters the active state, + it will work for at least WIFI_RMT_SLP_DEFAULT_MIN_ACTIVE_TIME. If a data packet is received or sent + during this period, the time will be refreshed. If the time is up, but the station still has packets + to receive or send, the time will also be refreshed. unit: milliseconds. + +config WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME + int "Maximum keep alive time" + range 10 60 + default 10 + help + Only for station in WIFI_PS_MIN_MODEM or WIFI_PS_MAX_MODEM. If no packet has been + sent within WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME, a null data packet will be sent + to maintain the connection with the AP. unit: seconds. + +config WIFI_RMT_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME + int "Minimum wait broadcast data time" + range 10 30 + default 15 + help + Only for station in WIFI_PS_MIN_MODEM or WIFI_PS_MAX_MODEM. When the station knows through the beacon + that AP will send broadcast packet, it will wait for WIFI_RMT_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME + before entering the sleep process. If a broadcast packet is received with more data bits, the time + will refreshed. unit: milliseconds. + +config WIFI_RMT_FTM_ENABLE + bool "WiFi FTM" + default n + depends on SLAVE_SOC_WIFI_FTM_SUPPORT + help + Enable feature Fine Timing Measurement for calculating WiFi Round-Trip-Time (RTT). + +config WIFI_RMT_FTM_INITIATOR_SUPPORT + bool "FTM Initiator support" + default y + depends on WIFI_RMT_FTM_ENABLE + +config WIFI_RMT_FTM_RESPONDER_SUPPORT + bool "FTM Responder support" + default y + depends on WIFI_RMT_FTM_ENABLE + +config WIFI_RMT_STA_DISCONNECTED_PM_ENABLE + bool "Power Management for station at disconnected" + default y + help + Select this option to enable power_management for station when disconnected. + Chip will do modem-sleep when rf module is not in use any more. + +config WIFI_RMT_GCMP_SUPPORT + bool "WiFi GCMP Support(GCMP128 and GCMP256)" + default n + depends on SLAVE_SOC_WIFI_GCMP_SUPPORT + help + Select this option to enable GCMP support. GCMP support is compulsory for WiFi Suite-B support. + +config WIFI_RMT_GMAC_SUPPORT + bool "WiFi GMAC Support(GMAC128 and GMAC256)" + default y + help + Select this option to enable GMAC support. GMAC support is compulsory for WiFi 192 bit certification. + +config WIFI_RMT_SOFTAP_SUPPORT + bool "WiFi SoftAP Support" + default y + help + WiFi module can be compiled without SoftAP to save code size. + +config WIFI_RMT_ENHANCED_LIGHT_SLEEP + bool "WiFi modem automatically receives the beacon" + default n + depends on ESP_PHY_MAC_BB_PD && SOC_PM_SUPPORT_BEACON_WAKEUP + help + The wifi modem automatically receives the beacon frame during light sleep. + +config WIFI_RMT_SLP_BEACON_LOST_OPT + bool "Wifi sleep optimize when beacon lost" + help + Enable wifi sleep optimization when beacon loss occurs and immediately enter + sleep mode when the WiFi module detects beacon loss. + +config WIFI_RMT_SLP_BEACON_LOST_TIMEOUT + int "Beacon loss timeout" + range 5 100 + default 10 + depends on WIFI_RMT_SLP_BEACON_LOST_OPT + help + Timeout time for close rf phy when beacon loss occurs, Unit: 1024 microsecond. + +config WIFI_RMT_SLP_BEACON_LOST_THRESHOLD + int "Maximum number of consecutive lost beacons allowed" + range 0 8 + default 3 + depends on WIFI_RMT_SLP_BEACON_LOST_OPT + help + Maximum number of consecutive lost beacons allowed, WiFi keeps Rx state when + the number of consecutive beacons lost is greater than the given threshold. + +config WIFI_RMT_SLP_PHY_ON_DELTA_EARLY_TIME + int "Delta early time for RF PHY on" + range 0 100 + default 2 + depends on WIFI_RMT_SLP_BEACON_LOST_OPT && SLAVE_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW + help + Delta early time for rf phy on, When the beacon is lost, the next rf phy on will + be earlier the time specified by the configuration item, Unit: 32 microsecond. + +config WIFI_RMT_SLP_PHY_OFF_DELTA_TIMEOUT_TIME + int "Delta timeout time for RF PHY off" + range 0 8 + default 2 + depends on WIFI_RMT_SLP_BEACON_LOST_OPT && SLAVE_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW + help + Delta timeout time for rf phy off, When the beacon is lost, the next rf phy off will + be delayed for the time specified by the configuration item. Unit: 1024 microsecond. + +config WIFI_RMT_ESPNOW_MAX_ENCRYPT_NUM + int "Maximum espnow encrypt peers number" + range 0 4 if SLAVE_IDF_TARGET_ESP32C2 + range 0 17 if (!SLAVE_IDF_TARGET_ESP32C2) + default 2 if SLAVE_IDF_TARGET_ESP32C2 + default 7 if (!SLAVE_IDF_TARGET_ESP32C2) + help + Maximum number of encrypted peers supported by espnow. + The number of hardware keys for encryption is fixed. And the espnow and SoftAP share the same + hardware keys. So this configuration will affect the maximum connection number of SoftAP. + Maximum espnow encrypted peers number + maximum number of connections of SoftAP = Max hardware + keys number. When using ESP mesh, this value should be set to a maximum of 6. + +config WIFI_RMT_NAN_ENABLE + bool "WiFi Aware" + default n + depends on SLAVE_SOC_WIFI_NAN_SUPPORT + help + Enable WiFi Aware (NAN) feature. + +config WIFI_RMT_MBEDTLS_CRYPTO + bool "Use MbedTLS crypto APIs" + default y + select MBEDTLS_AES_C + select MBEDTLS_ECP_C + select MBEDTLS_ECDH_C + select MBEDTLS_ECDSA_C + select MBEDTLS_CMAC_C + select MBEDTLS_ECP_DP_SECP256R1_ENABLED + help + Select this option to enable the use of MbedTLS crypto APIs. + The internal crypto support within the supplicant is limited + and may not suffice for all new security features, including WPA3. + + It is recommended to always keep this option enabled. Additionally, + note that MbedTLS can leverage hardware acceleration if available, + resulting in significantly faster cryptographic operations. + +if WIFI_RMT_MBEDTLS_CRYPTO + config WIFI_RMT_MBEDTLS_TLS_CLIENT + bool "Use MbedTLS TLS client for WiFi Enterprise connection" + depends on WIFI_RMT_ENTERPRISE_SUPPORT + default y + select MBEDTLS_TLS_ENABLED + help + Select this option to use MbedTLS TLS client for WPA2 enterprise connection. + Please note that from MbedTLS-3.0 onwards, MbedTLS does not support SSL-3.0 + TLS-v1.0, TLS-v1.1 versions. In case your server is using one of these version, + it is advisable to update your server. + Please disable this option for compatibility with older TLS versions. + + config WIFI_RMT_EAP_TLS1_3 + bool "Enable EAP-TLS v1.3 Support for WiFi Enterprise connection" + default n + select MBEDTLS_SSL_PROTO_TLS1_3 + depends on WIFI_RMT_MBEDTLS_TLS_CLIENT && IDF_EXPERIMENTAL_FEATURES + help + Select this option to support EAP with TLS v1.3. + This configuration still supports compatibility with EAP-TLS v1.2. + Please note that enabling this configuration will cause every application which + uses TLS go for TLS1.3 if server supports that. TLS1.3 is still in development in mbedtls + and there may be interoperability issues with this. Please modify your application to set + max version as TLS1.2 if you want to enable TLS1.3 only for WiFi connection. + +endif + +config WIFI_RMT_WAPI_PSK + bool "Enable WAPI PSK support" + depends on SLAVE_SOC_WIFI_WAPI_SUPPORT + default n + help + Select this option to enable WAPI-PSK + which is a Chinese National Standard Encryption for Wireless LANs (GB 15629.11-2003). + +config WIFI_RMT_SUITE_B_192 + bool "Enable NSA suite B support with 192 bit key" + default n + depends on SLAVE_SOC_WIFI_GCMP_SUPPORT + select WIFI_RMT_GCMP_SUPPORT + select WIFI_RMT_GMAC_SUPPORT + help + Select this option to enable 192 bit NSA suite-B. + This is necessary to support WPA3 192 bit security. + +config WIFI_RMT_11KV_SUPPORT + bool "Enable 802.11k, 802.11v APIs Support" + default n + help + Select this option to enable 802.11k 802.11v APIs(RRM and BTM support). + +config WIFI_RMT_RRM_SUPPORT + bool "Enable 802.11k APIs Support" + depends on WIFI_RMT_11KV_SUPPORT + default y + help + Select this option to enable 802.11k APIs(RRM support). + Only APIs which are helpful for network assisted roaming + are supported for now. + Enable this option with RRM enabled in sta config + to make device ready for network assisted roaming. + RRM: Radio measurements enable STAs to understand the radio environment, + it enables STAs to observe and gather data on radio link performance + and on the radio environment. Current implementation adds beacon report, + link measurement, neighbor report. + +config WIFI_RMT_WNM_SUPPORT + bool "Enable 802.11v APIs Support" + depends on WIFI_RMT_11KV_SUPPORT + default y + help + Select this option to enable 802.11v APIs(BTM support). + Only APIs which are helpful for network assisted roaming + are supported for now. + Enable this option with BTM enabled in sta config + to make device ready for network assisted roaming. + BTM: BSS transition management enables an AP to request a station to transition + to a specific AP, or to indicate to a station a set of preferred APs. + +config WIFI_RMT_SCAN_CACHE + bool "Keep scan results in cache" + depends on WIFI_RMT_RRM_SUPPORT + default n + help + Keep scan results in cache, if not enabled, those + will be flushed immediately. + +config WIFI_RMT_MBO_SUPPORT + bool "Enable Multi Band Operation Certification Support" + default n + select WIFI_RMT_11KV_SUPPORT + select WIFI_RMT_RRM_SUPPORT + select WIFI_RMT_WNM_SUPPORT + select WIFI_RMT_SCAN_CACHE + help + Select this option to enable WiFi Multiband operation certification support. + +config WIFI_RMT_ENABLE_ROAMING_APP + bool "Advanced support for Wi-Fi Roaming (Experimental)" + depends on IDF_EXPERIMENTAL_FEATURES + default n + help + Enable Espressif's roaming app to allow for efficient Wi-Fi roaming. + This includes configurable periodic environment scans, maintaining a cache of the + best APs, handling low rssi events etc. + + Risk Warning + Please note that this feature is still experimental and enabling this potentially can + lead to unpredictable scanning, connection and roaming attempts. + We are still working on tuning and optimising this feature to ensure reliable and stable use. + +menu "Configure roaming App" + depends on WIFI_RMT_ENABLE_ROAMING_APP + rsource "wifi_apps/roaming_app/src/Kconfig.roaming" +endmenu + +config WIFI_RMT_DPP_SUPPORT + bool "Enable DPP support" + default n + select WIFI_RMT_MBEDTLS_CRYPTO + help + Select this option to enable WiFi Easy Connect Support. + +config WIFI_RMT_11R_SUPPORT + bool "Enable 802.11R (Fast Transition) Support" + default n + help + Select this option to enable WiFi Fast Transition Support. + +config WIFI_RMT_WPS_SOFTAP_REGISTRAR + bool "Add WPS Registrar support in SoftAP mode" + depends on WIFI_RMT_SOFTAP_SUPPORT + default n + help + Select this option to enable WPS registrar support in softAP mode. + +config WIFI_RMT_ENABLE_WIFI_TX_STATS + bool "Enable Wi-Fi transmission statistics" + depends on SLAVE_SOC_WIFI_HE_SUPPORT + default n + help + Enable Wi-Fi transmission statistics. Total support 4 access category. Each access category + will use 346 bytes memory. + +config WIFI_RMT_ENABLE_WIFI_RX_STATS + bool "Enable Wi-Fi reception statistics" + depends on SLAVE_SOC_WIFI_HE_SUPPORT + default n + help + Enable Wi-Fi reception statistics. Total support 2 access category. Each access category + will use 190 bytes memory. + +config WIFI_RMT_ENABLE_WIFI_RX_MU_STATS + bool "Enable Wi-Fi DL MU-MIMO and DL OFDMA reception statistics" + depends on WIFI_RMT_ENABLE_WIFI_RX_STATS + default n + help + Enable Wi-Fi DL MU-MIMO and DL OFDMA reception statistics. Will use 10932 bytes memory. + +config WIFI_RMT_TX_HETB_QUEUE_NUM + int "WiFi TX HE TB QUEUE number for STA HE TB PPDU transmission" + depends on SLAVE_SOC_WIFI_HE_SUPPORT + range 1 4 + default 3 + help + Set the maximum number of queue that can be aggregated by the STA in the A-MPDU carried in the + HE TB PPDU. + +config WIFI_RMT_ENABLE_DUMP_HESIGB + bool "Enable Wi-Fi dump HE-SIGB which is contained in DL HE MU PPDUs" + depends on SLAVE_SOC_WIFI_SUPPORT_5G + default "n" + help + Enable Wi-Fi dump HE-SIGB which is contained in DL HE MU PPDUs. + +config WIFI_RMT_ENABLE_DUMP_MU_CFO + bool "Enable Wi-Fi dump MU CFO" + depends on SLAVE_SOC_WIFI_SUPPORT_5G + default "n" + help + Enable Wi-Fi dump MU CFO. + +config WIFI_RMT_ENABLE_DUMP_CTRL_NDPA + bool "Enable Wi-Fi dump NDPA frames" + depends on SLAVE_SOC_WIFI_SUPPORT_5G + default "n" + help + Enable Wi-Fi dump NDPA frames. + +config WIFI_RMT_ENABLE_DUMP_CTRL_BFRP + bool "Enable Wi-Fi dump BFRP frames" + depends on SLAVE_SOC_WIFI_SUPPORT_5G + default "n" + help + Enable Wi-Fi dump BFRP frames. + +menu "WPS Configuration Options" + config WIFI_RMT_WPS_STRICT + bool "Strictly validate all WPS attributes" + default n + help + Select this option to enable validate each WPS attribute + rigorously. Disabling this add the workarounds with various APs. + Enabling this may cause inter operability issues with some APs. + + config WIFI_RMT_WPS_PASSPHRASE + bool "Get WPA2 passphrase in WPS config" + default n + help + Select this option to get passphrase during WPS configuration. + This option fakes the virtual display capabilities to get the + configuration in passphrase mode. + Not recommended to be used since WPS credentials should not + be shared to other devices, making it in readable format increases + that risk, also passphrase requires pbkdf2 to convert in psk. + +endmenu # "WPS Configuration Options" + + +config WIFI_RMT_DEBUG_PRINT + bool "Print debug messages from WPA Supplicant" + default n + help + Select this option to print logging information from WPA supplicant, + this includes handshake information and key hex dumps depending + on the project logging level. + + Enabling this could increase the build size ~60kb + depending on the project logging level. + +config WIFI_RMT_TESTING_OPTIONS + bool "Add DPP testing code" + default n + help + Select this to enable unity test for DPP. + +config WIFI_RMT_ENTERPRISE_SUPPORT + bool "Enable enterprise option" + default y + help + Select this to enable/disable enterprise connection support. + + disabling this will reduce binary size. + disabling this will disable the use of any esp_wifi_sta_wpa2_ent_* (as APIs will be meaningless) + + Note that when using bigger certificates on low-power chips without crypto + hardware acceleration, it is recommended to adjust the task watchdog timer (TWDT) + if it is enabled. For precise information on timing requirements, you can check + performance numbers at https://github.com/espressif/mbedtls/wiki/Performance-Numbers. + +config WIFI_RMT_ENT_FREE_DYNAMIC_BUFFER + bool "Free dynamic buffers during WiFi enterprise connection" + depends on WIFI_RMT_ENTERPRISE_SUPPORT + default y if SLAVE_IDF_TARGET_ESP32C2 + default n if !SLAVE_IDF_TARGET_ESP32C2 + help + Select this configuration to free dynamic buffers during WiFi enterprise connection. + This will enable chip to reduce heap consumption during WiFi enterprise connection. + +if !ESP_WIFI_ENABLED + config ESP_WIFI_STATIC_RX_BUFFER_NUM # ignore: multiple-definition + int + default WIFI_RMT_STATIC_RX_BUFFER_NUM + + config ESP_WIFI_DYNAMIC_RX_BUFFER_NUM # ignore: multiple-definition + int + default WIFI_RMT_DYNAMIC_RX_BUFFER_NUM + + config ESP_WIFI_TX_BUFFER_TYPE # ignore: multiple-definition + int + default WIFI_RMT_TX_BUFFER_TYPE + + config ESP_WIFI_STATIC_TX_BUFFER_NUM # ignore: multiple-definition + int + depends on WIFI_RMT_STATIC_TX_BUFFER + default WIFI_RMT_STATIC_TX_BUFFER_NUM + + config ESP_WIFI_CACHE_TX_BUFFER_NUM # ignore: multiple-definition + int + depends on (SPIRAM_TRY_ALLOCATE_WIFI_LWIP && !SPIRAM_IGNORE_NOTFOUND) + default WIFI_RMT_CACHE_TX_BUFFER_NUM + + config ESP_WIFI_DYNAMIC_TX_BUFFER_NUM # ignore: multiple-definition + int + depends on WIFI_RMT_DYNAMIC_TX_BUFFER + default WIFI_RMT_DYNAMIC_TX_BUFFER_NUM + + config ESP_WIFI_DYNAMIC_RX_MGMT_BUF # ignore: multiple-definition + int + default WIFI_RMT_DYNAMIC_RX_MGMT_BUF + + config ESP_WIFI_RX_MGMT_BUF_NUM_DEF # ignore: multiple-definition + int + default WIFI_RMT_RX_MGMT_BUF_NUM_DEF + +if WIFI_RMT_CSI_ENABLED + config ESP_WIFI_CSI_ENABLED # ignore: multiple-definition + bool + depends on SLAVE_SOC_WIFI_CSI_SUPPORT + default WIFI_RMT_CSI_ENABLED +endif + +if WIFI_RMT_AMPDU_TX_ENABLED + config ESP_WIFI_AMPDU_TX_ENABLED # ignore: multiple-definition + bool + default WIFI_RMT_AMPDU_TX_ENABLED +endif + + config ESP_WIFI_TX_BA_WIN # ignore: multiple-definition + int + depends on WIFI_RMT_AMPDU_TX_ENABLED + default WIFI_RMT_TX_BA_WIN + +if WIFI_RMT_AMPDU_RX_ENABLED + config ESP_WIFI_AMPDU_RX_ENABLED # ignore: multiple-definition + bool + default WIFI_RMT_AMPDU_RX_ENABLED +endif + + config ESP_WIFI_RX_BA_WIN # ignore: multiple-definition + int + depends on WIFI_RMT_AMPDU_RX_ENABLED + default WIFI_RMT_RX_BA_WIN + +if WIFI_RMT_AMSDU_TX_ENABLED + config ESP_WIFI_AMSDU_TX_ENABLED # ignore: multiple-definition + bool + depends on (WIFI_RMT_CACHE_TX_BUFFER_NUM >= 2) + default WIFI_RMT_AMSDU_TX_ENABLED +endif + +if WIFI_RMT_NVS_ENABLED + config ESP_WIFI_NVS_ENABLED # ignore: multiple-definition + bool + default WIFI_RMT_NVS_ENABLED +endif + + config ESP_WIFI_SOFTAP_BEACON_MAX_LEN # ignore: multiple-definition + int + default WIFI_RMT_SOFTAP_BEACON_MAX_LEN + + config ESP_WIFI_MGMT_SBUF_NUM # ignore: multiple-definition + int + default WIFI_RMT_MGMT_SBUF_NUM + +if WIFI_RMT_IRAM_OPT + config ESP_WIFI_IRAM_OPT # ignore: multiple-definition + bool + default WIFI_RMT_IRAM_OPT +endif + +if WIFI_RMT_EXTRA_IRAM_OPT + config ESP_WIFI_EXTRA_IRAM_OPT # ignore: multiple-definition + bool + default WIFI_RMT_EXTRA_IRAM_OPT +endif + +if WIFI_RMT_RX_IRAM_OPT + config ESP_WIFI_RX_IRAM_OPT # ignore: multiple-definition + bool + default WIFI_RMT_RX_IRAM_OPT +endif + +if WIFI_RMT_ENABLE_WPA3_SAE + config ESP_WIFI_ENABLE_WPA3_SAE # ignore: multiple-definition + bool + default WIFI_RMT_ENABLE_WPA3_SAE +endif + +if WIFI_RMT_ENABLE_SAE_PK + config ESP_WIFI_ENABLE_SAE_PK # ignore: multiple-definition + bool + depends on WIFI_RMT_ENABLE_WPA3_SAE + default WIFI_RMT_ENABLE_SAE_PK +endif + +if WIFI_RMT_SOFTAP_SAE_SUPPORT + config ESP_WIFI_SOFTAP_SAE_SUPPORT # ignore: multiple-definition + bool + depends on WIFI_RMT_SOFTAP_SUPPORT + default WIFI_RMT_SOFTAP_SAE_SUPPORT +endif + +if WIFI_RMT_ENABLE_WPA3_OWE_STA + config ESP_WIFI_ENABLE_WPA3_OWE_STA # ignore: multiple-definition + bool + default WIFI_RMT_ENABLE_WPA3_OWE_STA +endif + +if WIFI_RMT_SLP_IRAM_OPT + config ESP_WIFI_SLP_IRAM_OPT # ignore: multiple-definition + bool + default WIFI_RMT_SLP_IRAM_OPT +endif + + config ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME # ignore: multiple-definition + int + default WIFI_RMT_SLP_DEFAULT_MIN_ACTIVE_TIME + + config ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME # ignore: multiple-definition + int + default WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME + + config ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME # ignore: multiple-definition + int + default WIFI_RMT_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME + +if WIFI_RMT_FTM_ENABLE + config ESP_WIFI_FTM_ENABLE # ignore: multiple-definition + bool + depends on SLAVE_SOC_WIFI_FTM_SUPPORT + default WIFI_RMT_FTM_ENABLE +endif + +if WIFI_RMT_FTM_INITIATOR_SUPPORT + config ESP_WIFI_FTM_INITIATOR_SUPPORT # ignore: multiple-definition + bool + depends on WIFI_RMT_FTM_ENABLE + default WIFI_RMT_FTM_INITIATOR_SUPPORT +endif + +if WIFI_RMT_FTM_RESPONDER_SUPPORT + config ESP_WIFI_FTM_RESPONDER_SUPPORT # ignore: multiple-definition + bool + depends on WIFI_RMT_FTM_ENABLE + default WIFI_RMT_FTM_RESPONDER_SUPPORT +endif + +if WIFI_RMT_STA_DISCONNECTED_PM_ENABLE + config ESP_WIFI_STA_DISCONNECTED_PM_ENABLE # ignore: multiple-definition + bool + default WIFI_RMT_STA_DISCONNECTED_PM_ENABLE +endif + +if WIFI_RMT_GCMP_SUPPORT + config ESP_WIFI_GCMP_SUPPORT # ignore: multiple-definition + bool + depends on SLAVE_SOC_WIFI_GCMP_SUPPORT + default WIFI_RMT_GCMP_SUPPORT +endif + +if WIFI_RMT_GMAC_SUPPORT + config ESP_WIFI_GMAC_SUPPORT # ignore: multiple-definition + bool + default WIFI_RMT_GMAC_SUPPORT +endif + +if WIFI_RMT_SOFTAP_SUPPORT + config ESP_WIFI_SOFTAP_SUPPORT # ignore: multiple-definition + bool + default WIFI_RMT_SOFTAP_SUPPORT +endif + +if WIFI_RMT_ENHANCED_LIGHT_SLEEP + config ESP_WIFI_ENHANCED_LIGHT_SLEEP # ignore: multiple-definition + bool + depends on ESP_PHY_MAC_BB_PD && SOC_PM_SUPPORT_BEACON_WAKEUP + default WIFI_RMT_ENHANCED_LIGHT_SLEEP +endif + +if WIFI_RMT_SLP_BEACON_LOST_OPT + config ESP_WIFI_SLP_BEACON_LOST_OPT # ignore: multiple-definition + bool + default WIFI_RMT_SLP_BEACON_LOST_OPT +endif + + config ESP_WIFI_SLP_BEACON_LOST_TIMEOUT # ignore: multiple-definition + int + depends on WIFI_RMT_SLP_BEACON_LOST_OPT + default WIFI_RMT_SLP_BEACON_LOST_TIMEOUT + + config ESP_WIFI_SLP_BEACON_LOST_THRESHOLD # ignore: multiple-definition + int + depends on WIFI_RMT_SLP_BEACON_LOST_OPT + default WIFI_RMT_SLP_BEACON_LOST_THRESHOLD + + config ESP_WIFI_SLP_PHY_ON_DELTA_EARLY_TIME # ignore: multiple-definition + int + depends on WIFI_RMT_SLP_BEACON_LOST_OPT && SLAVE_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW + default WIFI_RMT_SLP_PHY_ON_DELTA_EARLY_TIME + + config ESP_WIFI_SLP_PHY_OFF_DELTA_TIMEOUT_TIME # ignore: multiple-definition + int + depends on WIFI_RMT_SLP_BEACON_LOST_OPT && SLAVE_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW + default WIFI_RMT_SLP_PHY_OFF_DELTA_TIMEOUT_TIME + + config ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM # ignore: multiple-definition + int + default WIFI_RMT_ESPNOW_MAX_ENCRYPT_NUM + +if WIFI_RMT_NAN_ENABLE + config ESP_WIFI_NAN_ENABLE # ignore: multiple-definition + bool + depends on SLAVE_SOC_WIFI_NAN_SUPPORT + default WIFI_RMT_NAN_ENABLE +endif + +if WIFI_RMT_MBEDTLS_CRYPTO + config ESP_WIFI_MBEDTLS_CRYPTO # ignore: multiple-definition + bool + default WIFI_RMT_MBEDTLS_CRYPTO +endif + +if WIFI_RMT_MBEDTLS_TLS_CLIENT + config ESP_WIFI_MBEDTLS_TLS_CLIENT # ignore: multiple-definition + bool + depends on WIFI_RMT_ENTERPRISE_SUPPORT + default WIFI_RMT_MBEDTLS_TLS_CLIENT +endif + +if WIFI_RMT_EAP_TLS1_3 + config ESP_WIFI_EAP_TLS1_3 # ignore: multiple-definition + bool + depends on WIFI_RMT_MBEDTLS_TLS_CLIENT && IDF_EXPERIMENTAL_FEATURES + default WIFI_RMT_EAP_TLS1_3 +endif + +if WIFI_RMT_WAPI_PSK + config ESP_WIFI_WAPI_PSK # ignore: multiple-definition + bool + depends on SLAVE_SOC_WIFI_WAPI_SUPPORT + default WIFI_RMT_WAPI_PSK +endif + +if WIFI_RMT_SUITE_B_192 + config ESP_WIFI_SUITE_B_192 # ignore: multiple-definition + bool + depends on SLAVE_SOC_WIFI_GCMP_SUPPORT + default WIFI_RMT_SUITE_B_192 +endif + +if WIFI_RMT_11KV_SUPPORT + config ESP_WIFI_11KV_SUPPORT # ignore: multiple-definition + bool + default WIFI_RMT_11KV_SUPPORT +endif + +if WIFI_RMT_RRM_SUPPORT + config ESP_WIFI_RRM_SUPPORT # ignore: multiple-definition + bool + depends on WIFI_RMT_11KV_SUPPORT + default WIFI_RMT_RRM_SUPPORT +endif + +if WIFI_RMT_WNM_SUPPORT + config ESP_WIFI_WNM_SUPPORT # ignore: multiple-definition + bool + depends on WIFI_RMT_11KV_SUPPORT + default WIFI_RMT_WNM_SUPPORT +endif + +if WIFI_RMT_SCAN_CACHE + config ESP_WIFI_SCAN_CACHE # ignore: multiple-definition + bool + depends on WIFI_RMT_RRM_SUPPORT + default WIFI_RMT_SCAN_CACHE +endif + +if WIFI_RMT_MBO_SUPPORT + config ESP_WIFI_MBO_SUPPORT # ignore: multiple-definition + bool + default WIFI_RMT_MBO_SUPPORT +endif + +if WIFI_RMT_ENABLE_ROAMING_APP + config ESP_WIFI_ENABLE_ROAMING_APP # ignore: multiple-definition + bool + depends on IDF_EXPERIMENTAL_FEATURES + default WIFI_RMT_ENABLE_ROAMING_APP +endif + +if WIFI_RMT_DPP_SUPPORT + config ESP_WIFI_DPP_SUPPORT # ignore: multiple-definition + bool + default WIFI_RMT_DPP_SUPPORT +endif + +if WIFI_RMT_11R_SUPPORT + config ESP_WIFI_11R_SUPPORT # ignore: multiple-definition + bool + default WIFI_RMT_11R_SUPPORT +endif + +if WIFI_RMT_WPS_SOFTAP_REGISTRAR + config ESP_WIFI_WPS_SOFTAP_REGISTRAR # ignore: multiple-definition + bool + depends on WIFI_RMT_SOFTAP_SUPPORT + default WIFI_RMT_WPS_SOFTAP_REGISTRAR +endif + +if WIFI_RMT_ENABLE_WIFI_TX_STATS + config ESP_WIFI_ENABLE_WIFI_TX_STATS # ignore: multiple-definition + bool + depends on SLAVE_SOC_WIFI_HE_SUPPORT + default WIFI_RMT_ENABLE_WIFI_TX_STATS +endif + +if WIFI_RMT_ENABLE_WIFI_RX_STATS + config ESP_WIFI_ENABLE_WIFI_RX_STATS # ignore: multiple-definition + bool + depends on SLAVE_SOC_WIFI_HE_SUPPORT + default WIFI_RMT_ENABLE_WIFI_RX_STATS +endif + +if WIFI_RMT_ENABLE_WIFI_RX_MU_STATS + config ESP_WIFI_ENABLE_WIFI_RX_MU_STATS # ignore: multiple-definition + bool + depends on WIFI_RMT_ENABLE_WIFI_RX_STATS + default WIFI_RMT_ENABLE_WIFI_RX_MU_STATS +endif + + config ESP_WIFI_TX_HETB_QUEUE_NUM # ignore: multiple-definition + int + depends on SLAVE_SOC_WIFI_HE_SUPPORT + default WIFI_RMT_TX_HETB_QUEUE_NUM + +if WIFI_RMT_ENABLE_DUMP_HESIGB + config ESP_WIFI_ENABLE_DUMP_HESIGB # ignore: multiple-definition + bool + depends on SLAVE_SOC_WIFI_SUPPORT_5G + default WIFI_RMT_ENABLE_DUMP_HESIGB +endif + +if WIFI_RMT_ENABLE_DUMP_MU_CFO + config ESP_WIFI_ENABLE_DUMP_MU_CFO # ignore: multiple-definition + bool + depends on SLAVE_SOC_WIFI_SUPPORT_5G + default WIFI_RMT_ENABLE_DUMP_MU_CFO +endif + +if WIFI_RMT_ENABLE_DUMP_CTRL_NDPA + config ESP_WIFI_ENABLE_DUMP_CTRL_NDPA # ignore: multiple-definition + bool + depends on SLAVE_SOC_WIFI_SUPPORT_5G + default WIFI_RMT_ENABLE_DUMP_CTRL_NDPA +endif + +if WIFI_RMT_ENABLE_DUMP_CTRL_BFRP + config ESP_WIFI_ENABLE_DUMP_CTRL_BFRP # ignore: multiple-definition + bool + depends on SLAVE_SOC_WIFI_SUPPORT_5G + default WIFI_RMT_ENABLE_DUMP_CTRL_BFRP +endif + +if WIFI_RMT_WPS_STRICT + config ESP_WIFI_WPS_STRICT # ignore: multiple-definition + bool + default WIFI_RMT_WPS_STRICT +endif + +if WIFI_RMT_WPS_PASSPHRASE + config ESP_WIFI_WPS_PASSPHRASE # ignore: multiple-definition + bool + default WIFI_RMT_WPS_PASSPHRASE +endif + +if WIFI_RMT_DEBUG_PRINT + config ESP_WIFI_DEBUG_PRINT # ignore: multiple-definition + bool + default WIFI_RMT_DEBUG_PRINT +endif + +if WIFI_RMT_TESTING_OPTIONS + config ESP_WIFI_TESTING_OPTIONS # ignore: multiple-definition + bool + default WIFI_RMT_TESTING_OPTIONS +endif + +if WIFI_RMT_ENTERPRISE_SUPPORT + config ESP_WIFI_ENTERPRISE_SUPPORT # ignore: multiple-definition + bool + default WIFI_RMT_ENTERPRISE_SUPPORT +endif + +if WIFI_RMT_ENT_FREE_DYNAMIC_BUFFER + config ESP_WIFI_ENT_FREE_DYNAMIC_BUFFER # ignore: multiple-definition + bool + depends on WIFI_RMT_ENTERPRISE_SUPPORT + default WIFI_RMT_ENT_FREE_DYNAMIC_BUFFER +endif + +endif # ESP_WIFI_ENABLED +# Wi-Fi configuration end diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/esp_eap_client_remote_weak.c b/components/esp_wifi_remote/idf_tag_v5.4.2/esp_eap_client_remote_weak.c new file mode 100644 index 0000000..52a9cc2 --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/esp_eap_client_remote_weak.c @@ -0,0 +1,123 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +// This file is auto-generated +#include "esp_eap_client_remote_api.h" +#include "esp_log.h" + +#define WEAK __attribute__((weak)) +#define LOG_UNSUPPORTED_AND_RETURN(ret) ESP_LOGW("esp_eap_client_remote_weak", "%s unsupported", __func__); \ + return ret; +#define LOG_UNSUPPORTED_VOID() ESP_LOGW("esp_eap_client_remote_weak", "%s unsupported", __func__); + +WEAK esp_err_t esp_wifi_remote_sta_enterprise_enable(void) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_sta_enterprise_disable(void) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_eap_client_remote_set_identity(const unsigned char *identity, int len) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK void esp_eap_client_remote_clear_identity(void) +{ + LOG_UNSUPPORTED_VOID(); +} + +WEAK esp_err_t esp_eap_client_remote_set_username(const unsigned char *username, int len) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK void esp_eap_client_remote_clear_username(void) +{ + LOG_UNSUPPORTED_VOID(); +} + +WEAK esp_err_t esp_eap_client_remote_set_password(const unsigned char *password, int len) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK void esp_eap_client_remote_clear_password(void) +{ + LOG_UNSUPPORTED_VOID(); +} + +WEAK esp_err_t esp_eap_client_remote_set_new_password(const unsigned char *new_password, int len) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK void esp_eap_client_remote_clear_new_password(void) +{ + LOG_UNSUPPORTED_VOID(); +} + +WEAK esp_err_t esp_eap_client_remote_set_ca_cert(const unsigned char *ca_cert, int ca_cert_len) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK void esp_eap_client_remote_clear_ca_cert(void) +{ + LOG_UNSUPPORTED_VOID(); +} + +WEAK esp_err_t esp_eap_client_remote_set_certificate_and_key(const unsigned char *client_cert, int client_cert_len, const unsigned char *private_key, int private_key_len, const unsigned char *private_key_password, int private_key_passwd_len) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK void esp_eap_client_remote_clear_certificate_and_key(void) +{ + LOG_UNSUPPORTED_VOID(); +} + +WEAK esp_err_t esp_eap_client_remote_set_disable_time_check(_Bool disable) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_eap_client_remote_get_disable_time_check(_Bool *disable) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_eap_client_remote_set_ttls_phase2_method(esp_eap_ttls_phase2_types type) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_eap_client_remote_set_suiteb_192bit_certification(_Bool enable) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_eap_client_remote_set_pac_file(const unsigned char *pac_file, int pac_file_len) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_eap_client_remote_set_fast_params(esp_eap_fast_config config) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_eap_client_remote_use_default_cert_bundle(_Bool use_default_bundle) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_eap_client_remote_set_domain_name(const char *domain_name) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/esp_eap_client_with_remote.c b/components/esp_wifi_remote/idf_tag_v5.4.2/esp_eap_client_with_remote.c new file mode 100644 index 0000000..d39f1ae --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/esp_eap_client_with_remote.c @@ -0,0 +1,118 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +// This file is auto-generated +#include "esp_eap_client.h" +#include "esp_eap_client_remote_api.h" + +esp_err_t esp_wifi_sta_enterprise_enable(void) +{ + return esp_wifi_remote_sta_enterprise_enable(); +} + +esp_err_t esp_wifi_sta_enterprise_disable(void) +{ + return esp_wifi_remote_sta_enterprise_disable(); +} + +esp_err_t esp_eap_client_set_identity(const unsigned char *identity, int len) +{ + return esp_eap_client_remote_set_identity(identity, len); +} + +void esp_eap_client_clear_identity(void) +{ + esp_eap_client_remote_clear_identity(); +} + +esp_err_t esp_eap_client_set_username(const unsigned char *username, int len) +{ + return esp_eap_client_remote_set_username(username, len); +} + +void esp_eap_client_clear_username(void) +{ + esp_eap_client_remote_clear_username(); +} + +esp_err_t esp_eap_client_set_password(const unsigned char *password, int len) +{ + return esp_eap_client_remote_set_password(password, len); +} + +void esp_eap_client_clear_password(void) +{ + esp_eap_client_remote_clear_password(); +} + +esp_err_t esp_eap_client_set_new_password(const unsigned char *new_password, int len) +{ + return esp_eap_client_remote_set_new_password(new_password, len); +} + +void esp_eap_client_clear_new_password(void) +{ + esp_eap_client_remote_clear_new_password(); +} + +esp_err_t esp_eap_client_set_ca_cert(const unsigned char *ca_cert, int ca_cert_len) +{ + return esp_eap_client_remote_set_ca_cert(ca_cert, ca_cert_len); +} + +void esp_eap_client_clear_ca_cert(void) +{ + esp_eap_client_remote_clear_ca_cert(); +} + +esp_err_t esp_eap_client_set_certificate_and_key(const unsigned char *client_cert, int client_cert_len, const unsigned char *private_key, int private_key_len, const unsigned char *private_key_password, int private_key_passwd_len) +{ + return esp_eap_client_remote_set_certificate_and_key(client_cert, client_cert_len, private_key, private_key_len, private_key_password, private_key_passwd_len); +} + +void esp_eap_client_clear_certificate_and_key(void) +{ + esp_eap_client_remote_clear_certificate_and_key(); +} + +esp_err_t esp_eap_client_set_disable_time_check(_Bool disable) +{ + return esp_eap_client_remote_set_disable_time_check(disable); +} + +esp_err_t esp_eap_client_get_disable_time_check(_Bool *disable) +{ + return esp_eap_client_remote_get_disable_time_check(disable); +} + +esp_err_t esp_eap_client_set_ttls_phase2_method(esp_eap_ttls_phase2_types type) +{ + return esp_eap_client_remote_set_ttls_phase2_method(type); +} + +esp_err_t esp_eap_client_set_suiteb_192bit_certification(_Bool enable) +{ + return esp_eap_client_remote_set_suiteb_192bit_certification(enable); +} + +esp_err_t esp_eap_client_set_pac_file(const unsigned char *pac_file, int pac_file_len) +{ + return esp_eap_client_remote_set_pac_file(pac_file, pac_file_len); +} + +esp_err_t esp_eap_client_set_fast_params(esp_eap_fast_config config) +{ + return esp_eap_client_remote_set_fast_params(config); +} + +esp_err_t esp_eap_client_use_default_cert_bundle(_Bool use_default_bundle) +{ + return esp_eap_client_remote_use_default_cert_bundle(use_default_bundle); +} + +esp_err_t esp_eap_client_set_domain_name(const char *domain_name) +{ + return esp_eap_client_remote_set_domain_name(domain_name); +} diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/esp_wifi_remote_weak.c b/components/esp_wifi_remote/idf_tag_v5.4.2/esp_wifi_remote_weak.c new file mode 100644 index 0000000..f71697b --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/esp_wifi_remote_weak.c @@ -0,0 +1,437 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +// This file is auto-generated +#include "esp_wifi_remote.h" +#include "esp_log.h" + +#define WEAK __attribute__((weak)) +#define LOG_UNSUPPORTED_AND_RETURN(ret) ESP_LOGW("esp_wifi_remote_weak", "%s unsupported", __func__); \ + return ret; + +WEAK esp_err_t esp_wifi_remote_init(const wifi_init_config_t *config) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_deinit(void) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_mode(wifi_mode_t mode) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_mode(wifi_mode_t *mode) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_start(void) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_stop(void) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_restore(void) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_connect(void) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_disconnect(void) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_clear_fast_connect(void) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_deauth_sta(uint16_t aid) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_scan_start(const wifi_scan_config_t *config, _Bool block) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_scan_parameters(const wifi_scan_default_params_t *config) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_scan_parameters(wifi_scan_default_params_t *config) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_scan_stop(void) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_scan_get_ap_num(uint16_t *number) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_scan_get_ap_record(wifi_ap_record_t *ap_record) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_clear_ap_list(void) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_sta_get_ap_info(wifi_ap_record_t *ap_info) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_ps(wifi_ps_type_t type) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_ps(wifi_ps_type_t *type) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_channel(uint8_t primary, wifi_second_chan_t second) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_channel(uint8_t *primary, wifi_second_chan_t *second) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_country(const wifi_country_t *country) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_country(wifi_country_t *country) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_mac(wifi_interface_t ifx, const uint8_t mac[6]) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_mac(wifi_interface_t ifx, uint8_t mac[6]) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_promiscuous_rx_cb(wifi_promiscuous_cb_t cb) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_promiscuous(_Bool en) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_promiscuous(_Bool *en) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_promiscuous_filter(const wifi_promiscuous_filter_t *filter) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_promiscuous_filter(wifi_promiscuous_filter_t *filter) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_promiscuous_ctrl_filter(const wifi_promiscuous_filter_t *filter) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_promiscuous_ctrl_filter(wifi_promiscuous_filter_t *filter) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_config(wifi_interface_t interface, wifi_config_t *conf) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_config(wifi_interface_t interface, wifi_config_t *conf) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_ap_get_sta_list(wifi_sta_list_t *sta) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_ap_get_sta_aid(const uint8_t mac[6], uint16_t *aid) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_storage(wifi_storage_t storage) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_vendor_ie(_Bool enable, wifi_vendor_ie_type_t type, wifi_vendor_ie_id_t idx, const void *vnd_ie) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_max_tx_power(int8_t power) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_max_tx_power(int8_t *power) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_event_mask(uint32_t mask) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_event_mask(uint32_t *mask) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_80211_tx(wifi_interface_t ifx, const void *buffer, int len, _Bool en_sys_seq) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_csi_rx_cb(wifi_csi_cb_t cb, void *ctx) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_csi_config(const wifi_csi_config_t *config) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_csi_config(wifi_csi_config_t *config) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_csi(_Bool en) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK int64_t esp_wifi_remote_get_tsf_time(wifi_interface_t interface) +{ + LOG_UNSUPPORTED_AND_RETURN(-1); +} + +WEAK esp_err_t esp_wifi_remote_set_inactive_time(wifi_interface_t ifx, uint16_t sec) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_inactive_time(wifi_interface_t ifx, uint16_t *sec) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_statis_dump(uint32_t modules) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_rssi_threshold(int32_t rssi) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_ftm_initiate_session(wifi_ftm_initiator_cfg_t *cfg) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_ftm_end_session(void) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_ftm_resp_set_offset(int16_t offset_cm) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_ftm_get_report(wifi_ftm_report_entry_t *report, uint8_t num_entries) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_config_11b_rate(wifi_interface_t ifx, _Bool disable) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_connectionless_module_set_wake_interval(uint16_t wake_interval) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_force_wakeup_acquire(void) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_force_wakeup_release(void) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_country_code(const char *country, _Bool ieee80211d_enabled) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_country_code(char *country) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_config_80211_tx_rate(wifi_interface_t ifx, wifi_phy_rate_t rate) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_config_80211_tx(wifi_interface_t ifx, wifi_tx_rate_config_t *config) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_disable_pmf_config(wifi_interface_t ifx) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_sta_get_aid(uint16_t *aid) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_dynamic_cs(_Bool enabled) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_sta_get_rssi(int *rssi) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_band(wifi_band_t band) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_band(wifi_band_t *band) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_band_mode(wifi_band_mode_t band_mode) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_band_mode(wifi_band_mode_t *band_mode) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_set_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_get_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/esp_wifi_with_remote.c b/components/esp_wifi_remote/idf_tag_v5.4.2/esp_wifi_with_remote.c new file mode 100644 index 0000000..60fe08b --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/esp_wifi_with_remote.c @@ -0,0 +1,433 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +// This file is auto-generated +#include "esp_wifi.h" +#include "esp_wifi_remote.h" + +esp_err_t esp_wifi_init(const wifi_init_config_t *config) +{ + return esp_wifi_remote_init(config); +} + +esp_err_t esp_wifi_deinit(void) +{ + return esp_wifi_remote_deinit(); +} + +esp_err_t esp_wifi_set_mode(wifi_mode_t mode) +{ + return esp_wifi_remote_set_mode(mode); +} + +esp_err_t esp_wifi_get_mode(wifi_mode_t *mode) +{ + return esp_wifi_remote_get_mode(mode); +} + +esp_err_t esp_wifi_start(void) +{ + return esp_wifi_remote_start(); +} + +esp_err_t esp_wifi_stop(void) +{ + return esp_wifi_remote_stop(); +} + +esp_err_t esp_wifi_restore(void) +{ + return esp_wifi_remote_restore(); +} + +esp_err_t esp_wifi_connect(void) +{ + return esp_wifi_remote_connect(); +} + +esp_err_t esp_wifi_disconnect(void) +{ + return esp_wifi_remote_disconnect(); +} + +esp_err_t esp_wifi_clear_fast_connect(void) +{ + return esp_wifi_remote_clear_fast_connect(); +} + +esp_err_t esp_wifi_deauth_sta(uint16_t aid) +{ + return esp_wifi_remote_deauth_sta(aid); +} + +esp_err_t esp_wifi_scan_start(const wifi_scan_config_t *config, _Bool block) +{ + return esp_wifi_remote_scan_start(config, block); +} + +esp_err_t esp_wifi_set_scan_parameters(const wifi_scan_default_params_t *config) +{ + return esp_wifi_remote_set_scan_parameters(config); +} + +esp_err_t esp_wifi_get_scan_parameters(wifi_scan_default_params_t *config) +{ + return esp_wifi_remote_get_scan_parameters(config); +} + +esp_err_t esp_wifi_scan_stop(void) +{ + return esp_wifi_remote_scan_stop(); +} + +esp_err_t esp_wifi_scan_get_ap_num(uint16_t *number) +{ + return esp_wifi_remote_scan_get_ap_num(number); +} + +esp_err_t esp_wifi_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records) +{ + return esp_wifi_remote_scan_get_ap_records(number, ap_records); +} + +esp_err_t esp_wifi_scan_get_ap_record(wifi_ap_record_t *ap_record) +{ + return esp_wifi_remote_scan_get_ap_record(ap_record); +} + +esp_err_t esp_wifi_clear_ap_list(void) +{ + return esp_wifi_remote_clear_ap_list(); +} + +esp_err_t esp_wifi_sta_get_ap_info(wifi_ap_record_t *ap_info) +{ + return esp_wifi_remote_sta_get_ap_info(ap_info); +} + +esp_err_t esp_wifi_set_ps(wifi_ps_type_t type) +{ + return esp_wifi_remote_set_ps(type); +} + +esp_err_t esp_wifi_get_ps(wifi_ps_type_t *type) +{ + return esp_wifi_remote_get_ps(type); +} + +esp_err_t esp_wifi_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap) +{ + return esp_wifi_remote_set_protocol(ifx, protocol_bitmap); +} + +esp_err_t esp_wifi_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap) +{ + return esp_wifi_remote_get_protocol(ifx, protocol_bitmap); +} + +esp_err_t esp_wifi_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw) +{ + return esp_wifi_remote_set_bandwidth(ifx, bw); +} + +esp_err_t esp_wifi_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw) +{ + return esp_wifi_remote_get_bandwidth(ifx, bw); +} + +esp_err_t esp_wifi_set_channel(uint8_t primary, wifi_second_chan_t second) +{ + return esp_wifi_remote_set_channel(primary, second); +} + +esp_err_t esp_wifi_get_channel(uint8_t *primary, wifi_second_chan_t *second) +{ + return esp_wifi_remote_get_channel(primary, second); +} + +esp_err_t esp_wifi_set_country(const wifi_country_t *country) +{ + return esp_wifi_remote_set_country(country); +} + +esp_err_t esp_wifi_get_country(wifi_country_t *country) +{ + return esp_wifi_remote_get_country(country); +} + +esp_err_t esp_wifi_set_mac(wifi_interface_t ifx, const uint8_t mac[6]) +{ + return esp_wifi_remote_set_mac(ifx, mac); +} + +esp_err_t esp_wifi_get_mac(wifi_interface_t ifx, uint8_t mac[6]) +{ + return esp_wifi_remote_get_mac(ifx, mac); +} + +esp_err_t esp_wifi_set_promiscuous_rx_cb(wifi_promiscuous_cb_t cb) +{ + return esp_wifi_remote_set_promiscuous_rx_cb(cb); +} + +esp_err_t esp_wifi_set_promiscuous(_Bool en) +{ + return esp_wifi_remote_set_promiscuous(en); +} + +esp_err_t esp_wifi_get_promiscuous(_Bool *en) +{ + return esp_wifi_remote_get_promiscuous(en); +} + +esp_err_t esp_wifi_set_promiscuous_filter(const wifi_promiscuous_filter_t *filter) +{ + return esp_wifi_remote_set_promiscuous_filter(filter); +} + +esp_err_t esp_wifi_get_promiscuous_filter(wifi_promiscuous_filter_t *filter) +{ + return esp_wifi_remote_get_promiscuous_filter(filter); +} + +esp_err_t esp_wifi_set_promiscuous_ctrl_filter(const wifi_promiscuous_filter_t *filter) +{ + return esp_wifi_remote_set_promiscuous_ctrl_filter(filter); +} + +esp_err_t esp_wifi_get_promiscuous_ctrl_filter(wifi_promiscuous_filter_t *filter) +{ + return esp_wifi_remote_get_promiscuous_ctrl_filter(filter); +} + +esp_err_t esp_wifi_set_config(wifi_interface_t interface, wifi_config_t *conf) +{ + return esp_wifi_remote_set_config(interface, conf); +} + +esp_err_t esp_wifi_get_config(wifi_interface_t interface, wifi_config_t *conf) +{ + return esp_wifi_remote_get_config(interface, conf); +} + +esp_err_t esp_wifi_ap_get_sta_list(wifi_sta_list_t *sta) +{ + return esp_wifi_remote_ap_get_sta_list(sta); +} + +esp_err_t esp_wifi_ap_get_sta_aid(const uint8_t mac[6], uint16_t *aid) +{ + return esp_wifi_remote_ap_get_sta_aid(mac, aid); +} + +esp_err_t esp_wifi_set_storage(wifi_storage_t storage) +{ + return esp_wifi_remote_set_storage(storage); +} + +esp_err_t esp_wifi_set_vendor_ie(_Bool enable, wifi_vendor_ie_type_t type, wifi_vendor_ie_id_t idx, const void *vnd_ie) +{ + return esp_wifi_remote_set_vendor_ie(enable, type, idx, vnd_ie); +} + +esp_err_t esp_wifi_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx) +{ + return esp_wifi_remote_set_vendor_ie_cb(cb, ctx); +} + +esp_err_t esp_wifi_set_max_tx_power(int8_t power) +{ + return esp_wifi_remote_set_max_tx_power(power); +} + +esp_err_t esp_wifi_get_max_tx_power(int8_t *power) +{ + return esp_wifi_remote_get_max_tx_power(power); +} + +esp_err_t esp_wifi_set_event_mask(uint32_t mask) +{ + return esp_wifi_remote_set_event_mask(mask); +} + +esp_err_t esp_wifi_get_event_mask(uint32_t *mask) +{ + return esp_wifi_remote_get_event_mask(mask); +} + +esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, _Bool en_sys_seq) +{ + return esp_wifi_remote_80211_tx(ifx, buffer, len, en_sys_seq); +} + +esp_err_t esp_wifi_set_csi_rx_cb(wifi_csi_cb_t cb, void *ctx) +{ + return esp_wifi_remote_set_csi_rx_cb(cb, ctx); +} + +esp_err_t esp_wifi_set_csi_config(const wifi_csi_config_t *config) +{ + return esp_wifi_remote_set_csi_config(config); +} + +esp_err_t esp_wifi_get_csi_config(wifi_csi_config_t *config) +{ + return esp_wifi_remote_get_csi_config(config); +} + +esp_err_t esp_wifi_set_csi(_Bool en) +{ + return esp_wifi_remote_set_csi(en); +} + +int64_t esp_wifi_get_tsf_time(wifi_interface_t interface) +{ + return esp_wifi_remote_get_tsf_time(interface); +} + +esp_err_t esp_wifi_set_inactive_time(wifi_interface_t ifx, uint16_t sec) +{ + return esp_wifi_remote_set_inactive_time(ifx, sec); +} + +esp_err_t esp_wifi_get_inactive_time(wifi_interface_t ifx, uint16_t *sec) +{ + return esp_wifi_remote_get_inactive_time(ifx, sec); +} + +esp_err_t esp_wifi_statis_dump(uint32_t modules) +{ + return esp_wifi_remote_statis_dump(modules); +} + +esp_err_t esp_wifi_set_rssi_threshold(int32_t rssi) +{ + return esp_wifi_remote_set_rssi_threshold(rssi); +} + +esp_err_t esp_wifi_ftm_initiate_session(wifi_ftm_initiator_cfg_t *cfg) +{ + return esp_wifi_remote_ftm_initiate_session(cfg); +} + +esp_err_t esp_wifi_ftm_end_session(void) +{ + return esp_wifi_remote_ftm_end_session(); +} + +esp_err_t esp_wifi_ftm_resp_set_offset(int16_t offset_cm) +{ + return esp_wifi_remote_ftm_resp_set_offset(offset_cm); +} + +esp_err_t esp_wifi_ftm_get_report(wifi_ftm_report_entry_t *report, uint8_t num_entries) +{ + return esp_wifi_remote_ftm_get_report(report, num_entries); +} + +esp_err_t esp_wifi_config_11b_rate(wifi_interface_t ifx, _Bool disable) +{ + return esp_wifi_remote_config_11b_rate(ifx, disable); +} + +esp_err_t esp_wifi_connectionless_module_set_wake_interval(uint16_t wake_interval) +{ + return esp_wifi_remote_connectionless_module_set_wake_interval(wake_interval); +} + +esp_err_t esp_wifi_force_wakeup_acquire(void) +{ + return esp_wifi_remote_force_wakeup_acquire(); +} + +esp_err_t esp_wifi_force_wakeup_release(void) +{ + return esp_wifi_remote_force_wakeup_release(); +} + +esp_err_t esp_wifi_set_country_code(const char *country, _Bool ieee80211d_enabled) +{ + return esp_wifi_remote_set_country_code(country, ieee80211d_enabled); +} + +esp_err_t esp_wifi_get_country_code(char *country) +{ + return esp_wifi_remote_get_country_code(country); +} + +esp_err_t esp_wifi_config_80211_tx_rate(wifi_interface_t ifx, wifi_phy_rate_t rate) +{ + return esp_wifi_remote_config_80211_tx_rate(ifx, rate); +} + +esp_err_t esp_wifi_config_80211_tx(wifi_interface_t ifx, wifi_tx_rate_config_t *config) +{ + return esp_wifi_remote_config_80211_tx(ifx, config); +} + +esp_err_t esp_wifi_disable_pmf_config(wifi_interface_t ifx) +{ + return esp_wifi_remote_disable_pmf_config(ifx); +} + +esp_err_t esp_wifi_sta_get_aid(uint16_t *aid) +{ + return esp_wifi_remote_sta_get_aid(aid); +} + +esp_err_t esp_wifi_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode) +{ + return esp_wifi_remote_sta_get_negotiated_phymode(phymode); +} + +esp_err_t esp_wifi_set_dynamic_cs(_Bool enabled) +{ + return esp_wifi_remote_set_dynamic_cs(enabled); +} + +esp_err_t esp_wifi_sta_get_rssi(int *rssi) +{ + return esp_wifi_remote_sta_get_rssi(rssi); +} + +esp_err_t esp_wifi_set_band(wifi_band_t band) +{ + return esp_wifi_remote_set_band(band); +} + +esp_err_t esp_wifi_get_band(wifi_band_t *band) +{ + return esp_wifi_remote_get_band(band); +} + +esp_err_t esp_wifi_set_band_mode(wifi_band_mode_t band_mode) +{ + return esp_wifi_remote_set_band_mode(band_mode); +} + +esp_err_t esp_wifi_get_band_mode(wifi_band_mode_t *band_mode) +{ + return esp_wifi_remote_get_band_mode(band_mode); +} + +esp_err_t esp_wifi_set_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols) +{ + return esp_wifi_remote_set_protocols(ifx, protocols); +} + +esp_err_t esp_wifi_get_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols) +{ + return esp_wifi_remote_get_protocols(ifx, protocols); +} + +esp_err_t esp_wifi_set_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw) +{ + return esp_wifi_remote_set_bandwidths(ifx, bw); +} + +esp_err_t esp_wifi_get_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw) +{ + return esp_wifi_remote_get_bandwidths(ifx, bw); +} diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/include/esp_eap_client_remote_api.h b/components/esp_wifi_remote/idf_tag_v5.4.2/include/esp_eap_client_remote_api.h new file mode 100644 index 0000000..d602c87 --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/include/esp_eap_client_remote_api.h @@ -0,0 +1,30 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +// This file is auto-generated +#pragma once +#include "esp_eap_client.h" +esp_err_t esp_wifi_remote_sta_enterprise_enable(void); +esp_err_t esp_wifi_remote_sta_enterprise_disable(void); +esp_err_t esp_eap_client_remote_set_identity(const unsigned char *identity, int len); +void esp_eap_client_remote_clear_identity(void); +esp_err_t esp_eap_client_remote_set_username(const unsigned char *username, int len); +void esp_eap_client_remote_clear_username(void); +esp_err_t esp_eap_client_remote_set_password(const unsigned char *password, int len); +void esp_eap_client_remote_clear_password(void); +esp_err_t esp_eap_client_remote_set_new_password(const unsigned char *new_password, int len); +void esp_eap_client_remote_clear_new_password(void); +esp_err_t esp_eap_client_remote_set_ca_cert(const unsigned char *ca_cert, int ca_cert_len); +void esp_eap_client_remote_clear_ca_cert(void); +esp_err_t esp_eap_client_remote_set_certificate_and_key(const unsigned char *client_cert, int client_cert_len, const unsigned char *private_key, int private_key_len, const unsigned char *private_key_password, int private_key_passwd_len); +void esp_eap_client_remote_clear_certificate_and_key(void); +esp_err_t esp_eap_client_remote_set_disable_time_check(_Bool disable); +esp_err_t esp_eap_client_remote_get_disable_time_check(_Bool *disable); +esp_err_t esp_eap_client_remote_set_ttls_phase2_method(esp_eap_ttls_phase2_types type); +esp_err_t esp_eap_client_remote_set_suiteb_192bit_certification(_Bool enable); +esp_err_t esp_eap_client_remote_set_pac_file(const unsigned char *pac_file, int pac_file_len); +esp_err_t esp_eap_client_remote_set_fast_params(esp_eap_fast_config config); +esp_err_t esp_eap_client_remote_use_default_cert_bundle(_Bool use_default_bundle); +esp_err_t esp_eap_client_remote_set_domain_name(const char *domain_name); diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/include/esp_wifi_default_config.h b/components/esp_wifi_remote/idf_tag_v5.4.2/include/esp_wifi_default_config.h new file mode 100644 index 0000000..895c6b7 --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/include/esp_wifi_default_config.h @@ -0,0 +1,801 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +// This file is auto-generated +#pragma once + +#if CONFIG_SLAVE_IDF_TARGET_ESP32 +#define CONFIG_ESP_WIFI_REMOTE_ENABLED 1 +#define CONFIG_SLAVE_IDF_TARGET_ESP32 1 +#define CONFIG_SLAVE_SOC_WIFI_SUPPORTED 1 +#define CONFIG_SLAVE_SOC_WIFI_WAPI_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_CSI_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_MESH_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW 1 +#define CONFIG_SLAVE_SOC_WIFI_NAN_SUPPORT 1 +#define CONFIG_SLAVE_IDF_TARGET_ARCH_XTENSA 1 +#define CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED 1 +#define CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED 1 +#define CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER 1 +#define CONFIG_WIFI_RMT_TX_BUFFER_TYPE 1 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_STATIC_RX_MGMT_BUFFER 1 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_WIFI_RMT_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_WIFI_RMT_AMPDU_TX_ENABLED 1 +#define CONFIG_WIFI_RMT_TX_BA_WIN 6 +#define CONFIG_WIFI_RMT_AMPDU_RX_ENABLED 1 +#define CONFIG_WIFI_RMT_RX_BA_WIN 6 +#define CONFIG_WIFI_RMT_NVS_ENABLED 1 +#define CONFIG_WIFI_RMT_TASK_PINNED_TO_CORE_0 1 +#define CONFIG_WIFI_RMT_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_WIFI_RMT_MGMT_SBUF_NUM 32 +#define CONFIG_WIFI_RMT_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_RX_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_SAE 1 +#define CONFIG_WIFI_RMT_ENABLE_SAE_PK 1 +#define CONFIG_WIFI_RMT_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_WIFI_RMT_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_WIFI_RMT_GMAC_SUPPORT 1 +#define CONFIG_WIFI_RMT_SOFTAP_SUPPORT 1 +#define CONFIG_WIFI_RMT_ESPNOW_MAX_ENCRYPT_NUM 7 +#define CONFIG_WIFI_RMT_MBEDTLS_CRYPTO 1 +#define CONFIG_WIFI_RMT_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_WIFI_RMT_ENTERPRISE_SUPPORT 1 +#define CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_TX_BUFFER_TYPE 1 +#define CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_ESP_WIFI_AMPDU_TX_ENABLED 1 +#define CONFIG_ESP_WIFI_TX_BA_WIN 6 +#define CONFIG_ESP_WIFI_AMPDU_RX_ENABLED 1 +#define CONFIG_ESP_WIFI_RX_BA_WIN 6 +#define CONFIG_ESP_WIFI_NVS_ENABLED 1 +#define CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_ESP_WIFI_MGMT_SBUF_NUM 32 +#define CONFIG_ESP_WIFI_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_RX_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_SAE 1 +#define CONFIG_ESP_WIFI_ENABLE_SAE_PK 1 +#define CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_ESP_WIFI_GMAC_SUPPORT 1 +#define CONFIG_ESP_WIFI_SOFTAP_SUPPORT 1 +#define CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM 7 +#define CONFIG_ESP_WIFI_MBEDTLS_CRYPTO 1 +#define CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT 1 +#endif // CONFIG_SLAVE_IDF_TARGET_ESP32 + +#if CONFIG_SLAVE_IDF_TARGET_ESP32S2 +#define CONFIG_ESP_WIFI_REMOTE_ENABLED 1 +#define CONFIG_SLAVE_IDF_TARGET_ESP32S2 1 +#define CONFIG_SLAVE_SOC_WIFI_SUPPORTED 1 +#define CONFIG_SLAVE_SOC_WIFI_WAPI_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_CSI_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_MESH_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW 1 +#define CONFIG_SLAVE_SOC_WIFI_NAN_SUPPORT 1 +#define CONFIG_SLAVE_IDF_TARGET_ARCH_XTENSA 1 +#define CONFIG_SLAVE_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH 12 +#define CONFIG_SLAVE_SOC_WIFI_HW_TSF 1 +#define CONFIG_SLAVE_SOC_WIFI_FTM_SUPPORT 1 +#define CONFIG_SLAVE_FREERTOS_UNICORE 1 +#define CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED 1 +#define CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED 1 +#define CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER 1 +#define CONFIG_WIFI_RMT_TX_BUFFER_TYPE 1 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_STATIC_RX_MGMT_BUFFER 1 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_WIFI_RMT_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_WIFI_RMT_AMPDU_TX_ENABLED 1 +#define CONFIG_WIFI_RMT_TX_BA_WIN 6 +#define CONFIG_WIFI_RMT_AMPDU_RX_ENABLED 1 +#define CONFIG_WIFI_RMT_RX_BA_WIN 6 +#define CONFIG_WIFI_RMT_NVS_ENABLED 1 +#define CONFIG_WIFI_RMT_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_WIFI_RMT_MGMT_SBUF_NUM 32 +#define CONFIG_WIFI_RMT_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_RX_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_SAE 1 +#define CONFIG_WIFI_RMT_ENABLE_SAE_PK 1 +#define CONFIG_WIFI_RMT_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_WIFI_RMT_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_WIFI_RMT_GMAC_SUPPORT 1 +#define CONFIG_WIFI_RMT_SOFTAP_SUPPORT 1 +#define CONFIG_WIFI_RMT_ESPNOW_MAX_ENCRYPT_NUM 7 +#define CONFIG_WIFI_RMT_MBEDTLS_CRYPTO 1 +#define CONFIG_WIFI_RMT_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_WIFI_RMT_ENTERPRISE_SUPPORT 1 +#define CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_TX_BUFFER_TYPE 1 +#define CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_ESP_WIFI_AMPDU_TX_ENABLED 1 +#define CONFIG_ESP_WIFI_TX_BA_WIN 6 +#define CONFIG_ESP_WIFI_AMPDU_RX_ENABLED 1 +#define CONFIG_ESP_WIFI_RX_BA_WIN 6 +#define CONFIG_ESP_WIFI_NVS_ENABLED 1 +#define CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_ESP_WIFI_MGMT_SBUF_NUM 32 +#define CONFIG_ESP_WIFI_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_RX_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_SAE 1 +#define CONFIG_ESP_WIFI_ENABLE_SAE_PK 1 +#define CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_ESP_WIFI_GMAC_SUPPORT 1 +#define CONFIG_ESP_WIFI_SOFTAP_SUPPORT 1 +#define CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM 7 +#define CONFIG_ESP_WIFI_MBEDTLS_CRYPTO 1 +#define CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT 1 +#endif // CONFIG_SLAVE_IDF_TARGET_ESP32S2 + +#if CONFIG_SLAVE_IDF_TARGET_ESP32C3 +#define CONFIG_ESP_WIFI_REMOTE_ENABLED 1 +#define CONFIG_SLAVE_IDF_TARGET_ESP32C3 1 +#define CONFIG_SLAVE_SOC_WIFI_SUPPORTED 1 +#define CONFIG_SLAVE_SOC_WIFI_WAPI_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_CSI_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_MESH_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW 1 +#define CONFIG_SLAVE_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH 12 +#define CONFIG_SLAVE_SOC_WIFI_HW_TSF 1 +#define CONFIG_SLAVE_SOC_WIFI_FTM_SUPPORT 1 +#define CONFIG_SLAVE_FREERTOS_UNICORE 1 +#define CONFIG_SLAVE_SOC_WIFI_GCMP_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_PHY_NEEDS_USB_WORKAROUND 1 +#define CONFIG_SLAVE_IDF_TARGET_ARCH_RISCV 1 +#define CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED 1 +#define CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED 1 +#define CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER 1 +#define CONFIG_WIFI_RMT_TX_BUFFER_TYPE 1 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_STATIC_RX_MGMT_BUFFER 1 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_WIFI_RMT_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_WIFI_RMT_AMPDU_TX_ENABLED 1 +#define CONFIG_WIFI_RMT_TX_BA_WIN 6 +#define CONFIG_WIFI_RMT_AMPDU_RX_ENABLED 1 +#define CONFIG_WIFI_RMT_RX_BA_WIN 6 +#define CONFIG_WIFI_RMT_NVS_ENABLED 1 +#define CONFIG_WIFI_RMT_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_WIFI_RMT_MGMT_SBUF_NUM 32 +#define CONFIG_WIFI_RMT_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_RX_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_SAE 1 +#define CONFIG_WIFI_RMT_ENABLE_SAE_PK 1 +#define CONFIG_WIFI_RMT_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_WIFI_RMT_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_WIFI_RMT_GMAC_SUPPORT 1 +#define CONFIG_WIFI_RMT_SOFTAP_SUPPORT 1 +#define CONFIG_WIFI_RMT_ESPNOW_MAX_ENCRYPT_NUM 7 +#define CONFIG_WIFI_RMT_MBEDTLS_CRYPTO 1 +#define CONFIG_WIFI_RMT_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_WIFI_RMT_ENTERPRISE_SUPPORT 1 +#define CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_TX_BUFFER_TYPE 1 +#define CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_ESP_WIFI_AMPDU_TX_ENABLED 1 +#define CONFIG_ESP_WIFI_TX_BA_WIN 6 +#define CONFIG_ESP_WIFI_AMPDU_RX_ENABLED 1 +#define CONFIG_ESP_WIFI_RX_BA_WIN 6 +#define CONFIG_ESP_WIFI_NVS_ENABLED 1 +#define CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_ESP_WIFI_MGMT_SBUF_NUM 32 +#define CONFIG_ESP_WIFI_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_RX_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_SAE 1 +#define CONFIG_ESP_WIFI_ENABLE_SAE_PK 1 +#define CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_ESP_WIFI_GMAC_SUPPORT 1 +#define CONFIG_ESP_WIFI_SOFTAP_SUPPORT 1 +#define CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM 7 +#define CONFIG_ESP_WIFI_MBEDTLS_CRYPTO 1 +#define CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT 1 +#endif // CONFIG_SLAVE_IDF_TARGET_ESP32C3 + +#if CONFIG_SLAVE_IDF_TARGET_ESP32S3 +#define CONFIG_ESP_WIFI_REMOTE_ENABLED 1 +#define CONFIG_SLAVE_IDF_TARGET_ESP32S3 1 +#define CONFIG_SLAVE_SOC_WIFI_SUPPORTED 1 +#define CONFIG_SLAVE_SOC_WIFI_WAPI_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_CSI_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_MESH_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW 1 +#define CONFIG_SLAVE_IDF_TARGET_ARCH_XTENSA 1 +#define CONFIG_SLAVE_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH 12 +#define CONFIG_SLAVE_SOC_WIFI_HW_TSF 1 +#define CONFIG_SLAVE_SOC_WIFI_FTM_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_GCMP_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_PHY_NEEDS_USB_WORKAROUND 1 +#define CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED 1 +#define CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED 1 +#define CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER 1 +#define CONFIG_WIFI_RMT_TX_BUFFER_TYPE 1 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_STATIC_RX_MGMT_BUFFER 1 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_WIFI_RMT_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_WIFI_RMT_AMPDU_TX_ENABLED 1 +#define CONFIG_WIFI_RMT_TX_BA_WIN 6 +#define CONFIG_WIFI_RMT_AMPDU_RX_ENABLED 1 +#define CONFIG_WIFI_RMT_RX_BA_WIN 6 +#define CONFIG_WIFI_RMT_NVS_ENABLED 1 +#define CONFIG_WIFI_RMT_TASK_PINNED_TO_CORE_0 1 +#define CONFIG_WIFI_RMT_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_WIFI_RMT_MGMT_SBUF_NUM 32 +#define CONFIG_WIFI_RMT_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_RX_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_SAE 1 +#define CONFIG_WIFI_RMT_ENABLE_SAE_PK 1 +#define CONFIG_WIFI_RMT_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_WIFI_RMT_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_WIFI_RMT_GMAC_SUPPORT 1 +#define CONFIG_WIFI_RMT_SOFTAP_SUPPORT 1 +#define CONFIG_WIFI_RMT_ESPNOW_MAX_ENCRYPT_NUM 7 +#define CONFIG_WIFI_RMT_MBEDTLS_CRYPTO 1 +#define CONFIG_WIFI_RMT_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_WIFI_RMT_ENTERPRISE_SUPPORT 1 +#define CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_TX_BUFFER_TYPE 1 +#define CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_ESP_WIFI_AMPDU_TX_ENABLED 1 +#define CONFIG_ESP_WIFI_TX_BA_WIN 6 +#define CONFIG_ESP_WIFI_AMPDU_RX_ENABLED 1 +#define CONFIG_ESP_WIFI_RX_BA_WIN 6 +#define CONFIG_ESP_WIFI_NVS_ENABLED 1 +#define CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_ESP_WIFI_MGMT_SBUF_NUM 32 +#define CONFIG_ESP_WIFI_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_RX_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_SAE 1 +#define CONFIG_ESP_WIFI_ENABLE_SAE_PK 1 +#define CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_ESP_WIFI_GMAC_SUPPORT 1 +#define CONFIG_ESP_WIFI_SOFTAP_SUPPORT 1 +#define CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM 7 +#define CONFIG_ESP_WIFI_MBEDTLS_CRYPTO 1 +#define CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT 1 +#endif // CONFIG_SLAVE_IDF_TARGET_ESP32S3 + +#if CONFIG_SLAVE_IDF_TARGET_ESP32C2 +#define CONFIG_ESP_WIFI_REMOTE_ENABLED 1 +#define CONFIG_SLAVE_IDF_TARGET_ESP32C2 1 +#define CONFIG_SLAVE_SOC_WIFI_SUPPORTED 1 +#define CONFIG_SLAVE_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW 1 +#define CONFIG_SLAVE_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH 12 +#define CONFIG_SLAVE_SOC_WIFI_HW_TSF 1 +#define CONFIG_SLAVE_SOC_WIFI_FTM_SUPPORT 1 +#define CONFIG_SLAVE_FREERTOS_UNICORE 1 +#define CONFIG_SLAVE_SOC_WIFI_PHY_NEEDS_USB_WORKAROUND 1 +#define CONFIG_SLAVE_IDF_TARGET_ARCH_RISCV 1 +#define CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED 1 +#define CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED 1 +#define CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER 1 +#define CONFIG_WIFI_RMT_TX_BUFFER_TYPE 1 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_STATIC_RX_MGMT_BUFFER 1 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_WIFI_RMT_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_WIFI_RMT_AMPDU_TX_ENABLED 1 +#define CONFIG_WIFI_RMT_TX_BA_WIN 6 +#define CONFIG_WIFI_RMT_AMPDU_RX_ENABLED 1 +#define CONFIG_WIFI_RMT_RX_BA_WIN 6 +#define CONFIG_WIFI_RMT_NVS_ENABLED 1 +#define CONFIG_WIFI_RMT_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_WIFI_RMT_MGMT_SBUF_NUM 32 +#define CONFIG_WIFI_RMT_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_RX_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_SAE 1 +#define CONFIG_WIFI_RMT_ENABLE_SAE_PK 1 +#define CONFIG_WIFI_RMT_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_WIFI_RMT_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_WIFI_RMT_GMAC_SUPPORT 1 +#define CONFIG_WIFI_RMT_SOFTAP_SUPPORT 1 +#define CONFIG_WIFI_RMT_ESPNOW_MAX_ENCRYPT_NUM 2 +#define CONFIG_WIFI_RMT_MBEDTLS_CRYPTO 1 +#define CONFIG_WIFI_RMT_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_WIFI_RMT_ENTERPRISE_SUPPORT 1 +#define CONFIG_WIFI_RMT_ENT_FREE_DYNAMIC_BUFFER 1 +#define CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_TX_BUFFER_TYPE 1 +#define CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_ESP_WIFI_AMPDU_TX_ENABLED 1 +#define CONFIG_ESP_WIFI_TX_BA_WIN 6 +#define CONFIG_ESP_WIFI_AMPDU_RX_ENABLED 1 +#define CONFIG_ESP_WIFI_RX_BA_WIN 6 +#define CONFIG_ESP_WIFI_NVS_ENABLED 1 +#define CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_ESP_WIFI_MGMT_SBUF_NUM 32 +#define CONFIG_ESP_WIFI_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_RX_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_SAE 1 +#define CONFIG_ESP_WIFI_ENABLE_SAE_PK 1 +#define CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_ESP_WIFI_GMAC_SUPPORT 1 +#define CONFIG_ESP_WIFI_SOFTAP_SUPPORT 1 +#define CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM 2 +#define CONFIG_ESP_WIFI_MBEDTLS_CRYPTO 1 +#define CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT 1 +#define CONFIG_ESP_WIFI_ENT_FREE_DYNAMIC_BUFFER 1 +#endif // CONFIG_SLAVE_IDF_TARGET_ESP32C2 + +#if CONFIG_SLAVE_IDF_TARGET_ESP32C6 +#define CONFIG_ESP_WIFI_REMOTE_ENABLED 1 +#define CONFIG_SLAVE_IDF_TARGET_ESP32C6 1 +#define CONFIG_SLAVE_SOC_WIFI_SUPPORTED 1 +#define CONFIG_SLAVE_SOC_WIFI_WAPI_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_CSI_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_MESH_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH 12 +#define CONFIG_SLAVE_SOC_WIFI_HW_TSF 1 +#define CONFIG_SLAVE_SOC_WIFI_FTM_SUPPORT 1 +#define CONFIG_SLAVE_FREERTOS_UNICORE 1 +#define CONFIG_SLAVE_SOC_WIFI_GCMP_SUPPORT 1 +#define CONFIG_SLAVE_IDF_TARGET_ARCH_RISCV 1 +#define CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_MAC_VERSION_NUM 2 +#define CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED 1 +#define CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED 1 +#define CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER 1 +#define CONFIG_WIFI_RMT_TX_BUFFER_TYPE 1 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_STATIC_RX_MGMT_BUFFER 1 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_WIFI_RMT_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_WIFI_RMT_AMPDU_TX_ENABLED 1 +#define CONFIG_WIFI_RMT_TX_BA_WIN 6 +#define CONFIG_WIFI_RMT_AMPDU_RX_ENABLED 1 +#define CONFIG_WIFI_RMT_RX_BA_WIN 6 +#define CONFIG_WIFI_RMT_NVS_ENABLED 1 +#define CONFIG_WIFI_RMT_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_WIFI_RMT_MGMT_SBUF_NUM 32 +#define CONFIG_WIFI_RMT_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_EXTRA_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_RX_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_SAE 1 +#define CONFIG_WIFI_RMT_ENABLE_SAE_PK 1 +#define CONFIG_WIFI_RMT_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_WIFI_RMT_SLP_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_WIFI_RMT_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_WIFI_RMT_GMAC_SUPPORT 1 +#define CONFIG_WIFI_RMT_SOFTAP_SUPPORT 1 +#define CONFIG_WIFI_RMT_ESPNOW_MAX_ENCRYPT_NUM 7 +#define CONFIG_WIFI_RMT_MBEDTLS_CRYPTO 1 +#define CONFIG_WIFI_RMT_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_WIFI_RMT_TX_HETB_QUEUE_NUM 3 +#define CONFIG_WIFI_RMT_ENTERPRISE_SUPPORT 1 +#define CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_TX_BUFFER_TYPE 1 +#define CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_ESP_WIFI_AMPDU_TX_ENABLED 1 +#define CONFIG_ESP_WIFI_TX_BA_WIN 6 +#define CONFIG_ESP_WIFI_AMPDU_RX_ENABLED 1 +#define CONFIG_ESP_WIFI_RX_BA_WIN 6 +#define CONFIG_ESP_WIFI_NVS_ENABLED 1 +#define CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_ESP_WIFI_MGMT_SBUF_NUM 32 +#define CONFIG_ESP_WIFI_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_EXTRA_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_RX_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_SAE 1 +#define CONFIG_ESP_WIFI_ENABLE_SAE_PK 1 +#define CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_ESP_WIFI_SLP_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_ESP_WIFI_GMAC_SUPPORT 1 +#define CONFIG_ESP_WIFI_SOFTAP_SUPPORT 1 +#define CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM 7 +#define CONFIG_ESP_WIFI_MBEDTLS_CRYPTO 1 +#define CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_ESP_WIFI_TX_HETB_QUEUE_NUM 3 +#define CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT 1 +#endif // CONFIG_SLAVE_IDF_TARGET_ESP32C6 + +#if CONFIG_SLAVE_IDF_TARGET_ESP32H2 +#define CONFIG_ESP_WIFI_REMOTE_ENABLED 1 +#define CONFIG_SLAVE_IDF_TARGET_ESP32 1 +#define CONFIG_SLAVE_SOC_WIFI_SUPPORTED 1 +#define CONFIG_SLAVE_SOC_WIFI_WAPI_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_CSI_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_MESH_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW 1 +#define CONFIG_SLAVE_SOC_WIFI_NAN_SUPPORT 1 +#define CONFIG_SLAVE_IDF_TARGET_ARCH_XTENSA 1 +#define CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED 1 +#define CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED 1 +#define CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER 1 +#define CONFIG_WIFI_RMT_TX_BUFFER_TYPE 1 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_STATIC_RX_MGMT_BUFFER 1 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_WIFI_RMT_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_WIFI_RMT_AMPDU_TX_ENABLED 1 +#define CONFIG_WIFI_RMT_TX_BA_WIN 6 +#define CONFIG_WIFI_RMT_AMPDU_RX_ENABLED 1 +#define CONFIG_WIFI_RMT_RX_BA_WIN 6 +#define CONFIG_WIFI_RMT_NVS_ENABLED 1 +#define CONFIG_WIFI_RMT_TASK_PINNED_TO_CORE_0 1 +#define CONFIG_WIFI_RMT_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_WIFI_RMT_MGMT_SBUF_NUM 32 +#define CONFIG_WIFI_RMT_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_RX_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_SAE 1 +#define CONFIG_WIFI_RMT_ENABLE_SAE_PK 1 +#define CONFIG_WIFI_RMT_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_WIFI_RMT_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_WIFI_RMT_GMAC_SUPPORT 1 +#define CONFIG_WIFI_RMT_SOFTAP_SUPPORT 1 +#define CONFIG_WIFI_RMT_ESPNOW_MAX_ENCRYPT_NUM 7 +#define CONFIG_WIFI_RMT_MBEDTLS_CRYPTO 1 +#define CONFIG_WIFI_RMT_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_WIFI_RMT_ENTERPRISE_SUPPORT 1 +#define CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_TX_BUFFER_TYPE 1 +#define CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_ESP_WIFI_AMPDU_TX_ENABLED 1 +#define CONFIG_ESP_WIFI_TX_BA_WIN 6 +#define CONFIG_ESP_WIFI_AMPDU_RX_ENABLED 1 +#define CONFIG_ESP_WIFI_RX_BA_WIN 6 +#define CONFIG_ESP_WIFI_NVS_ENABLED 1 +#define CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_ESP_WIFI_MGMT_SBUF_NUM 32 +#define CONFIG_ESP_WIFI_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_RX_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_SAE 1 +#define CONFIG_ESP_WIFI_ENABLE_SAE_PK 1 +#define CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_ESP_WIFI_GMAC_SUPPORT 1 +#define CONFIG_ESP_WIFI_SOFTAP_SUPPORT 1 +#define CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM 7 +#define CONFIG_ESP_WIFI_MBEDTLS_CRYPTO 1 +#define CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT 1 +#endif // CONFIG_SLAVE_IDF_TARGET_ESP32H2 + +#if CONFIG_SLAVE_IDF_TARGET_ESP32P4 +#define CONFIG_ESP_WIFI_REMOTE_ENABLED 1 +#define CONFIG_SLAVE_IDF_TARGET_ESP32 1 +#define CONFIG_SLAVE_SOC_WIFI_SUPPORTED 1 +#define CONFIG_SLAVE_SOC_WIFI_WAPI_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_CSI_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_MESH_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW 1 +#define CONFIG_SLAVE_SOC_WIFI_NAN_SUPPORT 1 +#define CONFIG_SLAVE_IDF_TARGET_ARCH_XTENSA 1 +#define CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED 1 +#define CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED 1 +#define CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER 1 +#define CONFIG_WIFI_RMT_TX_BUFFER_TYPE 1 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_STATIC_RX_MGMT_BUFFER 1 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_WIFI_RMT_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_WIFI_RMT_AMPDU_TX_ENABLED 1 +#define CONFIG_WIFI_RMT_TX_BA_WIN 6 +#define CONFIG_WIFI_RMT_AMPDU_RX_ENABLED 1 +#define CONFIG_WIFI_RMT_RX_BA_WIN 6 +#define CONFIG_WIFI_RMT_NVS_ENABLED 1 +#define CONFIG_WIFI_RMT_TASK_PINNED_TO_CORE_0 1 +#define CONFIG_WIFI_RMT_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_WIFI_RMT_MGMT_SBUF_NUM 32 +#define CONFIG_WIFI_RMT_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_RX_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_SAE 1 +#define CONFIG_WIFI_RMT_ENABLE_SAE_PK 1 +#define CONFIG_WIFI_RMT_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_WIFI_RMT_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_WIFI_RMT_GMAC_SUPPORT 1 +#define CONFIG_WIFI_RMT_SOFTAP_SUPPORT 1 +#define CONFIG_WIFI_RMT_ESPNOW_MAX_ENCRYPT_NUM 7 +#define CONFIG_WIFI_RMT_MBEDTLS_CRYPTO 1 +#define CONFIG_WIFI_RMT_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_WIFI_RMT_ENTERPRISE_SUPPORT 1 +#define CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_TX_BUFFER_TYPE 1 +#define CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_ESP_WIFI_AMPDU_TX_ENABLED 1 +#define CONFIG_ESP_WIFI_TX_BA_WIN 6 +#define CONFIG_ESP_WIFI_AMPDU_RX_ENABLED 1 +#define CONFIG_ESP_WIFI_RX_BA_WIN 6 +#define CONFIG_ESP_WIFI_NVS_ENABLED 1 +#define CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_ESP_WIFI_MGMT_SBUF_NUM 32 +#define CONFIG_ESP_WIFI_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_RX_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_SAE 1 +#define CONFIG_ESP_WIFI_ENABLE_SAE_PK 1 +#define CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_ESP_WIFI_GMAC_SUPPORT 1 +#define CONFIG_ESP_WIFI_SOFTAP_SUPPORT 1 +#define CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM 7 +#define CONFIG_ESP_WIFI_MBEDTLS_CRYPTO 1 +#define CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT 1 +#endif // CONFIG_SLAVE_IDF_TARGET_ESP32P4 + +#if CONFIG_SLAVE_IDF_TARGET_ESP32C5 +#define CONFIG_ESP_WIFI_REMOTE_ENABLED 1 +#define CONFIG_SLAVE_IDF_TARGET_ESP32C5 1 +#define CONFIG_SLAVE_SOC_WIFI_SUPPORTED 1 +#define CONFIG_SLAVE_SOC_WIFI_WAPI_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_CSI_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_MESH_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_NAN_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH 12 +#define CONFIG_SLAVE_SOC_WIFI_HW_TSF 1 +#define CONFIG_SLAVE_FREERTOS_UNICORE 1 +#define CONFIG_SLAVE_SOC_WIFI_GCMP_SUPPORT 1 +#define CONFIG_SLAVE_IDF_TARGET_ARCH_RISCV 1 +#define CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_MAC_VERSION_NUM 3 +#define CONFIG_SLAVE_SOC_WIFI_SUPPORT_5G 1 +#define CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED 1 +#define CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED 1 +#define CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER 1 +#define CONFIG_WIFI_RMT_TX_BUFFER_TYPE 1 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_STATIC_RX_MGMT_BUFFER 1 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_WIFI_RMT_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_WIFI_RMT_AMPDU_TX_ENABLED 1 +#define CONFIG_WIFI_RMT_TX_BA_WIN 6 +#define CONFIG_WIFI_RMT_AMPDU_RX_ENABLED 1 +#define CONFIG_WIFI_RMT_RX_BA_WIN 6 +#define CONFIG_WIFI_RMT_NVS_ENABLED 1 +#define CONFIG_WIFI_RMT_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_WIFI_RMT_MGMT_SBUF_NUM 32 +#define CONFIG_WIFI_RMT_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_EXTRA_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_RX_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_SAE 1 +#define CONFIG_WIFI_RMT_ENABLE_SAE_PK 1 +#define CONFIG_WIFI_RMT_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_WIFI_RMT_SLP_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_WIFI_RMT_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_WIFI_RMT_GMAC_SUPPORT 1 +#define CONFIG_WIFI_RMT_SOFTAP_SUPPORT 1 +#define CONFIG_WIFI_RMT_ESPNOW_MAX_ENCRYPT_NUM 7 +#define CONFIG_WIFI_RMT_MBEDTLS_CRYPTO 1 +#define CONFIG_WIFI_RMT_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_WIFI_RMT_TX_HETB_QUEUE_NUM 3 +#define CONFIG_WIFI_RMT_ENTERPRISE_SUPPORT 1 +#define CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_TX_BUFFER_TYPE 1 +#define CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_ESP_WIFI_AMPDU_TX_ENABLED 1 +#define CONFIG_ESP_WIFI_TX_BA_WIN 6 +#define CONFIG_ESP_WIFI_AMPDU_RX_ENABLED 1 +#define CONFIG_ESP_WIFI_RX_BA_WIN 6 +#define CONFIG_ESP_WIFI_NVS_ENABLED 1 +#define CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_ESP_WIFI_MGMT_SBUF_NUM 32 +#define CONFIG_ESP_WIFI_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_EXTRA_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_RX_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_SAE 1 +#define CONFIG_ESP_WIFI_ENABLE_SAE_PK 1 +#define CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_ESP_WIFI_SLP_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_ESP_WIFI_GMAC_SUPPORT 1 +#define CONFIG_ESP_WIFI_SOFTAP_SUPPORT 1 +#define CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM 7 +#define CONFIG_ESP_WIFI_MBEDTLS_CRYPTO 1 +#define CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_ESP_WIFI_TX_HETB_QUEUE_NUM 3 +#define CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT 1 +#endif // CONFIG_SLAVE_IDF_TARGET_ESP32C5 + +#if CONFIG_SLAVE_IDF_TARGET_ESP32C61 +#define CONFIG_ESP_WIFI_REMOTE_ENABLED 1 +#define CONFIG_SLAVE_IDF_TARGET_ESP32C61 1 +#define CONFIG_SLAVE_SOC_WIFI_SUPPORTED 1 +#define CONFIG_SLAVE_SOC_WIFI_WAPI_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_CSI_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_MESH_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_NAN_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH 12 +#define CONFIG_SLAVE_SOC_WIFI_HW_TSF 1 +#define CONFIG_SLAVE_FREERTOS_UNICORE 1 +#define CONFIG_SLAVE_SOC_WIFI_GCMP_SUPPORT 1 +#define CONFIG_SLAVE_IDF_TARGET_ARCH_RISCV 1 +#define CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT 1 +#define CONFIG_SLAVE_SOC_WIFI_MAC_VERSION_NUM 3 +#define CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED 1 +#define CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED 1 +#define CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER 1 +#define CONFIG_WIFI_RMT_TX_BUFFER_TYPE 1 +#define CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_WIFI_RMT_STATIC_RX_MGMT_BUFFER 1 +#define CONFIG_WIFI_RMT_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_WIFI_RMT_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_WIFI_RMT_AMPDU_TX_ENABLED 1 +#define CONFIG_WIFI_RMT_TX_BA_WIN 6 +#define CONFIG_WIFI_RMT_AMPDU_RX_ENABLED 1 +#define CONFIG_WIFI_RMT_RX_BA_WIN 6 +#define CONFIG_WIFI_RMT_NVS_ENABLED 1 +#define CONFIG_WIFI_RMT_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_WIFI_RMT_MGMT_SBUF_NUM 32 +#define CONFIG_WIFI_RMT_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_EXTRA_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_RX_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_SAE 1 +#define CONFIG_WIFI_RMT_ENABLE_SAE_PK 1 +#define CONFIG_WIFI_RMT_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_WIFI_RMT_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_WIFI_RMT_SLP_IRAM_OPT 1 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_WIFI_RMT_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_WIFI_RMT_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_WIFI_RMT_GMAC_SUPPORT 1 +#define CONFIG_WIFI_RMT_SOFTAP_SUPPORT 1 +#define CONFIG_WIFI_RMT_ESPNOW_MAX_ENCRYPT_NUM 7 +#define CONFIG_WIFI_RMT_MBEDTLS_CRYPTO 1 +#define CONFIG_WIFI_RMT_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_WIFI_RMT_TX_HETB_QUEUE_NUM 3 +#define CONFIG_WIFI_RMT_ENTERPRISE_SUPPORT 1 +#define CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_TX_BUFFER_TYPE 1 +#define CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF 0 +#define CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF 5 +#define CONFIG_ESP_WIFI_AMPDU_TX_ENABLED 1 +#define CONFIG_ESP_WIFI_TX_BA_WIN 6 +#define CONFIG_ESP_WIFI_AMPDU_RX_ENABLED 1 +#define CONFIG_ESP_WIFI_RX_BA_WIN 6 +#define CONFIG_ESP_WIFI_NVS_ENABLED 1 +#define CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_ESP_WIFI_MGMT_SBUF_NUM 32 +#define CONFIG_ESP_WIFI_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_EXTRA_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_RX_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_SAE 1 +#define CONFIG_ESP_WIFI_ENABLE_SAE_PK 1 +#define CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT 1 +#define CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA 1 +#define CONFIG_ESP_WIFI_SLP_IRAM_OPT 1 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME 50 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME 10 +#define CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME 15 +#define CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE 1 +#define CONFIG_ESP_WIFI_GMAC_SUPPORT 1 +#define CONFIG_ESP_WIFI_SOFTAP_SUPPORT 1 +#define CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM 7 +#define CONFIG_ESP_WIFI_MBEDTLS_CRYPTO 1 +#define CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_ESP_WIFI_TX_HETB_QUEUE_NUM 3 +#define CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT 1 +#endif // CONFIG_SLAVE_IDF_TARGET_ESP32C61 diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/include/esp_wifi_remote_api.h b/components/esp_wifi_remote/idf_tag_v5.4.2/include/esp_wifi_remote_api.h new file mode 100644 index 0000000..b61b1c2 --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/include/esp_wifi_remote_api.h @@ -0,0 +1,92 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +// This file is auto-generated +#pragma once +esp_err_t esp_wifi_remote_init(const wifi_init_config_t *config); +esp_err_t esp_wifi_remote_deinit(void); +esp_err_t esp_wifi_remote_set_mode(wifi_mode_t mode); +esp_err_t esp_wifi_remote_get_mode(wifi_mode_t *mode); +esp_err_t esp_wifi_remote_start(void); +esp_err_t esp_wifi_remote_stop(void); +esp_err_t esp_wifi_remote_restore(void); +esp_err_t esp_wifi_remote_connect(void); +esp_err_t esp_wifi_remote_disconnect(void); +esp_err_t esp_wifi_remote_clear_fast_connect(void); +esp_err_t esp_wifi_remote_deauth_sta(uint16_t aid); +esp_err_t esp_wifi_remote_scan_start(const wifi_scan_config_t *config, _Bool block); +esp_err_t esp_wifi_remote_set_scan_parameters(const wifi_scan_default_params_t *config); +esp_err_t esp_wifi_remote_get_scan_parameters(wifi_scan_default_params_t *config); +esp_err_t esp_wifi_remote_scan_stop(void); +esp_err_t esp_wifi_remote_scan_get_ap_num(uint16_t *number); +esp_err_t esp_wifi_remote_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records); +esp_err_t esp_wifi_remote_scan_get_ap_record(wifi_ap_record_t *ap_record); +esp_err_t esp_wifi_remote_clear_ap_list(void); +esp_err_t esp_wifi_remote_sta_get_ap_info(wifi_ap_record_t *ap_info); +esp_err_t esp_wifi_remote_set_ps(wifi_ps_type_t type); +esp_err_t esp_wifi_remote_get_ps(wifi_ps_type_t *type); +esp_err_t esp_wifi_remote_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap); +esp_err_t esp_wifi_remote_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap); +esp_err_t esp_wifi_remote_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw); +esp_err_t esp_wifi_remote_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw); +esp_err_t esp_wifi_remote_set_channel(uint8_t primary, wifi_second_chan_t second); +esp_err_t esp_wifi_remote_get_channel(uint8_t *primary, wifi_second_chan_t *second); +esp_err_t esp_wifi_remote_set_country(const wifi_country_t *country); +esp_err_t esp_wifi_remote_get_country(wifi_country_t *country); +esp_err_t esp_wifi_remote_set_mac(wifi_interface_t ifx, const uint8_t mac[6]); +esp_err_t esp_wifi_remote_get_mac(wifi_interface_t ifx, uint8_t mac[6]); +esp_err_t esp_wifi_remote_set_promiscuous_rx_cb(wifi_promiscuous_cb_t cb); +esp_err_t esp_wifi_remote_set_promiscuous(_Bool en); +esp_err_t esp_wifi_remote_get_promiscuous(_Bool *en); +esp_err_t esp_wifi_remote_set_promiscuous_filter(const wifi_promiscuous_filter_t *filter); +esp_err_t esp_wifi_remote_get_promiscuous_filter(wifi_promiscuous_filter_t *filter); +esp_err_t esp_wifi_remote_set_promiscuous_ctrl_filter(const wifi_promiscuous_filter_t *filter); +esp_err_t esp_wifi_remote_get_promiscuous_ctrl_filter(wifi_promiscuous_filter_t *filter); +esp_err_t esp_wifi_remote_set_config(wifi_interface_t interface, wifi_config_t *conf); +esp_err_t esp_wifi_remote_get_config(wifi_interface_t interface, wifi_config_t *conf); +esp_err_t esp_wifi_remote_ap_get_sta_list(wifi_sta_list_t *sta); +esp_err_t esp_wifi_remote_ap_get_sta_aid(const uint8_t mac[6], uint16_t *aid); +esp_err_t esp_wifi_remote_set_storage(wifi_storage_t storage); +esp_err_t esp_wifi_remote_set_vendor_ie(_Bool enable, wifi_vendor_ie_type_t type, wifi_vendor_ie_id_t idx, const void *vnd_ie); +esp_err_t esp_wifi_remote_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx); +esp_err_t esp_wifi_remote_set_max_tx_power(int8_t power); +esp_err_t esp_wifi_remote_get_max_tx_power(int8_t *power); +esp_err_t esp_wifi_remote_set_event_mask(uint32_t mask); +esp_err_t esp_wifi_remote_get_event_mask(uint32_t *mask); +esp_err_t esp_wifi_remote_80211_tx(wifi_interface_t ifx, const void *buffer, int len, _Bool en_sys_seq); +esp_err_t esp_wifi_remote_set_csi_rx_cb(wifi_csi_cb_t cb, void *ctx); +esp_err_t esp_wifi_remote_set_csi_config(const wifi_csi_config_t *config); +esp_err_t esp_wifi_remote_get_csi_config(wifi_csi_config_t *config); +esp_err_t esp_wifi_remote_set_csi(_Bool en); +int64_t esp_wifi_remote_get_tsf_time(wifi_interface_t interface); +esp_err_t esp_wifi_remote_set_inactive_time(wifi_interface_t ifx, uint16_t sec); +esp_err_t esp_wifi_remote_get_inactive_time(wifi_interface_t ifx, uint16_t *sec); +esp_err_t esp_wifi_remote_statis_dump(uint32_t modules); +esp_err_t esp_wifi_remote_set_rssi_threshold(int32_t rssi); +esp_err_t esp_wifi_remote_ftm_initiate_session(wifi_ftm_initiator_cfg_t *cfg); +esp_err_t esp_wifi_remote_ftm_end_session(void); +esp_err_t esp_wifi_remote_ftm_resp_set_offset(int16_t offset_cm); +esp_err_t esp_wifi_remote_ftm_get_report(wifi_ftm_report_entry_t *report, uint8_t num_entries); +esp_err_t esp_wifi_remote_config_11b_rate(wifi_interface_t ifx, _Bool disable); +esp_err_t esp_wifi_remote_connectionless_module_set_wake_interval(uint16_t wake_interval); +esp_err_t esp_wifi_remote_force_wakeup_acquire(void); +esp_err_t esp_wifi_remote_force_wakeup_release(void); +esp_err_t esp_wifi_remote_set_country_code(const char *country, _Bool ieee80211d_enabled); +esp_err_t esp_wifi_remote_get_country_code(char *country); +esp_err_t esp_wifi_remote_config_80211_tx_rate(wifi_interface_t ifx, wifi_phy_rate_t rate); +esp_err_t esp_wifi_remote_config_80211_tx(wifi_interface_t ifx, wifi_tx_rate_config_t *config); +esp_err_t esp_wifi_remote_disable_pmf_config(wifi_interface_t ifx); +esp_err_t esp_wifi_remote_sta_get_aid(uint16_t *aid); +esp_err_t esp_wifi_remote_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode); +esp_err_t esp_wifi_remote_set_dynamic_cs(_Bool enabled); +esp_err_t esp_wifi_remote_sta_get_rssi(int *rssi); +esp_err_t esp_wifi_remote_set_band(wifi_band_t band); +esp_err_t esp_wifi_remote_get_band(wifi_band_t *band); +esp_err_t esp_wifi_remote_set_band_mode(wifi_band_mode_t band_mode); +esp_err_t esp_wifi_remote_get_band_mode(wifi_band_mode_t *band_mode); +esp_err_t esp_wifi_remote_set_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols); +esp_err_t esp_wifi_remote_get_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols); +esp_err_t esp_wifi_remote_set_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw); +esp_err_t esp_wifi_remote_get_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw); diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_mesh.h b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_mesh.h new file mode 100644 index 0000000..9bd8cbf --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_mesh.h @@ -0,0 +1,1694 @@ +/* + * SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * Software Stack demonstrated: + * |------------------------------------------------------------------------------| + * | | | + * | | Application | + * | |-----------------------------------------------------------------| + * | | | Protocols: | | | | | + * | | Mesh Stack | HTTP, DNS, | | | Other | | + * | RTOS: | (Networking, | DHCP, ... | | | Components | | + * | (freeRTOS) | self-healing, |------------| | | | | + * | | flow control, | Network Stack: | | | | + * | | ...) | (LwIP) | | | | + * | |-----------------------------------| |---------------| | + * | | | | + * | | Wi-Fi Driver | | + * | |--------------------------------------------------| | + * | | | + * | | Platform HAL | + * |------------------------------------------------------------------------------| + * + * System Events delivery: + * + * |---------------| + * | | default handler + * | Wi-Fi stack | events |---------------------| + * | | -------------> | | + * |---------------| | | + * | event task | + * |---------------| events | | + * | | -------------> | | + * | LwIP stack | |---------------------| + * | |--------| + * |---------------| | + * | mesh event callback handler + * | |----------------------------| + * |-----> | | + * |---------------| | application | + * | | events | task | + * | mesh stack | -------------> | | + * | | |----------------------------| + * |---------------| + * + * + * Mesh Stack + * + * Mesh event defines almost all system events applications tasks need. + * Mesh event contains Wi-Fi connection states on station interface, children connection states on softAP interface and etc.. + * Applications need to register a mesh event callback handler by API esp_mesh_set_config() firstly. + * This handler is to receive events posted from mesh stack and LwIP stack. + * Applications could add relative handler for each event. + * Examples: + * (1) Applications could use Wi-Fi station connect states to decide when to send data to its parent, to the root or to external IP network; + * (2) Applications could use Wi-Fi softAP states to decide when to send data to its children. + * + * In present implementation, applications are able to access mesh stack directly without having to go through LwIP stack. + * Applications use esp_mesh_send() and esp_mesh_recv() to send and receive messages over the mesh network. + * In mesh stack design, normal devices don't require LwIP stack, but if any of these devices could be promoted to a root node in runtime, + * (due to automatic or manual topology reconfiguration) the TCP/IP stack should be initialized (for the root code to access external IP network) + * + * Over the mesh network, only the root is able to access external IP network. + * In application mesh event handler, once a device becomes a root, start DHCP client immediately whether DHCP is chosen. + */ + +#ifndef __ESP_MESH_H__ +#define __ESP_MESH_H__ + +#include "esp_err.h" +#include "esp_wifi.h" +#include "esp_wifi_types.h" +#include "esp_mesh_internal.h" +#include "lwip/ip_addr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/******************************************************* + * Constants + *******************************************************/ +#define MESH_ROOT_LAYER (1) /**< root layer value */ +#define MESH_MTU (1500) /**< max transmit unit(in bytes) */ +#define MESH_MPS (1472) /**< max payload size(in bytes) */ +/** + * @brief Mesh error code definition + */ +#define ESP_ERR_MESH_WIFI_NOT_START (ESP_ERR_MESH_BASE + 1) /**< Wi-Fi isn't started */ +#define ESP_ERR_MESH_NOT_INIT (ESP_ERR_MESH_BASE + 2) /**< mesh isn't initialized */ +#define ESP_ERR_MESH_NOT_CONFIG (ESP_ERR_MESH_BASE + 3) /**< mesh isn't configured */ +#define ESP_ERR_MESH_NOT_START (ESP_ERR_MESH_BASE + 4) /**< mesh isn't started */ +#define ESP_ERR_MESH_NOT_SUPPORT (ESP_ERR_MESH_BASE + 5) /**< not supported yet */ +#define ESP_ERR_MESH_NOT_ALLOWED (ESP_ERR_MESH_BASE + 6) /**< operation is not allowed */ +#define ESP_ERR_MESH_NO_MEMORY (ESP_ERR_MESH_BASE + 7) /**< out of memory */ +#define ESP_ERR_MESH_ARGUMENT (ESP_ERR_MESH_BASE + 8) /**< illegal argument */ +#define ESP_ERR_MESH_EXCEED_MTU (ESP_ERR_MESH_BASE + 9) /**< packet size exceeds MTU */ +#define ESP_ERR_MESH_TIMEOUT (ESP_ERR_MESH_BASE + 10) /**< timeout */ +#define ESP_ERR_MESH_DISCONNECTED (ESP_ERR_MESH_BASE + 11) /**< disconnected with parent on station interface */ +#define ESP_ERR_MESH_QUEUE_FAIL (ESP_ERR_MESH_BASE + 12) /**< queue fail */ +#define ESP_ERR_MESH_QUEUE_FULL (ESP_ERR_MESH_BASE + 13) /**< queue full */ +#define ESP_ERR_MESH_NO_PARENT_FOUND (ESP_ERR_MESH_BASE + 14) /**< no parent found to join the mesh network */ +#define ESP_ERR_MESH_NO_ROUTE_FOUND (ESP_ERR_MESH_BASE + 15) /**< no route found to forward the packet */ +#define ESP_ERR_MESH_OPTION_NULL (ESP_ERR_MESH_BASE + 16) /**< no option found */ +#define ESP_ERR_MESH_OPTION_UNKNOWN (ESP_ERR_MESH_BASE + 17) /**< unknown option */ +#define ESP_ERR_MESH_XON_NO_WINDOW (ESP_ERR_MESH_BASE + 18) /**< no window for software flow control on upstream */ +#define ESP_ERR_MESH_INTERFACE (ESP_ERR_MESH_BASE + 19) /**< low-level Wi-Fi interface error */ +#define ESP_ERR_MESH_DISCARD_DUPLICATE (ESP_ERR_MESH_BASE + 20) /**< discard the packet due to the duplicate sequence number */ +#define ESP_ERR_MESH_DISCARD (ESP_ERR_MESH_BASE + 21) /**< discard the packet */ +#define ESP_ERR_MESH_VOTING (ESP_ERR_MESH_BASE + 22) /**< vote in progress */ +#define ESP_ERR_MESH_XMIT (ESP_ERR_MESH_BASE + 23) /**< TX fail, the tx state is a value other than timeout and disconnect */ +#define ESP_ERR_MESH_QUEUE_READ (ESP_ERR_MESH_BASE + 24) /**< error in reading queue */ +#define ESP_ERR_MESH_PS (ESP_ERR_MESH_BASE + 25) /**< mesh PS is not specified as enable or disable */ +#define ESP_ERR_MESH_RECV_RELEASE (ESP_ERR_MESH_BASE + 26) /**< release esp_mesh_recv_toDS */ + +/** + * @brief Flags bitmap for esp_mesh_send() and esp_mesh_recv() + */ +#define MESH_DATA_ENC (0x01) /**< data encrypted (Unimplemented) */ +#define MESH_DATA_P2P (0x02) /**< point-to-point delivery over the mesh network */ +#define MESH_DATA_FROMDS (0x04) /**< receive from external IP network */ +#define MESH_DATA_TODS (0x08) /**< identify this packet is target to external IP network */ +#define MESH_DATA_NONBLOCK (0x10) /**< esp_mesh_send() non-block */ +#define MESH_DATA_DROP (0x20) /**< in the situation of the root having been changed, identify this packet can be dropped by new root */ +#define MESH_DATA_GROUP (0x40) /**< identify this packet is target to a group address */ + +/** + * @brief Option definitions for esp_mesh_send() and esp_mesh_recv() + */ +#define MESH_OPT_SEND_GROUP (7) /**< data transmission by group; used with esp_mesh_send() and shall have payload */ +#define MESH_OPT_RECV_DS_ADDR (8) /**< return a remote IP address; used with esp_mesh_send() and esp_mesh_recv() */ + +/** + * @brief Flag of mesh networking IE + */ +#define MESH_ASSOC_FLAG_MAP_ASSOC (0x01) /**< Mesh AP doesn't detect children leave yet */ +#define MESH_ASSOC_FLAG_VOTE_IN_PROGRESS (0x02) /**< station in vote, set when root vote start, clear when connect to router or when root switch*/ +#define MESH_ASSOC_FLAG_STA_VOTED (0x04) /**< station vote done, set when connect to router */ +#define MESH_ASSOC_FLAG_NETWORK_FREE (0x08) /**< no root in current network */ +#define MESH_ASSOC_FLAG_STA_VOTE_EXPIRE (0x10) /**< the voted address is expired, means the voted device lose the chance to be root */ +#define MESH_ASSOC_FLAG_ROOTS_FOUND (0x20) /**< roots conflict is found, means that there are at least two roots in the mesh network */ +#define MESH_ASSOC_FLAG_ROOT_FIXED (0x40) /**< the root is fixed in the mesh network */ + +/** + * @brief Mesh PS (Power Save) duty cycle type + */ +#define MESH_PS_DEVICE_DUTY_REQUEST (0x01) /**< requests to join a network PS without specifying a device duty cycle. After the + device joins the network, a network duty cycle will be provided by the network */ +#define MESH_PS_DEVICE_DUTY_DEMAND (0x04) /**< requests to join a network PS and specifies a demanded device duty cycle */ +#define MESH_PS_NETWORK_DUTY_MASTER (0x80) /**< indicates the device is the NWK-DUTY-MASTER (network duty cycle master) */ + +/** + * @brief Mesh PS (Power Save) duty cycle applied rule + */ +#define MESH_PS_NETWORK_DUTY_APPLIED_ENTIRE (0) /** the specified network duty is applied to the entire network <*/ +#define MESH_PS_NETWORK_DUTY_APPLIED_UPLINK (1) /** the specified network duty is applied to only the up-link path <*/ + +/******************************************************* + * Enumerations + *******************************************************/ +/** + * @brief Enumerated list of mesh event id + */ +typedef enum { + MESH_EVENT_STARTED, /**< mesh is started */ + MESH_EVENT_STOPPED, /**< mesh is stopped */ + MESH_EVENT_CHANNEL_SWITCH, /**< channel switch */ + MESH_EVENT_CHILD_CONNECTED, /**< a child is connected on softAP interface */ + MESH_EVENT_CHILD_DISCONNECTED, /**< a child is disconnected on softAP interface */ + MESH_EVENT_ROUTING_TABLE_ADD, /**< routing table is changed by adding newly joined children */ + MESH_EVENT_ROUTING_TABLE_REMOVE, /**< routing table is changed by removing leave children */ + MESH_EVENT_PARENT_CONNECTED, /**< parent is connected on station interface */ + MESH_EVENT_PARENT_DISCONNECTED, /**< parent is disconnected on station interface */ + MESH_EVENT_NO_PARENT_FOUND, /**< no parent found */ + MESH_EVENT_LAYER_CHANGE, /**< layer changes over the mesh network */ + MESH_EVENT_TODS_STATE, /**< state represents whether the root is able to access external IP network. + This state is a manual event that needs to be triggered with esp_mesh_post_toDS_state(). */ + MESH_EVENT_VOTE_STARTED, /**< the process of voting a new root is started either by children or by the root */ + MESH_EVENT_VOTE_STOPPED, /**< the process of voting a new root is stopped */ + MESH_EVENT_ROOT_ADDRESS, /**< the root address is obtained. It is posted by mesh stack automatically. */ + MESH_EVENT_ROOT_SWITCH_REQ, /**< root switch request sent from a new voted root candidate */ + MESH_EVENT_ROOT_SWITCH_ACK, /**< root switch acknowledgment responds the above request sent from current root */ + MESH_EVENT_ROOT_ASKED_YIELD, /**< the root is asked yield by a more powerful existing root. If self organized is disabled + and this device is specified to be a root by users, users should set a new parent + for this device. if self organized is enabled, this device will find a new parent + by itself, users could ignore this event. */ + MESH_EVENT_ROOT_FIXED, /**< when devices join a network, if the setting of Fixed Root for one device is different + from that of its parent, the device will update the setting the same as its parent's. + Fixed Root Setting of each device is variable as that setting changes of the root. */ + MESH_EVENT_SCAN_DONE, /**< if self-organized networking is disabled, user can call esp_wifi_scan_start() to trigger + this event, and add the corresponding scan done handler in this event. */ + MESH_EVENT_NETWORK_STATE, /**< network state, such as whether current mesh network has a root. */ + MESH_EVENT_STOP_RECONNECTION, /**< the root stops reconnecting to the router and non-root devices stop reconnecting to their parents. */ + MESH_EVENT_FIND_NETWORK, /**< when the channel field in mesh configuration is set to zero, mesh stack will perform a + full channel scan to find a mesh network that can join, and return the channel value + after finding it. */ + MESH_EVENT_ROUTER_SWITCH, /**< if users specify BSSID of the router in mesh configuration, when the root connects to another + router with the same SSID, this event will be posted and the new router information is attached. */ + MESH_EVENT_PS_PARENT_DUTY, /**< parent duty */ + MESH_EVENT_PS_CHILD_DUTY, /**< child duty */ + MESH_EVENT_PS_DEVICE_DUTY, /**< device duty */ + MESH_EVENT_MAX, +} mesh_event_id_t; + +/** @brief ESP-MESH event base declaration */ +ESP_EVENT_DECLARE_BASE(MESH_EVENT); + +/** + * @brief Device type + */ +typedef enum { + MESH_IDLE, /**< hasn't joined the mesh network yet */ + MESH_ROOT, /**< the only sink of the mesh network. Has the ability to access external IP network */ + MESH_NODE, /**< intermediate device. Has the ability to forward packets over the mesh network */ + MESH_LEAF, /**< has no forwarding ability */ + MESH_STA, /**< connect to router with a standalone Wi-Fi station mode, no network expansion capability */ +} mesh_type_t; + +/** + * @brief Protocol of transmitted application data + */ +typedef enum { + MESH_PROTO_BIN, /**< binary */ + MESH_PROTO_HTTP, /**< HTTP protocol */ + MESH_PROTO_JSON, /**< JSON format */ + MESH_PROTO_MQTT, /**< MQTT protocol */ + MESH_PROTO_AP, /**< IP network mesh communication of node's AP interface */ + MESH_PROTO_STA, /**< IP network mesh communication of node's STA interface */ +} mesh_proto_t; + +/** + * @brief For reliable transmission, mesh stack provides three type of services + */ +typedef enum { + MESH_TOS_P2P, /**< provide P2P (point-to-point) retransmission on mesh stack by default */ + MESH_TOS_E2E, /**< provide E2E (end-to-end) retransmission on mesh stack (Unimplemented) */ + MESH_TOS_DEF, /**< no retransmission on mesh stack */ +} mesh_tos_t; + +/** + * @brief Vote reason + */ +typedef enum { + MESH_VOTE_REASON_ROOT_INITIATED = 1, /**< vote is initiated by the root */ + MESH_VOTE_REASON_CHILD_INITIATED, /**< vote is initiated by children */ +} mesh_vote_reason_t; + +/** + * @brief Mesh disconnect reason code + */ +typedef enum { + MESH_REASON_CYCLIC = 100, /**< cyclic is detected */ + MESH_REASON_PARENT_IDLE, /**< parent is idle */ + MESH_REASON_LEAF, /**< the connected device is changed to a leaf */ + MESH_REASON_DIFF_ID, /**< in different mesh ID */ + MESH_REASON_ROOTS, /**< root conflict is detected */ + MESH_REASON_PARENT_STOPPED, /**< parent has stopped the mesh */ + MESH_REASON_SCAN_FAIL, /**< scan fail */ + MESH_REASON_IE_UNKNOWN, /**< unknown IE */ + MESH_REASON_WAIVE_ROOT, /**< waive root */ + MESH_REASON_PARENT_WORSE, /**< parent with very poor RSSI */ + MESH_REASON_EMPTY_PASSWORD, /**< use an empty password to connect to an encrypted parent */ + MESH_REASON_PARENT_UNENCRYPTED, /**< connect to an unencrypted parent/router */ +} mesh_disconnect_reason_t; + +/** + * @brief Mesh topology + */ +typedef enum { + MESH_TOPO_TREE, /**< tree topology */ + MESH_TOPO_CHAIN, /**< chain topology */ +} esp_mesh_topology_t; + +/******************************************************* + * Structures + *******************************************************/ +/** + * @brief IP address and port + */ +typedef struct { + esp_ip4_addr_t ip4; /**< IP address */ + uint16_t port; /**< port */ +} __attribute__((packed)) mip_t; + +/** + * @brief Mesh address + */ +typedef union { + uint8_t addr[6]; /**< mac address */ + mip_t mip; /**< mip address */ +} mesh_addr_t; + +/** + * @brief Channel switch information + */ +typedef struct { + uint8_t channel; /**< new channel */ +} mesh_event_channel_switch_t; + +/** + * @brief Parent connected information + */ +typedef struct { + wifi_event_sta_connected_t connected; /**< parent information, same as Wi-Fi event SYSTEM_EVENT_STA_CONNECTED does */ + uint16_t self_layer; /**< layer */ + uint8_t duty; /**< parent duty */ +} mesh_event_connected_t; + +/** + * @brief No parent found information + */ +typedef struct { + int scan_times; /**< scan times being through */ +} mesh_event_no_parent_found_t; + +/** + * @brief Layer change information + */ +typedef struct { + uint16_t new_layer; /**< new layer */ +} mesh_event_layer_change_t; + +/** + * @brief The reachability of the root to a DS (distribute system) + */ +typedef enum { + MESH_TODS_UNREACHABLE, /**< the root isn't able to access external IP network */ + MESH_TODS_REACHABLE, /**< the root is able to access external IP network */ +} mesh_event_toDS_state_t; + +/** + * @brief vote started information + */ +typedef struct { + int reason; /**< vote reason, vote could be initiated by children or by the root itself */ + int attempts; /**< max vote attempts before stopped */ + mesh_addr_t rc_addr; /**< root address specified by users via API esp_mesh_waive_root() */ +} mesh_event_vote_started_t; + +/** + * @brief find a mesh network that this device can join + */ +typedef struct { + uint8_t channel; /**< channel number of the new found network */ + uint8_t router_bssid[6]; /**< router BSSID */ +} mesh_event_find_network_t; + +/** + * @brief Root address + */ +typedef mesh_addr_t mesh_event_root_address_t; + +/** + * @brief Parent disconnected information + */ +typedef wifi_event_sta_disconnected_t mesh_event_disconnected_t; + +/** + * @brief Child connected information + */ +typedef wifi_event_ap_staconnected_t mesh_event_child_connected_t; + +/** + * @brief Child disconnected information + */ +typedef wifi_event_ap_stadisconnected_t mesh_event_child_disconnected_t; + +/** + * @brief Root switch request information + */ +typedef struct { + int reason; /**< root switch reason, generally root switch is initialized by users via API esp_mesh_waive_root() */ + mesh_addr_t rc_addr; /**< the address of root switch requester */ +} mesh_event_root_switch_req_t; + +/** + * @brief Other powerful root address + */ +typedef struct { + int8_t rssi; /**< rssi with router */ + uint16_t capacity; /**< the number of devices in current network */ + uint8_t addr[6]; /**< other powerful root address */ +} mesh_event_root_conflict_t; + +/** + * @brief Routing table change + */ +typedef struct { + uint16_t rt_size_new; /**< the new value */ + uint16_t rt_size_change; /**< the changed value */ +} mesh_event_routing_table_change_t; + +/** + * @brief Root fixed + */ +typedef struct { + bool is_fixed; /**< status */ +} mesh_event_root_fixed_t; + +/** + * @brief Scan done event information + */ +typedef struct { + uint8_t number; /**< the number of APs scanned */ +} mesh_event_scan_done_t; + +/** + * @brief Network state information + */ +typedef struct { + bool is_rootless; /**< whether current mesh network has a root */ +} mesh_event_network_state_t; + +/** + * @brief New router information + */ +typedef wifi_event_sta_connected_t mesh_event_router_switch_t; + +/** + * @brief PS duty information + */ +typedef struct { + uint8_t duty; /**< parent or child duty */ + mesh_event_child_connected_t child_connected; /**< child info */ +} mesh_event_ps_duty_t; + +/** + * @brief Mesh event information + */ +typedef union { + mesh_event_channel_switch_t channel_switch; /**< channel switch */ + mesh_event_child_connected_t child_connected; /**< child connected */ + mesh_event_child_disconnected_t child_disconnected; /**< child disconnected */ + mesh_event_routing_table_change_t routing_table; /**< routing table change */ + mesh_event_connected_t connected; /**< parent connected */ + mesh_event_disconnected_t disconnected; /**< parent disconnected */ + mesh_event_no_parent_found_t no_parent; /**< no parent found */ + mesh_event_layer_change_t layer_change; /**< layer change */ + mesh_event_toDS_state_t toDS_state; /**< toDS state, devices shall check this state firstly before trying to send packets to + external IP network. This state indicates right now whether the root is capable of sending + packets out. If not, devices had better to wait until this state changes to be + MESH_TODS_REACHABLE. */ + mesh_event_vote_started_t vote_started; /**< vote started */ + mesh_event_root_address_t root_addr; /**< root address */ + mesh_event_root_switch_req_t switch_req; /**< root switch request */ + mesh_event_root_conflict_t root_conflict; /**< other powerful root */ + mesh_event_root_fixed_t root_fixed; /**< fixed root */ + mesh_event_scan_done_t scan_done; /**< scan done */ + mesh_event_network_state_t network_state; /**< network state, such as whether current mesh network has a root. */ + mesh_event_find_network_t find_network; /**< network found that can join */ + mesh_event_router_switch_t router_switch; /**< new router information */ + mesh_event_ps_duty_t ps_duty; /**< PS duty information */ +} mesh_event_info_t; + +/** + * @brief Mesh option + */ +typedef struct { + uint8_t type; /**< option type */ + uint16_t len; /**< option length */ + uint8_t *val; /**< option value */ +} __attribute__((packed)) mesh_opt_t; + +/** + * @brief Mesh data for esp_mesh_send() and esp_mesh_recv() + */ +typedef struct { + uint8_t *data; /**< data */ + uint16_t size; /**< data size */ + mesh_proto_t proto; /**< data protocol */ + mesh_tos_t tos; /**< data type of service */ +} mesh_data_t; + +/** + * @brief Router configuration + */ +typedef struct { + uint8_t ssid[32]; /**< SSID */ + uint8_t ssid_len; /**< length of SSID */ + uint8_t bssid[6]; /**< BSSID, if this value is specified, users should also specify "allow_router_switch". */ + uint8_t password[64]; /**< password */ + bool allow_router_switch; /**< if the BSSID is specified and this value is also set, when the router of this specified BSSID + fails to be found after "fail" (mesh_attempts_t) times, the whole network is allowed to switch + to another router with the same SSID. The new router might also be on a different channel. + The default value is false. + There is a risk that if the password is different between the new switched router and the previous + one, the mesh network could be established but the root will never connect to the new switched router. */ +} mesh_router_t; + +/** + * @brief Mesh softAP configuration + */ +typedef struct { + uint8_t password[64]; /**< mesh softAP password */ + /** + * max number of stations allowed to connect in, default 6, max 10 + * = max_connection + nonmesh_max_connection + */ + uint8_t max_connection; /**< max mesh connections */ + uint8_t nonmesh_max_connection; /**< max non-mesh connections */ +} mesh_ap_cfg_t; + +/** + * @brief Mesh initialization configuration + */ +typedef struct { + uint8_t channel; /**< channel, the mesh network on */ + bool allow_channel_switch; /**< if this value is set, when "fail" (mesh_attempts_t) times is reached, device will change to + a full channel scan for a network that could join. The default value is false. */ + mesh_addr_t mesh_id; /**< mesh network identification */ + mesh_router_t router; /**< router configuration */ + mesh_ap_cfg_t mesh_ap; /**< mesh softAP configuration */ + const mesh_crypto_funcs_t *crypto_funcs; /**< crypto functions */ +} mesh_cfg_t; + +/** + * @brief Vote address configuration + */ +typedef union { + int attempts; /**< max vote attempts before a new root is elected automatically by mesh network. (min:15, 15 by default) */ + mesh_addr_t rc_addr; /**< a new root address specified by users for API esp_mesh_waive_root() */ +} mesh_rc_config_t; + +/** + * @brief Vote + */ +typedef struct { + float percentage; /**< vote percentage threshold for approval of being a root */ + bool is_rc_specified; /**< if true, rc_addr shall be specified (Unimplemented). + if false, attempts value shall be specified to make network start root election. */ + mesh_rc_config_t config; /**< vote address configuration */ +} mesh_vote_t; + +/** + * @brief The number of packets pending in the queue waiting to be sent by the mesh stack + */ +typedef struct { + int to_parent; /**< to parent queue */ + int to_parent_p2p; /**< to parent (P2P) queue */ + int to_child; /**< to child queue */ + int to_child_p2p; /**< to child (P2P) queue */ + int mgmt; /**< management queue */ + int broadcast; /**< broadcast and multicast queue */ +} mesh_tx_pending_t; + +/** + * @brief The number of packets available in the queue waiting to be received by applications + */ +typedef struct { + int toDS; /**< to external DS */ + int toSelf; /**< to self */ +} mesh_rx_pending_t; + +/******************************************************* + * Variable Declaration + *******************************************************/ +/* mesh IE crypto callback function */ +extern const mesh_crypto_funcs_t g_wifi_default_mesh_crypto_funcs; + +#define MESH_INIT_CONFIG_DEFAULT() { \ + .crypto_funcs = &g_wifi_default_mesh_crypto_funcs, \ +} + +/******************************************************* + * Function Definitions + *******************************************************/ +/** + * @brief Mesh initialization + * - Check whether Wi-Fi is started. + * - Initialize mesh global variables with default values. + * + * @attention This API shall be called after Wi-Fi is started. + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t esp_mesh_init(void); + +/** + * @brief Mesh de-initialization + * + * - Release resources and stop the mesh + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t esp_mesh_deinit(void); + +/** + * @brief Start mesh + * - Initialize mesh IE. + * - Start mesh network management service. + * - Create TX and RX queues according to the configuration. + * - Register mesh packets receive callback. + * + * @attention  This API shall be called after mesh initialization and configuration. + * + * @return + * - ESP_OK + * - ESP_FAIL + * - ESP_ERR_MESH_NOT_INIT + * - ESP_ERR_MESH_NOT_CONFIG + * - ESP_ERR_MESH_NO_MEMORY + */ +esp_err_t esp_mesh_start(void); + +/** + * @brief Stop mesh + * - Deinitialize mesh IE. + * - Disconnect with current parent. + * - Disassociate all currently associated children. + * - Stop mesh network management service. + * - Unregister mesh packets receive callback. + * - Delete TX and RX queues. + * - Release resources. + * - Restore Wi-Fi softAP to default settings if Wi-Fi dual mode is enabled. + * - Set Wi-Fi Power Save type to WIFI_PS_NONE. + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t esp_mesh_stop(void); + +/** + * @brief Send a packet over the mesh network + * - Send a packet to any device in the mesh network. + * - Send a packet to external IP network. + * + * @attention This API is not reentrant. + * + * @param[in] to the address of the final destination of the packet + * - If the packet is to the root, set this parameter to NULL. + * - If the packet is to an external IP network, set this parameter to the IPv4:PORT combination. + * This packet will be delivered to the root firstly, then users need to call esp_mesh_recv_toDS() on the root node to forward this + * packet to the final IP server address. + * @param[in] data pointer to a sending mesh packet + * - Field size should not exceed MESH_MPS. Note that the size of one mesh packet should not exceed MESH_MTU. + * - Field proto should be set to data protocol in use (default is MESH_PROTO_BIN for binary). + * - Field tos should be set to transmission tos (type of service) in use (default is MESH_TOS_P2P for point-to-point reliable). + * - If the packet is to the root, MESH_TOS_P2P must be set to ensure reliable transmission. + * - As long as the MESH_TOS_P2P is set, the API is blocking, even if the flag is set with MESH_DATA_NONBLOCK. + * - As long as the MESH_TOS_DEF is set, the API is non-blocking. + * @param[in] flag bitmap for data sent + * - Flag is at least one of the three MESH_DATA_P2P/MESH_DATA_FROMDS/MESH_DATA_TODS, which represents the direction of packet sending. + * - Speed up the route search + * - If the packet is to an internal device, MESH_DATA_P2P should be set. + * - If the packet is to the root ("to" parameter isn't NULL) or to external IP network, MESH_DATA_TODS should be set. + * - If the packet is from the root to an internal device, MESH_DATA_FROMDS should be set. + * - Specify whether this API is blocking or non-blocking, blocking by default. + * - In the situation of the root change, MESH_DATA_DROP identifies this packet can be dropped by the new root + * for upstream data to external IP network, we try our best to avoid data loss caused by the root change, but + * there is a risk that the new root is running out of memory because most of memory is occupied by the pending data which + * isn't read out in time by esp_mesh_recv_toDS(). + * + * Generally, we suggest esp_mesh_recv_toDS() is called after a connection with IP network is created. Thus data outgoing + * to external IP network via socket is just from reading esp_mesh_recv_toDS() which avoids unnecessary memory copy. + * + * @param[in] opt options + * - In case of sending a packet to a certain group, MESH_OPT_SEND_GROUP is a good choice. + * In this option, the value field should be set to the target receiver addresses in this group. + * - Root sends a packet to an internal device, this packet is from external IP network in case the receiver device responds + * this packet, MESH_OPT_RECV_DS_ADDR is required to attach the target DS address. + * @param[in] opt_count option count + * - Currently, this API only takes one option, so opt_count is only supported to be 1. + * + * @return + * - ESP_OK + * - ESP_FAIL + * - ESP_ERR_MESH_ARGUMENT + * - ESP_ERR_MESH_NOT_START + * - ESP_ERR_MESH_DISCONNECTED + * - ESP_ERR_MESH_OPT_UNKNOWN + * - ESP_ERR_MESH_EXCEED_MTU + * - ESP_ERR_MESH_NO_MEMORY + * - ESP_ERR_MESH_TIMEOUT + * - ESP_ERR_MESH_QUEUE_FULL + * - ESP_ERR_MESH_NO_ROUTE_FOUND + * - ESP_ERR_MESH_DISCARD + * - ESP_ERR_MESH_NOT_SUPPORT + * - ESP_ERR_MESH_XMIT + */ +esp_err_t esp_mesh_send(const mesh_addr_t *to, const mesh_data_t *data, + int flag, const mesh_opt_t opt[], int opt_count); +/** + * @brief Set blocking time of esp_mesh_send() + * - Suggest to set the blocking time to at least 5s when the environment is poor. Otherwise, esp_mesh_send() may timeout frequently. + * + * @attention This API shall be called before mesh is started. + * + * @param[in] time_ms blocking time of esp_mesh_send(), unit:ms + * + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_send_block_time(uint32_t time_ms); + +/** + * @brief Receive a packet targeted to self over the mesh network + * + * @attention Mesh RX queue should be checked regularly to avoid running out of memory. + * - Use esp_mesh_get_rx_pending() to check the number of packets available in the queue waiting + * to be received by applications. + * + * @param[out] from the address of the original source of the packet + * @param[out] data pointer to the received mesh packet + * - Field proto is the data protocol in use. Should follow it to parse the received data. + * - Field tos is the transmission tos (type of service) in use. + * @param[in] timeout_ms wait time if a packet isn't immediately available (0:no wait, portMAX_DELAY:wait forever) + * @param[out] flag bitmap for data received + * - MESH_DATA_FROMDS represents data from external IP network + * - MESH_DATA_TODS represents data directed upward within the mesh network + * + * flag could be MESH_DATA_FROMDS or MESH_DATA_TODS. + * @param[out] opt options desired to receive + * - MESH_OPT_RECV_DS_ADDR attaches the DS address + * @param[in] opt_count option count desired to receive + * - Currently, this API only takes one option, so opt_count is only supported to be 1. + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_ARGUMENT + * - ESP_ERR_MESH_NOT_START + * - ESP_ERR_MESH_TIMEOUT + * - ESP_ERR_MESH_DISCARD + */ +esp_err_t esp_mesh_recv(mesh_addr_t *from, mesh_data_t *data, int timeout_ms, + int *flag, mesh_opt_t opt[], int opt_count); + +/** + * @brief Receive a packet targeted to external IP network + * - Root uses this API to receive packets destined to external IP network + * - Root forwards the received packets to the final destination via socket. + * - If no socket connection is ready to send out the received packets and this esp_mesh_recv_toDS() + * hasn't been called by applications, packets from the whole mesh network will be pending in toDS queue. + * + * Use esp_mesh_get_rx_pending() to check the number of packets available in the queue waiting + * to be received by applications in case of running out of memory in the root. + * + * Using esp_mesh_set_xon_qsize() users may configure the RX queue size, default:32. If this size is too large, + * and esp_mesh_recv_toDS() isn't called in time, there is a risk that a great deal of memory is occupied + * by the pending packets. If this size is too small, it will impact the efficiency on upstream. How to + * decide this value depends on the specific application scenarios. + * + * @attention This API is only called by the root. + * + * @param[out] from the address of the original source of the packet + * @param[out] to the address contains remote IP address and port (IPv4:PORT) + * @param[out] data pointer to the received packet + * - Contain the protocol and applications should follow it to parse the data. + * @param[in] timeout_ms wait time if a packet isn't immediately available (0:no wait, portMAX_DELAY:wait forever) + * @param[out] flag bitmap for data received + * - MESH_DATA_TODS represents the received data target to external IP network. Root shall forward this data to external IP network via the association with router. + * + * flag could be MESH_DATA_TODS. + * @param[out] opt options desired to receive + * @param[in] opt_count option count desired to receive + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_ARGUMENT + * - ESP_ERR_MESH_NOT_START + * - ESP_ERR_MESH_TIMEOUT + * - ESP_ERR_MESH_DISCARD + * - ESP_ERR_MESH_RECV_RELEASE + */ +esp_err_t esp_mesh_recv_toDS(mesh_addr_t *from, mesh_addr_t *to, + mesh_data_t *data, int timeout_ms, int *flag, mesh_opt_t opt[], + int opt_count); + +/** + * @brief Set mesh stack configuration + * - Use MESH_INIT_CONFIG_DEFAULT() to initialize the default values, mesh IE is encrypted by default. + * - Mesh network is established on a fixed channel (1-14). + * - Mesh event callback is mandatory. + * - Mesh ID is an identifier of an MBSS. Nodes with the same mesh ID can communicate with each other. + * - Regarding to the router configuration, if the router is hidden, BSSID field is mandatory. + * + * If BSSID field isn't set and there exists more than one router with same SSID, there is a risk that more + * roots than one connected with different BSSID will appear. It means more than one mesh network is established + * with the same mesh ID. + * + * Root conflict function could eliminate redundant roots connected with the same BSSID, but couldn't handle roots + * connected with different BSSID. Because users might have such requirements of setting up routers with same SSID + * for the future replacement. But in that case, if the above situations happen, please make sure applications + * implement forward functions on the root to guarantee devices in different mesh networks can communicate with each other. + * max_connection of mesh softAP is limited by the max number of Wi-Fi softAP supported (max:10). + * + * @attention This API shall be called before mesh is started after mesh is initialized. + * + * @param[in] config pointer to mesh stack configuration + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_ARGUMENT + * - ESP_ERR_MESH_NOT_ALLOWED + */ +esp_err_t esp_mesh_set_config(const mesh_cfg_t *config); + +/** + * @brief Get mesh stack configuration + * + * @param[out] config pointer to mesh stack configuration + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_ARGUMENT + */ +esp_err_t esp_mesh_get_config(mesh_cfg_t *config); + +/** + * @brief Get router configuration + * + * @attention This API is used to dynamically modify the router configuration after mesh is configured. + * + * @param[in] router pointer to router configuration + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_ARGUMENT + */ +esp_err_t esp_mesh_set_router(const mesh_router_t *router); + +/** + * @brief Get router configuration + * + * @param[out] router pointer to router configuration + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_ARGUMENT + */ +esp_err_t esp_mesh_get_router(mesh_router_t *router); + +/** + * @brief Set mesh network ID + * + * @attention This API is used to dynamically modify the mesh network ID. + * + * @param[in] id pointer to mesh network ID + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_ARGUMENT: invalid argument + */ +esp_err_t esp_mesh_set_id(const mesh_addr_t *id); + +/** + * @brief Get mesh network ID + * + * @param[out] id pointer to mesh network ID + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_ARGUMENT + */ +esp_err_t esp_mesh_get_id(mesh_addr_t *id); + +/** + * @brief Designate device type over the mesh network + * - MESH_IDLE: designates a device as a self-organized node for a mesh network + * - MESH_ROOT: designates the root node for a mesh network + * - MESH_LEAF: designates a device as a standalone Wi-Fi station that connects to a parent + * - MESH_STA: designates a device as a standalone Wi-Fi station that connects to a router + * + * @param[in] type device type + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_NOT_ALLOWED + */ +esp_err_t esp_mesh_set_type(mesh_type_t type); + +/** + * @brief Get device type over mesh network + * + * @attention This API shall be called after having received the event MESH_EVENT_PARENT_CONNECTED. + * + * @return mesh type + * + */ +mesh_type_t esp_mesh_get_type(void); + +/** + * @brief Set network max layer value + * - for tree topology, the max is 25. + * - for chain topology, the max is 1000. + * - Network max layer limits the max hop count. + * + * @attention This API shall be called before mesh is started. + * + * @param[in] max_layer max layer value + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_ARGUMENT + * - ESP_ERR_MESH_NOT_ALLOWED + */ +esp_err_t esp_mesh_set_max_layer(int max_layer); + +/** + * @brief Get max layer value + * + * @return max layer value + */ +int esp_mesh_get_max_layer(void); + +/** + * @brief Set mesh softAP password + * + * @attention This API shall be called before mesh is started. + * + * @param[in] pwd pointer to the password + * @param[in] len password length + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_ARGUMENT + * - ESP_ERR_MESH_NOT_ALLOWED + */ +esp_err_t esp_mesh_set_ap_password(const uint8_t *pwd, int len); + +/** + * @brief Set mesh softAP authentication mode + * + * @attention This API shall be called before mesh is started. + * + * @param[in] authmode authentication mode + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_ARGUMENT + * - ESP_ERR_MESH_NOT_ALLOWED + */ +esp_err_t esp_mesh_set_ap_authmode(wifi_auth_mode_t authmode); + +/** + * @brief Get mesh softAP authentication mode + * + * @return authentication mode + */ +wifi_auth_mode_t esp_mesh_get_ap_authmode(void); + +/** + * @brief Set mesh max connection value + * - Set mesh softAP max connection = mesh max connection + non-mesh max connection + * + * @attention This API shall be called before mesh is started. + * + * @param[in] connections the number of max connections + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_ARGUMENT + */ +esp_err_t esp_mesh_set_ap_connections(int connections); + +/** + * @brief Get mesh max connection configuration + * + * @return the number of mesh max connections + */ +int esp_mesh_get_ap_connections(void); + +/** + * @brief Get non-mesh max connection configuration + * + * @return the number of non-mesh max connections + */ +int esp_mesh_get_non_mesh_connections(void); + +/** + * @brief Get current layer value over the mesh network + * + * @attention This API shall be called after having received the event MESH_EVENT_PARENT_CONNECTED. + * + * @return layer value + * + */ +int esp_mesh_get_layer(void); + +/** + * @brief Get the parent BSSID + * + * @attention This API shall be called after having received the event MESH_EVENT_PARENT_CONNECTED. + * + * @param[out] bssid pointer to parent BSSID + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t esp_mesh_get_parent_bssid(mesh_addr_t *bssid); + +/** + * @brief Return whether the device is the root node of the network + * + * @return true/false + */ +bool esp_mesh_is_root(void); + +/** + * @brief Enable/disable self-organized networking + * - Self-organized networking has three main functions: + * select the root node; + * find a preferred parent; + * initiate reconnection if a disconnection is detected. + * - Self-organized networking is enabled by default. + * - If self-organized is disabled, users should set a parent for the device via esp_mesh_set_parent(). + * + * @attention This API is used to dynamically modify whether to enable the self organizing. + * + * @param[in] enable enable or disable self-organized networking + * @param[in] select_parent Only valid when self-organized networking is enabled. + * - if select_parent is set to true, the root will give up its mesh root status and search for a new parent + * like other non-root devices. + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t esp_mesh_set_self_organized(bool enable, bool select_parent); + +/** + * @brief Return whether enable self-organized networking or not + * + * @return true/false + */ +bool esp_mesh_get_self_organized(void); + +/** + * @brief Cause the root device to give up (waive) its mesh root status + * - A device is elected root primarily based on RSSI from the external router. + * - If external router conditions change, users can call this API to perform a root switch. + * - In this API, users could specify a desired root address to replace itself or specify an attempts value + * to ask current root to initiate a new round of voting. During the voting, a better root candidate would + * be expected to find to replace the current one. + * - If no desired root candidate, the vote will try a specified number of attempts (at least 15). If no better + * root candidate is found, keep the current one. If a better candidate is found, the new better one will + * send a root switch request to the current root, current root will respond with a root switch acknowledgment. + * - After that, the new candidate will connect to the router to be a new root, the previous root will disconnect + * with the router and choose another parent instead. + * + * Root switch is completed with minimal disruption to the whole mesh network. + * + * @attention This API is only called by the root. + * + * @param[in] vote vote configuration + * - If this parameter is set NULL, the vote will perform the default 15 times. + * + * - Field percentage threshold is 0.9 by default. + * - Field is_rc_specified shall be false. + * - Field attempts shall be at least 15 times. + * @param[in] reason only accept MESH_VOTE_REASON_ROOT_INITIATED for now + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_QUEUE_FULL + * - ESP_ERR_MESH_DISCARD + * - ESP_FAIL + */ +esp_err_t esp_mesh_waive_root(const mesh_vote_t *vote, int reason); + +/** + * @brief Set vote percentage threshold for approval of being a root (default:0.9) + * - During the networking, only obtaining vote percentage reaches this threshold, + * the device could be a root. + * + * @attention This API shall be called before mesh is started. + * + * @param[in] percentage vote percentage threshold + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t esp_mesh_set_vote_percentage(float percentage); + +/** + * @brief Get vote percentage threshold for approval of being a root + * + * @return percentage threshold + */ +float esp_mesh_get_vote_percentage(void); + +/** + * @brief Set mesh softAP associate expired time (default:10 seconds) + * - If mesh softAP hasn't received any data from an associated child within this time, + * mesh softAP will take this child inactive and disassociate it. + * - If mesh softAP is encrypted, this value should be set a greater value, such as 30 seconds. + * + * @param[in] seconds the expired time + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t esp_mesh_set_ap_assoc_expire(int seconds); + +/** + * @brief Get mesh softAP associate expired time + * + * @return seconds + */ +int esp_mesh_get_ap_assoc_expire(void); + +/** + * @brief Get total number of devices in current network (including the root) + * + * @attention The returned value might be incorrect when the network is changing. + ** + * @return total number of devices (including the root) + */ +int esp_mesh_get_total_node_num(void); + +/** + * @brief Get the number of devices in this device's sub-network (including self) + * + * @return the number of devices over this device's sub-network (including self) + */ +int esp_mesh_get_routing_table_size(void); + +/** + * @brief Get routing table of this device's sub-network (including itself) + * + * @param[out] mac pointer to routing table + * @param[in] len routing table size(in bytes) + * @param[out] size pointer to the number of devices in routing table (including itself) + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_ARGUMENT + */ +esp_err_t esp_mesh_get_routing_table(mesh_addr_t *mac, int len, int *size); + +/** + * @brief Post the toDS state to the mesh stack + * + * @attention This API is only for the root. + * + * @param[in] reachable this state represents whether the root is able to access external IP network + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t esp_mesh_post_toDS_state(bool reachable); + +/** + * @brief Return the number of packets pending in the queue waiting to be sent by the mesh stack + * + * @param[out] pending pointer to the TX pending + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t esp_mesh_get_tx_pending(mesh_tx_pending_t *pending); + +/** + * @brief Return the number of packets available in the queue waiting to be received by applications + * + * @param[out] pending pointer to the RX pending + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t esp_mesh_get_rx_pending(mesh_rx_pending_t *pending); + +/** + * @brief Return the number of packets could be accepted from the specified address + * + * @param[in] addr self address or an associate children address + * @param[out] xseqno_in sequence number of the last received packet from the specified address + * + * @return the number of upQ for a certain address + */ +int esp_mesh_available_txupQ_num(const mesh_addr_t *addr, uint32_t *xseqno_in); + +/** + * @brief Set the number of RX queue for the node, the average number of window allocated to one of + * its child node is: wnd = xon_qsize / (2 * max_connection + 1). + * However, the window of each child node is not strictly equal to the average value, + * it is affected by the traffic also. + * + * @attention This API shall be called before mesh is started. + * + * @param[in] qsize default:32 (min:16) + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t esp_mesh_set_xon_qsize(int qsize); + +/** + * @brief Get queue size + * + * @return the number of queue + */ +int esp_mesh_get_xon_qsize(void); + +/** + * @brief Set whether allow more than one root existing in one network + * - The default value is true, that is, multiple roots are allowed. + * + * @param[in] allowed allow or not + * + * @return + * - ESP_OK + * - ESP_WIFI_ERR_NOT_INIT + * - ESP_WIFI_ERR_NOT_START + */ +esp_err_t esp_mesh_allow_root_conflicts(bool allowed); + +/** + * @brief Check whether allow more than one root to exist in one network + * + * @return true/false + */ +bool esp_mesh_is_root_conflicts_allowed(void); + +/** + * @brief Set group ID addresses + * + * @param[in] addr pointer to new group ID addresses + * @param[in] num the number of group ID addresses + * + * @return + * - ESP_OK + * - ESP_MESH_ERR_ARGUMENT + */ +esp_err_t esp_mesh_set_group_id(const mesh_addr_t *addr, int num); + +/** + * @brief Delete group ID addresses + * + * @param[in] addr pointer to deleted group ID address + * @param[in] num the number of group ID addresses + * + * @return + * - ESP_OK + * - ESP_MESH_ERR_ARGUMENT + */ +esp_err_t esp_mesh_delete_group_id(const mesh_addr_t *addr, int num); + +/** + * @brief Get the number of group ID addresses + * + * @return the number of group ID addresses + */ +int esp_mesh_get_group_num(void); + +/** + * @brief Get group ID addresses + * + * @param[out] addr pointer to group ID addresses + * @param[in] num the number of group ID addresses + * + * @return + * - ESP_OK + * - ESP_MESH_ERR_ARGUMENT + */ +esp_err_t esp_mesh_get_group_list(mesh_addr_t *addr, int num); + +/** + * @brief Check whether the specified group address is my group + * + * @return true/false + */ +bool esp_mesh_is_my_group(const mesh_addr_t *addr); + +/** + * @brief Set mesh network capacity (max:1000, default:300) + * + * @attention This API shall be called before mesh is started. + * + * @param[in] num mesh network capacity + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_NOT_ALLOWED + * - ESP_MESH_ERR_ARGUMENT + */ +esp_err_t esp_mesh_set_capacity_num(int num); + +/** + * @brief Get mesh network capacity + * + * @return mesh network capacity + */ +int esp_mesh_get_capacity_num(void); + +/** + * @brief Set mesh IE crypto functions + * + * @attention This API can be called at any time after mesh is configured. + * + * @param[in] crypto_funcs crypto functions for mesh IE + * - If crypto_funcs is set to NULL, mesh IE is no longer encrypted. + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_set_ie_crypto_funcs(const mesh_crypto_funcs_t *crypto_funcs); + +/** + * @brief Set mesh IE crypto key + * + * @attention This API can be called at any time after mesh is configured. + * + * @param[in] key ASCII crypto key + * @param[in] len length in bytes, range:8~64 + * + * @return + * - ESP_OK + * - ESP_MESH_ERR_ARGUMENT + */ +esp_err_t esp_mesh_set_ie_crypto_key(const char *key, int len); + +/** + * @brief Get mesh IE crypto key + * + * @param[out] key ASCII crypto key + * @param[in] len length in bytes, range:8~64 + * + * @return + * - ESP_OK + * - ESP_MESH_ERR_ARGUMENT + */ +esp_err_t esp_mesh_get_ie_crypto_key(char *key, int len); + +/** + * @brief Set delay time before starting root healing + * + * @param[in] delay_ms delay time in milliseconds + * + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_set_root_healing_delay(int delay_ms); + +/** + * @brief Get delay time before network starts root healing + * + * @return delay time in milliseconds + */ +int esp_mesh_get_root_healing_delay(void); + +/** + * @brief Enable network Fixed Root Setting + * - Enabling fixed root disables automatic election of the root node via voting. + * - All devices in the network shall use the same Fixed Root Setting (enabled or disabled). + * - If Fixed Root is enabled, users should make sure a root node is designated for the network. + * + * @param[in] enable enable or not + * + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_fix_root(bool enable); + +/** + * @brief Check whether network Fixed Root Setting is enabled + * - Enable/disable network Fixed Root Setting by API esp_mesh_fix_root(). + * - Network Fixed Root Setting also changes with the "flag" value in parent networking IE. + * + * @return true/false + */ +bool esp_mesh_is_root_fixed(void); + +/** + * @brief Set a specified parent for the device + * + * @attention This API can be called at any time after mesh is configured. + * + * @param[in] parent parent configuration, the SSID and the channel of the parent are mandatory. + * - If the BSSID is set, make sure that the SSID and BSSID represent the same parent, + * otherwise the device will never find this specified parent. + * @param[in] parent_mesh_id parent mesh ID, + * - If this value is not set, the original mesh ID is used. + * @param[in] my_type mesh type + * - MESH_STA is not supported. + * - If the parent set for the device is the same as the router in the network configuration, + * then my_type shall set MESH_ROOT and my_layer shall set MESH_ROOT_LAYER. + * @param[in] my_layer mesh layer + * - my_layer of the device may change after joining the network. + * - If my_type is set MESH_NODE, my_layer shall be greater than MESH_ROOT_LAYER. + * - If my_type is set MESH_LEAF, the device becomes a standalone Wi-Fi station and no longer + * has the ability to extend the network. + * + * @return + * - ESP_OK + * - ESP_ERR_ARGUMENT + * - ESP_ERR_MESH_NOT_CONFIG + */ +esp_err_t esp_mesh_set_parent(const wifi_config_t *parent, const mesh_addr_t *parent_mesh_id, mesh_type_t my_type, int my_layer); + +/** + * @brief Get mesh networking IE length of one AP + * + * @param[out] len mesh networking IE length + * + * @return + * - ESP_OK + * - ESP_ERR_WIFI_NOT_INIT + * - ESP_ERR_INVALID_ARG + * - ESP_ERR_WIFI_FAIL + */ +esp_err_t esp_mesh_scan_get_ap_ie_len(int *len); + +/** + * @brief Get AP record + * + * @attention Different from esp_wifi_scan_get_ap_records(), this API only gets one of APs scanned each time. + * See "manual_networking" example. + * + * @param[out] ap_record pointer to one AP record + * @param[out] buffer pointer to the mesh networking IE of this AP + * + * @return + * - ESP_OK + * - ESP_ERR_WIFI_NOT_INIT + * - ESP_ERR_INVALID_ARG + * - ESP_ERR_WIFI_FAIL + */ +esp_err_t esp_mesh_scan_get_ap_record(wifi_ap_record_t *ap_record, void *buffer); + +/** + * @brief Flush upstream packets pending in to_parent queue and to_parent_p2p queue + * + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_flush_upstream_packets(void); + +/** + * @brief Get the number of nodes in the subnet of a specific child + * + * @param[in] child_mac an associated child address of this device + * @param[out] nodes_num pointer to the number of nodes in the subnet of a specific child + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_NOT_START + * - ESP_ERR_MESH_ARGUMENT + */ +esp_err_t esp_mesh_get_subnet_nodes_num(const mesh_addr_t *child_mac, int *nodes_num); + +/** + * @brief Get nodes in the subnet of a specific child + * + * @param[in] child_mac an associated child address of this device + * @param[out] nodes pointer to nodes in the subnet of a specific child + * @param[in] nodes_num the number of nodes in the subnet of a specific child + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_NOT_START + * - ESP_ERR_MESH_ARGUMENT + */ +esp_err_t esp_mesh_get_subnet_nodes_list(const mesh_addr_t *child_mac, mesh_addr_t *nodes, int nodes_num); + +/** + * @brief Disconnect from current parent + * + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_disconnect(void); + +/** + * @brief Connect to current parent + * + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_connect(void); + +/** + * @brief Flush scan result + * + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_flush_scan_result(void); + +/** + * @brief Cause the root device to add Channel Switch Announcement Element (CSA IE) to beacon + * - Set the new channel + * - Set how many beacons with CSA IE will be sent before changing a new channel + * - Enable the channel switch function + * + * @attention This API is only called by the root. + * + * @param[in] new_bssid the new router BSSID if the router changes + * @param[in] csa_newchan the new channel number to which the whole network is moving + * @param[in] csa_count channel switch period(beacon count), unit is based on beacon interval of its softAP, the default value is 15. + * + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_switch_channel(const uint8_t *new_bssid, int csa_newchan, int csa_count); + +/** + * @brief Get the router BSSID + * + * @param[out] router_bssid pointer to the router BSSID + * + * @return + * - ESP_OK + * - ESP_ERR_WIFI_NOT_INIT + * - ESP_ERR_INVALID_ARG + */ +esp_err_t esp_mesh_get_router_bssid(uint8_t *router_bssid); + +/** + * @brief Get the TSF time + * + * @return the TSF time + */ +int64_t esp_mesh_get_tsf_time(void); + +/** + * @brief Set mesh topology. The default value is MESH_TOPO_TREE + * - MESH_TOPO_CHAIN supports up to 1000 layers + * + * @attention This API shall be called before mesh is started. + * + * @param[in] topo MESH_TOPO_TREE or MESH_TOPO_CHAIN + * + * @return + * - ESP_OK + * - ESP_MESH_ERR_ARGUMENT + * - ESP_ERR_MESH_NOT_ALLOWED + */ +esp_err_t esp_mesh_set_topology(esp_mesh_topology_t topo); + +/** + * @brief Get mesh topology + * + * @return MESH_TOPO_TREE or MESH_TOPO_CHAIN + */ +esp_mesh_topology_t esp_mesh_get_topology(void); + +/** + * @brief Enable mesh Power Save function + * + * @attention This API shall be called before mesh is started. + * + * @return + * - ESP_OK + * - ESP_ERR_WIFI_NOT_INIT + * - ESP_ERR_MESH_NOT_ALLOWED + */ +esp_err_t esp_mesh_enable_ps(void); + +/** + * @brief Disable mesh Power Save function + * + * @attention This API shall be called before mesh is started. + * + * @return + * - ESP_OK + * - ESP_ERR_WIFI_NOT_INIT + * - ESP_ERR_MESH_NOT_ALLOWED + */ +esp_err_t esp_mesh_disable_ps(void); + +/** + * @brief Check whether the mesh Power Save function is enabled + * + * @return true/false + */ +bool esp_mesh_is_ps_enabled(void); + +/** + * @brief Check whether the device is in active state + * - If the device is not in active state, it will neither transmit nor receive frames. + * + * @return true/false + */ +bool esp_mesh_is_device_active(void); + +/** + * @brief Set the device duty cycle and type + * - The range of dev_duty values is 1 to 100. The default value is 10. + * - dev_duty = 100, the PS will be stopped. + * - dev_duty is better to not less than 5. + * - dev_duty_type could be MESH_PS_DEVICE_DUTY_REQUEST or MESH_PS_DEVICE_DUTY_DEMAND. + * - If dev_duty_type is set to MESH_PS_DEVICE_DUTY_REQUEST, the device will use a nwk_duty provided by the network. + * - If dev_duty_type is set to MESH_PS_DEVICE_DUTY_DEMAND, the device will use the specified dev_duty. + * + * @attention This API can be called at any time after mesh is started. + * + * @param[in] dev_duty device duty cycle + * @param[in] dev_duty_type device PS duty cycle type, not accept MESH_PS_NETWORK_DUTY_MASTER + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t esp_mesh_set_active_duty_cycle(int dev_duty, int dev_duty_type); + +/** + * @brief Get device duty cycle and type + * + * @param[out] dev_duty device duty cycle + * @param[out] dev_duty_type device PS duty cycle type + * + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_get_active_duty_cycle(int* dev_duty, int* dev_duty_type); + +/** + * @brief Set the network duty cycle, duration and rule + * - The range of nwk_duty values is 1 to 100. The default value is 10. + * - nwk_duty is the network duty cycle the entire network or the up-link path will use. A device that successfully + * sets the nwk_duty is known as a NWK-DUTY-MASTER. + * - duration_mins specifies how long the specified nwk_duty will be used. Once duration_mins expires, the root will take + * over as the NWK-DUTY-MASTER. If an existing NWK-DUTY-MASTER leaves the network, the root will take over as the + * NWK-DUTY-MASTER again. + * - duration_mins = (-1) represents nwk_duty will be used until a new NWK-DUTY-MASTER with a different nwk_duty appears. + * - Only the root can set duration_mins to (-1). + * - If applied_rule is set to MESH_PS_NETWORK_DUTY_APPLIED_ENTIRE, the nwk_duty will be used by the entire network. + * - If applied_rule is set to MESH_PS_NETWORK_DUTY_APPLIED_UPLINK, the nwk_duty will only be used by the up-link path nodes. + * - The root does not accept MESH_PS_NETWORK_DUTY_APPLIED_UPLINK. + * - A nwk_duty with duration_mins(-1) set by the root is the default network duty cycle used by the entire network. + * + * @attention This API can be called at any time after mesh is started. + * - In self-organized network, if this API is called before mesh is started in all devices, (1)nwk_duty shall be set to the + * same value for all devices; (2)duration_mins shall be set to (-1); (3)applied_rule shall be set to + * MESH_PS_NETWORK_DUTY_APPLIED_ENTIRE; after the voted root appears, the root will become the NWK-DUTY-MASTER and broadcast + * the nwk_duty and its identity of NWK-DUTY-MASTER. + * - If the root is specified (FIXED-ROOT), call this API in the root to provide a default nwk_duty for the entire network. + * - After joins the network, any device can call this API to change the nwk_duty, duration_mins or applied_rule. + * + * @param[in] nwk_duty network duty cycle + * @param[in] duration_mins duration (unit: minutes) + * @param[in] applied_rule only support MESH_PS_NETWORK_DUTY_APPLIED_ENTIRE + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t esp_mesh_set_network_duty_cycle(int nwk_duty, int duration_mins, int applied_rule); + +/** + * @brief Get the network duty cycle, duration, type and rule + * + * @param[out] nwk_duty current network duty cycle + * @param[out] duration_mins the duration of current nwk_duty + * @param[out] dev_duty_type if it includes MESH_PS_DEVICE_DUTY_MASTER, this device is the current NWK-DUTY-MASTER. + * @param[out] applied_rule MESH_PS_NETWORK_DUTY_APPLIED_ENTIRE + * + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_get_network_duty_cycle(int* nwk_duty, int* duration_mins, int* dev_duty_type, int* applied_rule); + +/** + * @brief Get the running active duty cycle + * - The running active duty cycle of the root is 100. + * - If duty type is set to MESH_PS_DEVICE_DUTY_REQUEST, the running active duty cycle is nwk_duty provided by the network. + * - If duty type is set to MESH_PS_DEVICE_DUTY_DEMAND, the running active duty cycle is dev_duty specified by the users. + * - In a mesh network, devices are typically working with a certain duty-cycle (transmitting, receiving and sleep) to + * reduce the power consumption. The running active duty cycle decides the amount of awake time within a beacon interval. + * At each start of beacon interval, all devices wake up, broadcast beacons, and transmit packets if they do have pending + * packets for their parents or for their children. Note that Low-duty-cycle means devices may not be active in most of + * the time, the latency of data transmission might be greater. + * + * @return the running active duty cycle + */ +int esp_mesh_get_running_active_duty_cycle(void); + +/** + * @brief Duty signaling + * + * @param[in] fwd_times the times of forwarding duty signaling packets + * + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_ps_duty_signaling(int fwd_times); +#ifdef __cplusplus +} +#endif +#endif /* __ESP_MESH_H__ */ diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_mesh_internal.h b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_mesh_internal.h new file mode 100644 index 0000000..4c6a998 --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_mesh_internal.h @@ -0,0 +1,324 @@ +/* + * SPDX-FileCopyrightText: 2017-2023 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ESP_MESH_INTERNAL_H__ +#define __ESP_MESH_INTERNAL_H__ + +#include "esp_err.h" +#include "esp_mesh.h" +#include "esp_wifi.h" +#include "esp_wifi_types.h" +#include "esp_private/wifi.h" +#include "esp_wifi_crypto_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/******************************************************* + * Constants + *******************************************************/ + +/******************************************************* + * Structures + *******************************************************/ +/** + * @brief Mesh attempts + */ +typedef struct { + int scan; /**< minimum scan times before being a root, default:10 */ + int vote; /**< max vote times in self-healing, default:1000 */ + int fail; /**< parent selection fail times, if the scan times reach this value, + device will disconnect with associated children and join self-healing. default:60 */ + int monitor_ie; /**< acceptable times of parent networking IE change before update its own networking IE. default:3 */ +} mesh_attempts_t; + +/** + * @brief Mesh switch parent + */ +typedef struct { + int duration_ms; /**< parent weak RSSI monitor duration, if the RSSI continues to be weak during this duration_ms, + device will search for a new parent. */ + int cnx_rssi; /**< RSSI threshold for keeping a good connection with parent. + If set a value greater than -120 dBm, a timer will be armed to monitor parent RSSI at a period time of duration_ms. */ + int select_rssi; /**< RSSI threshold for parent selection. It should be a value greater than switch_rssi. */ + int switch_rssi; /**< Disassociate with current parent and switch to a new parent when the RSSI is greater than this set threshold. */ + int backoff_rssi; /**< RSSI threshold for connecting to the root */ +} mesh_switch_parent_t; + +/** + * @brief Mesh RSSI threshold + */ +typedef struct { + int high; /**< high RSSI threshold, used to determine whether the new parent and the current parent are in the same RSSI range */ + int medium; /**< medium RSSI threshold, used to determine whether the new parent and the current parent are in the same RSSI range */ + int low; /**< low RSSI threshold. If the parent's RSSI is lower than low for a period time of duration_ms, + then the mesh node will post MESH_WEAK_RSSI event. + Also used to determine whether the new parent and the current parent are in the same RSSI range */ +} mesh_rssi_threshold_t; + +/** + * @brief Mesh networking IE + */ +typedef struct { + /**< mesh networking IE head */ + uint8_t eid; /**< element ID, vendor specific, 221 */ + uint8_t len; /**< element length, the length after this member */ + uint8_t oui[3]; /**< organization identifier, 0x18fe34 */ + uint8_t type; /**< ESP defined IE type, include Assoc IE, SSID IE, Ext Assoc IE, Roots IE, etc. */ + uint8_t encrypted : 1; /**< whether mesh networking IE is encrypted */ + uint8_t version : 7; /**< mesh networking IE version, equal to 2 if mesh PS is enabled, equal to 1 otherwise */ + /**< content */ + uint8_t mesh_type; /**< mesh device type, include idle, root, node, etc, refer to mesh_type_t */ + uint8_t mesh_id[6]; /**< mesh ID, only the same mesh id can form a unified mesh network */ + uint8_t layer_cap; /**< layer_cap = max_layer - layer, indicates the number of remaining available layers of the mesh network */ + uint8_t layer; /**< the current layer of this node */ + uint8_t assoc_cap; /**< the maximum connections of this mesh AP */ + uint8_t assoc; /**< current connections of this mesh AP */ + uint8_t leaf_cap; /**< the maximum number of leaves in the mesh network */ + uint8_t leaf_assoc; /**< the number of current connected leaves */ + uint16_t root_cap; /**< the capacity of the root, equal to the total child numbers plus 1, root node updates root_cap and self_cap */ + uint16_t self_cap; /**< the capacity of myself, total child numbers plus 1, all nodes update this member */ + uint16_t layer2_cap; /**< the capacity of layer2 node, total child numbers plus 1, layer2 node updates layer2_cap and self_cap, root sets this to 0 */ + uint16_t scan_ap_num; /**< the number of mesh APs around */ + int8_t rssi; /**< RSSI of the connected parent, default value is -120, root node will not update this */ + int8_t router_rssi; /**< RSSI of the router, default value is -120 */ + uint8_t flag; /**< flag of networking, indicates the status of the network, refer to MESH_ASSOC_FLAG_XXX */ + /**< vote related */ + uint8_t rc_addr[6]; /**< the address of the root candidate, i.e. the voted addesss before connection, root node will update this with self address */ + int8_t rc_rssi; /**< the router RSSI of the root candidate */ + uint8_t vote_addr[6]; /**< the voted address after connection */ + int8_t vote_rssi; /**< the router RSSI of the voted address */ + uint8_t vote_ttl; /**< vote ttl, indicate the voting is from myself or from other nodes */ + uint16_t votes; /**< the number of all voting nodes */ + uint16_t my_votes; /**< the number of nodes that voted for me */ + uint8_t reason; /**< the reason why the voting happens, root initiated or child initiated, refer to mesh_vote_reason_t */ + uint8_t child[6]; /**< child address, not used currently */ + uint8_t toDS; /**< state represents whether the root is able to access external IP network */ +} __attribute__((packed)) mesh_assoc_t; + +/** + * @brief Mesh chain layer + */ +typedef struct { + uint16_t layer_cap; /**< max layer of the network */ + uint16_t layer; /**< current layer of this node */ +} mesh_chain_layer_t; + +/** + * @brief Mesh chain assoc + */ +typedef struct { + mesh_assoc_t tree; /**< tree top, mesh_assoc IE */ + mesh_chain_layer_t chain; /**< chain top, mesh_assoc IE */ +} __attribute__((packed)) mesh_chain_assoc_t; + +/* mesh max connections */ +#define MESH_MAX_CONNECTIONS (10) + +/** + * @brief Mesh power save duties + */ +typedef struct { + uint8_t device; /**< device power save duty*/ + uint8_t parent; /**< parent power save duty*/ + struct { + bool used; /**< whether the child is joined */ + uint8_t duty; /**< power save duty of the child */ + uint8_t mac[6]; /**< mac address of the child */ + } child[MESH_MAX_CONNECTIONS]; /**< child */ +} esp_mesh_ps_duties_t; + +/******************************************************* + * Function Definitions + *******************************************************/ +/** + * @brief Set mesh softAP beacon interval + * + * @param[in] interval_ms beacon interval (msecs) (100 msecs ~ 60000 msecs) + * + * @return + * - ESP_OK + * - ESP_FAIL + * - ESP_ERR_INVALID_ARG + */ +esp_err_t esp_mesh_set_beacon_interval(int interval_ms); + +/** + * @brief Get mesh softAP beacon interval + * + * @param[out] interval_ms beacon interval (msecs) + * + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_get_beacon_interval(int *interval_ms); + +/** + * @brief Set attempts for mesh self-organized networking + * + * @param[in] attempts + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t esp_mesh_set_attempts(mesh_attempts_t *attempts); + +/** + * @brief Get attempts for mesh self-organized networking + * + * @param[out] attempts + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_ARGUMENT + */ +esp_err_t esp_mesh_get_attempts(mesh_attempts_t *attempts); + +/** + * @brief Set parameters for parent switch + * + * @param[in] paras parameters for parent switch + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_ARGUMENT + */ +esp_err_t esp_mesh_set_switch_parent_paras(mesh_switch_parent_t *paras); + +/** + * @brief Get parameters for parent switch + * + * @param[out] paras parameters for parent switch + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_ARGUMENT + */ +esp_err_t esp_mesh_get_switch_parent_paras(mesh_switch_parent_t *paras); + +/** + * @brief Set RSSI threshold of current parent + * - The default high RSSI threshold value is -78 dBm. + * - The default medium RSSI threshold value is -82 dBm. + * - The default low RSSI threshold value is -85 dBm. + * + * @param[in] threshold RSSI threshold + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_ARGUMENT + */ +esp_err_t esp_mesh_set_rssi_threshold(const mesh_rssi_threshold_t *threshold); + +/** + * @brief Get RSSI threshold of current parent + * + * @param[out] threshold RSSI threshold + * + * @return + * - ESP_OK + * - ESP_ERR_MESH_ARGUMENT + */ +esp_err_t esp_mesh_get_rssi_threshold(mesh_rssi_threshold_t *threshold); + +/** + * @brief Enable the minimum rate to 6 Mbps + * + * @attention This API shall be called before Wi-Fi is started. + * + * @param[in] is_6m enable or not + * + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_set_6m_rate(bool is_6m); + +/** + * @brief Print the number of txQ waiting + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t esp_mesh_print_txQ_waiting(void); + +/** + * @brief Print the number of rxQ waiting + * + * @return + * - ESP_OK + * - ESP_FAIL + */ +esp_err_t esp_mesh_print_rxQ_waiting(void); + +/** + * @brief Set passive scan time + * + * @param[in] time_ms passive scan time (msecs) + * + * @return + * - ESP_OK + * - ESP_FAIL + * - ESP_ERR_ARGUMENT + */ +esp_err_t esp_mesh_set_passive_scan_time(int time_ms); + +/** + * @brief Get passive scan time + * + * @return interval_ms passive scan time (msecs) + */ +int esp_mesh_get_passive_scan_time(void); + +/** + * @brief Set announce interval + * - The default short interval is 500 milliseconds. + * - The default long interval is 3000 milliseconds. + * + * @param[in] short_ms shall be greater than the default value + * @param[in] long_ms shall be greater than the default value + * + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_set_announce_interval(int short_ms, int long_ms); + +/** + * @brief Get announce interval + * + * @param[out] short_ms short interval + * @param[out] long_ms long interval + * + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_get_announce_interval(int *short_ms, int *long_ms); + +/** + * @brief Get the running duties of device, parent and children + * + * @param[out] ps_duties ps duties + * + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_ps_get_duties(esp_mesh_ps_duties_t* ps_duties); + +/** + * @brief Enable mesh print scan result + * + * @param[in] enable enable or not + * + * @return + * - ESP_OK + */ +esp_err_t esp_mesh_print_scan_result(bool enable); +#ifdef __cplusplus +} +#endif +#endif /* __ESP_MESH_INTERNAL_H__ */ diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_now.h b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_now.h new file mode 100644 index 0000000..ddc1f9e --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_now.h @@ -0,0 +1,383 @@ +/* + * SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ESP_NOW_H__ +#define __ESP_NOW_H__ + +#include +#include "esp_err.h" +#include "esp_wifi_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** \defgroup WiFi_APIs WiFi Related APIs + * @brief WiFi APIs + */ + +/** @addtogroup WiFi_APIs + * @{ + */ + +/** \defgroup ESPNOW_APIs ESPNOW APIs + * @brief ESP32 ESPNOW APIs + * + */ + +/** @addtogroup ESPNOW_APIs + * @{ + */ + +#define ESP_ERR_ESPNOW_BASE (ESP_ERR_WIFI_BASE + 100) /*!< ESPNOW error number base. */ +#define ESP_ERR_ESPNOW_NOT_INIT (ESP_ERR_ESPNOW_BASE + 1) /*!< ESPNOW is not initialized. */ +#define ESP_ERR_ESPNOW_ARG (ESP_ERR_ESPNOW_BASE + 2) /*!< Invalid argument */ +#define ESP_ERR_ESPNOW_NO_MEM (ESP_ERR_ESPNOW_BASE + 3) /*!< Out of memory */ +#define ESP_ERR_ESPNOW_FULL (ESP_ERR_ESPNOW_BASE + 4) /*!< ESPNOW peer list is full */ +#define ESP_ERR_ESPNOW_NOT_FOUND (ESP_ERR_ESPNOW_BASE + 5) /*!< ESPNOW peer is not found */ +#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 */ + +#define ESP_NOW_MAX_TOTAL_PEER_NUM 20 /*!< Maximum number of ESPNOW total peers */ +#define ESP_NOW_MAX_ENCRYPT_PEER_NUM 6 /*!< Maximum number of ESPNOW encrypted peers */ + +#define ESP_NOW_MAX_IE_DATA_LEN 250 /**< Maximum data length in a vendor-specific element */ +#define ESP_NOW_MAX_DATA_LEN ESP_NOW_MAX_IE_DATA_LEN /**< Maximum length of data sent in each ESPNOW transmission for v1.0 */ +#define ESP_NOW_MAX_DATA_LEN_V2 1470 /**< Maximum length of data sent in each ESPNOW transmission for v2.0 */ + +/** + * @brief Status of sending ESPNOW data . + */ +typedef enum { + ESP_NOW_SEND_SUCCESS = 0, /**< Send ESPNOW data successfully */ + ESP_NOW_SEND_FAIL, /**< Send ESPNOW data fail */ +} esp_now_send_status_t; + +/** + * @brief ESPNOW peer information parameters. + */ +typedef struct esp_now_peer_info { + uint8_t peer_addr[ESP_NOW_ETH_ALEN]; /**< ESPNOW peer MAC address that is also the MAC address of station or softap */ + uint8_t lmk[ESP_NOW_KEY_LEN]; /**< ESPNOW peer local master key that is used to encrypt data */ + uint8_t channel; /**< Wi-Fi channel that peer uses to send/receive ESPNOW data. If the value is 0, + use the current channel which station or softap is on. Otherwise, it must be + set as the channel that station or softap is on. */ + wifi_interface_t ifidx; /**< Wi-Fi interface that peer uses to send/receive ESPNOW data */ + bool encrypt; /**< ESPNOW data that this peer sends/receives is encrypted or not */ + void *priv; /**< ESPNOW peer private data */ +} esp_now_peer_info_t; + +/** + * @brief Number of ESPNOW peers which exist currently. + */ +typedef struct esp_now_peer_num { + int total_num; /**< Total number of ESPNOW peers, maximum value is ESP_NOW_MAX_TOTAL_PEER_NUM */ + int encrypt_num; /**< Number of encrypted ESPNOW peers, maximum value is ESP_NOW_MAX_ENCRYPT_PEER_NUM */ +} esp_now_peer_num_t; + +/** + * @brief ESPNOW packet information + */ +typedef struct esp_now_recv_info { + uint8_t * src_addr; /**< Source address of ESPNOW packet */ + uint8_t * des_addr; /**< Destination address of ESPNOW packet */ + wifi_pkt_rx_ctrl_t * rx_ctrl; /**< Rx control info of ESPNOW packet */ +} esp_now_recv_info_t; + +/** + * @brief ESPNOW rate config + */ +typedef wifi_tx_rate_config_t esp_now_rate_config_t; + +/** + * @brief Callback function of receiving ESPNOW data + * @param esp_now_info received ESPNOW packet information + * @param data received data + * @param data_len length of received data + * @attention esp_now_info is a local variable,it can only be used in the callback. + */ +typedef void (*esp_now_recv_cb_t)(const esp_now_recv_info_t * esp_now_info, const uint8_t *data, int data_len); + +/** + * @brief Callback function of sending ESPNOW data + * @param mac_addr peer MAC address + * @param status status of sending ESPNOW data (succeed or fail) + */ +typedef void (*esp_now_send_cb_t)(const uint8_t *mac_addr, esp_now_send_status_t status); + +/** + * @brief Initialize ESPNOW function + * + * @return + * - ESP_OK : succeed + * - ESP_ERR_ESPNOW_INTERNAL : Internal error + */ +esp_err_t esp_now_init(void); + +/** + * @brief De-initialize ESPNOW function + * + * @return + * - ESP_OK : succeed + */ +esp_err_t esp_now_deinit(void); + +/** + * @brief Get the version of ESPNOW. Currently, ESPNOW supports two versions: v1.0 and v2.0. + * + * The v2.0 devices are capable of receiving packets from both v2.0 and v1.0 devices. In contrast, v1.0 devices can only receive packets from other v1.0 devices. + * However, v1.0 devices can receive v2.0 packets if the packet length is less than or equal to ESP_NOW_MAX_IE_DATA_LEN. + * For packets exceeding this length, the v1.0 devices will either truncate the data to the first ESP_NOW_MAX_IE_DATA_LEN bytes or discard the packet entirely. + * For detailed behavior, please refer to the documentation corresponding to the specific IDF version. + * + * @param version ESPNOW version + * + * @return + * - ESP_OK : succeed + * - ESP_ERR_ESPNOW_ARG : invalid argument + */ +esp_err_t esp_now_get_version(uint32_t *version); + +/** + * @brief Register callback function of receiving ESPNOW data + * + * @param cb callback function of receiving ESPNOW data + * + * @return + * - ESP_OK : succeed + * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized + * - ESP_ERR_ESPNOW_INTERNAL : internal error + */ +esp_err_t esp_now_register_recv_cb(esp_now_recv_cb_t cb); + +/** + * @brief Unregister callback function of receiving ESPNOW data + * + * @return + * - ESP_OK : succeed + * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized + */ +esp_err_t esp_now_unregister_recv_cb(void); + +/** + * @brief Register callback function of sending ESPNOW data + * + * @param cb callback function of sending ESPNOW data + * + * @return + * - ESP_OK : succeed + * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized + * - ESP_ERR_ESPNOW_INTERNAL : internal error + */ +esp_err_t esp_now_register_send_cb(esp_now_send_cb_t cb); + +/** + * @brief Unregister callback function of sending ESPNOW data + * + * @return + * - ESP_OK : succeed + * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized + */ +esp_err_t esp_now_unregister_send_cb(void); + +/** + * @brief Send ESPNOW data + * + * @attention 1. If peer_addr is not NULL, send data to the peer whose MAC address matches peer_addr + * @attention 2. If peer_addr is NULL, send data to all of the peers that are added to the peer list + * @attention 3. The maximum length of data must be less than ESP_NOW_MAX_DATA_LEN + * @attention 4. The buffer pointed to by data argument does not need to be valid after esp_now_send returns + * + * @param peer_addr peer MAC address + * @param data data to send + * @param len length of data + * + * @return + * - ESP_OK : succeed + * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized + * - ESP_ERR_ESPNOW_ARG : invalid argument + * - 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 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); + +/** + * @brief Add a peer to peer list + * + * @param peer peer information + * + * @return + * - ESP_OK : succeed + * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized + * - ESP_ERR_ESPNOW_ARG : invalid argument + * - ESP_ERR_ESPNOW_FULL : peer list is full + * - ESP_ERR_ESPNOW_NO_MEM : out of memory + * - ESP_ERR_ESPNOW_EXIST : peer has existed + */ +esp_err_t esp_now_add_peer(const esp_now_peer_info_t *peer); + +/** + * @brief Delete a peer from peer list + * + * @param peer_addr peer MAC address + * + * @return + * - ESP_OK : succeed + * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized + * - ESP_ERR_ESPNOW_ARG : invalid argument + * - ESP_ERR_ESPNOW_NOT_FOUND : peer is not found + */ +esp_err_t esp_now_del_peer(const uint8_t *peer_addr); + +/** + * @brief Modify a peer + * + * @param peer peer information + * + * @return + * - ESP_OK : succeed + * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized + * - ESP_ERR_ESPNOW_ARG : invalid argument + * - ESP_ERR_ESPNOW_FULL : peer list is full + */ +esp_err_t esp_now_mod_peer(const esp_now_peer_info_t *peer); + +/** + * @brief Config ESPNOW rate of specified interface + * + * @deprecated please use esp_now_set_peer_rate_config() instead. + * + * @attention 1. This API should be called after esp_wifi_start(). + * @attention 2. This API only work when not use Wi-Fi 6 and esp_now_set_peer_rate_config() not called. + * + * @param ifx Interface to be configured. + * @param rate Phy rate to be configured. + * + * @return + * - ESP_OK: succeed + * - others: failed + */ +esp_err_t esp_wifi_config_espnow_rate(wifi_interface_t ifx, wifi_phy_rate_t rate) +__attribute__((deprecated("This API can be only used when rate is non-HE rate, \ + please use esp_now_set_peer_rate_config if you want full support of the rate."))); + +/** + * @brief Set ESPNOW rate config for each peer + * + * @attention 1. This API should be called after esp_wifi_start() and esp_now_init(). + * + * @param peer_addr peer MAC address + * @param config rate config to be configured. + * + * @return + * - ESP_OK : succeed + * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized + * - ESP_ERR_ESPNOW_ARG : invalid argument + * - ESP_ERR_ESPNOW_INTERNAL : internal error + */ +esp_err_t esp_now_set_peer_rate_config(const uint8_t *peer_addr, esp_now_rate_config_t *config); + +/** + * @brief Get a peer whose MAC address matches peer_addr from peer list + * + * @param peer_addr peer MAC address + * @param peer peer information + * + * @return + * - ESP_OK : succeed + * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized + * - ESP_ERR_ESPNOW_ARG : invalid argument + * - ESP_ERR_ESPNOW_NOT_FOUND : peer is not found + */ +esp_err_t esp_now_get_peer(const uint8_t *peer_addr, esp_now_peer_info_t *peer); + +/** + * @brief Fetch a peer from peer list. Only return the peer which address is unicast, for the multicast/broadcast address, the function will ignore and try to find the next in the peer list. + * + * @param from_head fetch from head of list or not + * @param peer peer information + * + * @return + * - ESP_OK : succeed + * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized + * - ESP_ERR_ESPNOW_ARG : invalid argument + * - ESP_ERR_ESPNOW_NOT_FOUND : peer is not found + */ +esp_err_t esp_now_fetch_peer(bool from_head, esp_now_peer_info_t *peer); + +/** + * @brief Peer exists or not + * + * @param peer_addr peer MAC address + * + * @return + * - true : peer exists + * - false : peer not exists + */ +bool esp_now_is_peer_exist(const uint8_t *peer_addr); + +/** + * @brief Get the number of peers + * + * @param num number of peers + * + * @return + * - ESP_OK : succeed + * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized + * - ESP_ERR_ESPNOW_ARG : invalid argument + */ +esp_err_t esp_now_get_peer_num(esp_now_peer_num_t *num); + +/** + * @brief Set the primary master key + * + * @param pmk primary master key + * + * @attention 1. primary master key is used to encrypt local master key + * + * @return + * - ESP_OK : succeed + * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized + * - ESP_ERR_ESPNOW_ARG : invalid argument + */ +esp_err_t esp_now_set_pmk(const uint8_t *pmk); + +/** + * @brief Set wake window for esp_now to wake up in interval unit + * + * @param window Milliseconds would the chip keep waked each interval, from 0 to 65535. + * + * @attention 1. This configuration could work at connected status. + * When ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is enabled, this configuration could work at disconnected status. + * @attention 2. Default value is the maximum. + * + * @return + * - ESP_OK : succeed + * - ESP_ERR_ESPNOW_NOT_INIT : ESPNOW is not initialized + */ +esp_err_t esp_now_set_wake_window(uint16_t window); + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ESP_NOW_H__ */ diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi.h b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi.h new file mode 100644 index 0000000..50f21e5 --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi.h @@ -0,0 +1,1796 @@ +/* + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Notes about WiFi Programming + * + * WiFi programming model can be depicted as following picture: + * + * + * default handler user handler + * ------------- --------------- --------------- + * | | event | | callback or | | + * | tcpip | ---------> | event | ----------> | application | + * | stack | | task | event | task | + * |-----------| |-------------| |-------------| + * /|\ | + * | | + * event | | + * | | + * | | + * --------------- | + * | | | + * | WiFi Driver |/__________________| + * | |\ API call + * | | + * |-------------| + * + * The WiFi driver can be consider as black box, it knows nothing about the high layer code, such as + * TCPIP stack, application task, event task etc, all it can do is to receive API call from high layer + * or post event queue to a specified Queue, which is initialized by API esp_wifi_init(). + * + * The event task is a daemon task, which receives events from WiFi driver or from other subsystem, such + * as TCPIP stack, event task will call the default callback function on receiving the event. For example, + * on receiving event WIFI_EVENT_STA_CONNECTED, it will call esp_netif API to start the DHCP + * client in it's default handler. + * + * Application can register it's own event callback function by API esp_event_init, then the application callback + * function will be called after the default callback. Also, if application doesn't want to execute the callback + * in the event task, what it needs to do is to post the related event to application task in the application callback function. + * + * The application task (code) generally mixes all these thing together, it calls APIs to init the system/WiFi and + * handle the events when necessary. + * + */ + +#ifndef __ESP_WIFI_H__ +#define __ESP_WIFI_H__ + +#include +#include +#include "esp_err.h" +#include "esp_wifi_types.h" +#include "esp_event.h" +#include "esp_wifi_crypto_types.h" +#include "esp_wifi_default.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ESP_ERR_WIFI_NOT_INIT (ESP_ERR_WIFI_BASE + 1) /*!< WiFi driver was not installed by esp_wifi_init */ +#define ESP_ERR_WIFI_NOT_STARTED (ESP_ERR_WIFI_BASE + 2) /*!< WiFi driver was not started by esp_wifi_start */ +#define ESP_ERR_WIFI_NOT_STOPPED (ESP_ERR_WIFI_BASE + 3) /*!< WiFi driver was not stopped by esp_wifi_stop */ +#define ESP_ERR_WIFI_IF (ESP_ERR_WIFI_BASE + 4) /*!< WiFi interface error */ +#define ESP_ERR_WIFI_MODE (ESP_ERR_WIFI_BASE + 5) /*!< WiFi mode error */ +#define ESP_ERR_WIFI_STATE (ESP_ERR_WIFI_BASE + 6) /*!< WiFi internal state error */ +#define ESP_ERR_WIFI_CONN (ESP_ERR_WIFI_BASE + 7) /*!< WiFi internal control block of station or soft-AP error */ +#define ESP_ERR_WIFI_NVS (ESP_ERR_WIFI_BASE + 8) /*!< WiFi internal NVS module error */ +#define ESP_ERR_WIFI_MAC (ESP_ERR_WIFI_BASE + 9) /*!< MAC address is invalid */ +#define ESP_ERR_WIFI_SSID (ESP_ERR_WIFI_BASE + 10) /*!< SSID is invalid */ +#define ESP_ERR_WIFI_PASSWORD (ESP_ERR_WIFI_BASE + 11) /*!< Password is invalid */ +#define ESP_ERR_WIFI_TIMEOUT (ESP_ERR_WIFI_BASE + 12) /*!< Timeout error */ +#define ESP_ERR_WIFI_WAKE_FAIL (ESP_ERR_WIFI_BASE + 13) /*!< WiFi is in sleep state(RF closed) and wakeup fail */ +#define ESP_ERR_WIFI_WOULD_BLOCK (ESP_ERR_WIFI_BASE + 14) /*!< The caller would block */ +#define ESP_ERR_WIFI_NOT_CONNECT (ESP_ERR_WIFI_BASE + 15) /*!< Station still in disconnect status */ + +#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) /*!< Invalid 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 */ + +#define ESP_ERR_WIFI_TWT_FULL (ESP_ERR_WIFI_BASE + 23) /*!< no available flow id */ +#define ESP_ERR_WIFI_TWT_SETUP_TIMEOUT (ESP_ERR_WIFI_BASE + 24) /*!< Timeout of receiving twt setup response frame, timeout times can be set during twt setup */ +#define ESP_ERR_WIFI_TWT_SETUP_TXFAIL (ESP_ERR_WIFI_BASE + 25) /*!< TWT setup frame tx failed */ +#define ESP_ERR_WIFI_TWT_SETUP_REJECT (ESP_ERR_WIFI_BASE + 26) /*!< The twt setup request was rejected by the AP */ +#define ESP_ERR_WIFI_DISCARD (ESP_ERR_WIFI_BASE + 27) /*!< Discard frame */ +#define ESP_ERR_WIFI_ROC_IN_PROGRESS (ESP_ERR_WIFI_BASE + 28) /*!< ROC op is in progress */ + +typedef struct wifi_osi_funcs_t wifi_osi_funcs_t; + +/** + * @brief WiFi stack configuration parameters passed to esp_wifi_init call. + */ +typedef struct { + wifi_osi_funcs_t* osi_funcs; /**< WiFi OS functions */ + wpa_crypto_funcs_t wpa_crypto_funcs; /**< WiFi station crypto functions when connect */ + int static_rx_buf_num; /**< WiFi static RX buffer number */ + int dynamic_rx_buf_num; /**< WiFi dynamic RX buffer number */ + 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 rx_mgmt_buf_type; /**< WiFi RX MGMT buffer type */ + int rx_mgmt_buf_num; /**< WiFi RX MGMT 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 amsdu_tx_enable; /**< WiFi AMSDU TX feature enable flag */ + int nvs_enable; /**< WiFi NVS flash enable flag */ + int nano_enable; /**< Nano option for printf/scan family enable flag */ + 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 */ + int mgmt_sbuf_num; /**< WiFi management short buffer number, the minimum value is 6, the maximum value is 32 */ + uint64_t feature_caps; /**< Enables additional WiFi features and capabilities */ + bool sta_disconnected_pm; /**< WiFi Power Management for station at disconnected status */ + int espnow_max_encrypt_num; /**< Maximum encrypt number of peers supported by espnow */ + int tx_hetb_queue_num; /**< WiFi TX HE TB QUEUE number for STA HE TB PPDU transmission */ + bool dump_hesigb_enable; /**< enable dump sigb field */ + int magic; /**< WiFi init magic number, it should be the last field */ +} wifi_init_config_t; + +#ifdef CONFIG_WIFI_RMT_STATIC_TX_BUFFER_NUM +#define WIFI_STATIC_TX_BUFFER_NUM CONFIG_WIFI_RMT_STATIC_TX_BUFFER_NUM +#else +#define WIFI_STATIC_TX_BUFFER_NUM 0 +#endif + +#ifdef CONFIG_WIFI_RMT_CACHE_TX_BUFFER_NUM +#define WIFI_CACHE_TX_BUFFER_NUM CONFIG_WIFI_RMT_CACHE_TX_BUFFER_NUM +#else +#define WIFI_CACHE_TX_BUFFER_NUM 0 +#endif + +#ifdef CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM +#define WIFI_DYNAMIC_TX_BUFFER_NUM CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM +#else +#define WIFI_DYNAMIC_TX_BUFFER_NUM 0 +#endif + +#ifdef CONFIG_WIFI_RMT_RX_MGMT_BUF_NUM_DEF +#define WIFI_RX_MGMT_BUF_NUM_DEF CONFIG_WIFI_RMT_RX_MGMT_BUF_NUM_DEF +#else +#define WIFI_RX_MGMT_BUF_NUM_DEF 0 +#endif + +#if CONFIG_WIFI_RMT_CSI_ENABLED +#define WIFI_CSI_ENABLED 1 +#else +#define WIFI_CSI_ENABLED 0 +#endif + +#if CONFIG_WIFI_RMT_AMPDU_RX_ENABLED +#define WIFI_AMPDU_RX_ENABLED 1 +#else +#define WIFI_AMPDU_RX_ENABLED 0 +#endif + +#if CONFIG_WIFI_RMT_AMPDU_TX_ENABLED +#define WIFI_AMPDU_TX_ENABLED 1 +#else +#define WIFI_AMPDU_TX_ENABLED 0 +#endif + +#if CONFIG_WIFI_RMT_AMSDU_TX_ENABLED +#define WIFI_AMSDU_TX_ENABLED 1 +#else +#define WIFI_AMSDU_TX_ENABLED 0 +#endif + +#if CONFIG_WIFI_RMT_NVS_ENABLED +#define WIFI_NVS_ENABLED 1 +#else +#define WIFI_NVS_ENABLED 0 +#endif + +#if CONFIG_NEWLIB_NANO_FORMAT +#define WIFI_NANO_FORMAT_ENABLED 1 +#else +#define WIFI_NANO_FORMAT_ENABLED 0 +#endif + +extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs; +extern wifi_osi_funcs_t g_wifi_osi_funcs; + +#define WIFI_INIT_CONFIG_MAGIC 0x1F2F3F4F + +#ifdef CONFIG_WIFI_RMT_AMPDU_RX_ENABLED +#define WIFI_DEFAULT_RX_BA_WIN CONFIG_WIFI_RMT_RX_BA_WIN +#else +#define WIFI_DEFAULT_RX_BA_WIN 0 /* unused if ampdu_rx_enable == false */ +#endif + +#if CONFIG_WIFI_RMT_TASK_PINNED_TO_CORE_1 +#define WIFI_TASK_CORE_ID 1 +#else +#define WIFI_TASK_CORE_ID 0 +#endif + +#ifdef CONFIG_WIFI_RMT_SOFTAP_BEACON_MAX_LEN +#define WIFI_SOFTAP_BEACON_MAX_LEN CONFIG_WIFI_RMT_SOFTAP_BEACON_MAX_LEN +#else +#define WIFI_SOFTAP_BEACON_MAX_LEN 752 +#endif + +#ifdef CONFIG_WIFI_RMT_MGMT_SBUF_NUM +#define WIFI_MGMT_SBUF_NUM CONFIG_WIFI_RMT_MGMT_SBUF_NUM +#else +#define WIFI_MGMT_SBUF_NUM 32 +#endif + +#if CONFIG_WIFI_RMT_STA_DISCONNECTED_PM_ENABLE +#define WIFI_STA_DISCONNECTED_PM_ENABLED true +#else +#define WIFI_STA_DISCONNECTED_PM_ENABLED false +#endif + +#if CONFIG_WIFI_RMT_ENABLE_WPA3_SAE +#define WIFI_ENABLE_WPA3_SAE (1<<0) +#else +#define WIFI_ENABLE_WPA3_SAE 0 +#endif + +#if WIFI_CACHE_TX_BUFFER_NUM > 0 +#define WIFI_ENABLE_CACHE_TX_BUFFER (1<<1) +#else +#define WIFI_ENABLE_CACHE_TX_BUFFER 0 +#endif + +#if CONFIG_WIFI_RMT_FTM_INITIATOR_SUPPORT +#define WIFI_FTM_INITIATOR (1<<2) +#else +#define WIFI_FTM_INITIATOR 0 +#endif + +#if CONFIG_WIFI_RMT_FTM_RESPONDER_SUPPORT +#define WIFI_FTM_RESPONDER (1<<3) +#else +#define WIFI_FTM_RESPONDER 0 +#endif + +#if CONFIG_WIFI_RMT_GCMP_SUPPORT +#define WIFI_ENABLE_GCMP (1<<4) +#else +#define WIFI_ENABLE_GCMP 0 +#endif + +#if CONFIG_WIFI_RMT_GMAC_SUPPORT +#define WIFI_ENABLE_GMAC (1<<5) +#else +#define WIFI_ENABLE_GMAC 0 +#endif + +#if CONFIG_WIFI_RMT_11R_SUPPORT +#define WIFI_ENABLE_11R (1<<6) +#else +#define WIFI_ENABLE_11R 0 +#endif + +#if CONFIG_WIFI_RMT_ENTERPRISE_SUPPORT +#define WIFI_ENABLE_ENTERPRISE (1<<7) +#else +#define WIFI_ENABLE_ENTERPRISE 0 +#endif + +#if CONFIG_WIFI_RMT_ENABLE_DUMP_HESIGB && !WIFI_CSI_ENABLED +#define WIFI_DUMP_HESIGB_ENABLED true +#else +#define WIFI_DUMP_HESIGB_ENABLED false +#endif + +#if CONFIG_WIFI_RMT_TX_HETB_QUEUE_NUM +#define WIFI_TX_HETB_QUEUE_NUM CONFIG_WIFI_RMT_TX_HETB_QUEUE_NUM +#else +#define WIFI_TX_HETB_QUEUE_NUM 1 +#endif + +#define CONFIG_FEATURE_WPA3_SAE_BIT (1<<0) +#define CONFIG_FEATURE_CACHE_TX_BUF_BIT (1<<1) +#define CONFIG_FEATURE_FTM_INITIATOR_BIT (1<<2) +#define CONFIG_FEATURE_FTM_RESPONDER_BIT (1<<3) +#define CONFIG_FEATURE_GCMP_BIT (1<<4) +#define CONFIG_FEATURE_GMAC_BIT (1<<5) +#define CONFIG_FEATURE_11R_BIT (1<<6) +#define CONFIG_FEATURE_WIFI_ENT_BIT (1<<7) + +/* Set additional WiFi features and capabilities */ +#define WIFI_FEATURE_CAPS (WIFI_ENABLE_WPA3_SAE | \ + WIFI_ENABLE_CACHE_TX_BUFFER | \ + WIFI_FTM_INITIATOR | \ + WIFI_FTM_RESPONDER | \ + WIFI_ENABLE_GCMP | \ + WIFI_ENABLE_GMAC | \ + WIFI_ENABLE_11R | \ + WIFI_ENABLE_ENTERPRISE) + +#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_WIFI_RMT_STATIC_RX_BUFFER_NUM,\ + .dynamic_rx_buf_num = CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM,\ + .tx_buf_type = CONFIG_WIFI_RMT_TX_BUFFER_TYPE,\ + .static_tx_buf_num = WIFI_STATIC_TX_BUFFER_NUM,\ + .dynamic_tx_buf_num = WIFI_DYNAMIC_TX_BUFFER_NUM,\ + .rx_mgmt_buf_type = CONFIG_WIFI_RMT_DYNAMIC_RX_MGMT_BUF,\ + .rx_mgmt_buf_num = WIFI_RX_MGMT_BUF_NUM_DEF,\ + .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,\ + .amsdu_tx_enable = WIFI_AMSDU_TX_ENABLED,\ + .nvs_enable = WIFI_NVS_ENABLED,\ + .nano_enable = WIFI_NANO_FORMAT_ENABLED,\ + .rx_ba_win = WIFI_DEFAULT_RX_BA_WIN,\ + .wifi_task_core_id = WIFI_TASK_CORE_ID,\ + .beacon_max_len = WIFI_SOFTAP_BEACON_MAX_LEN, \ + .mgmt_sbuf_num = WIFI_MGMT_SBUF_NUM, \ + .feature_caps = WIFI_FEATURE_CAPS, \ + .sta_disconnected_pm = WIFI_STA_DISCONNECTED_PM_ENABLED, \ + .espnow_max_encrypt_num = CONFIG_WIFI_RMT_ESPNOW_MAX_ENCRYPT_NUM, \ + .tx_hetb_queue_num = WIFI_TX_HETB_QUEUE_NUM, \ + .dump_hesigb_enable = WIFI_DUMP_HESIGB_ENABLED, \ + .magic = WIFI_INIT_CONFIG_MAGIC\ +} + +/** + * @brief Initialize WiFi + * Allocate resource for WiFi driver, such as WiFi control structure, RX/TX buffer, + * WiFi NVS structure etc. This WiFi also starts WiFi task + * + * @attention 1. This API must be called before all other WiFi API can be called + * @attention 2. Always use WIFI_INIT_CONFIG_DEFAULT macro to initialize the configuration to default values, this can + * guarantee all the fields get correct value when more fields are added into wifi_init_config_t + * in future release. If you want to set your own initial values, overwrite the default values + * which are set by WIFI_INIT_CONFIG_DEFAULT. Please be notified that the field 'magic' of + * wifi_init_config_t should always be WIFI_INIT_CONFIG_MAGIC! + * + * @param config pointer to WiFi initialized configuration structure; can point to a temporary variable. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_NO_MEM: out of memory + * - others: refer to error code esp_err.h + */ +esp_err_t esp_wifi_init(const wifi_init_config_t *config); + +/** + * @brief Deinit WiFi + * Free all resource allocated in esp_wifi_init and stop WiFi task + * + * @attention 1. This API should be called if you want to remove WiFi driver from the system + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + */ +esp_err_t esp_wifi_deinit(void); + +/** + * @brief Set the WiFi operating mode + * + * Set the WiFi operating mode as station, soft-AP, station+soft-AP or NAN. + * The default mode is station mode. + * + * @param mode WiFi operating mode + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + * - others: refer to error code in esp_err.h + */ +esp_err_t esp_wifi_set_mode(wifi_mode_t mode); + +/** + * @brief Get current operating mode of WiFi + * + * @param[out] mode store current WiFi mode + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_get_mode(wifi_mode_t *mode); + +/** + * @brief Start WiFi according to current configuration + * If mode is WIFI_MODE_STA, it creates station control block and starts station + * If mode is WIFI_MODE_AP, it creates soft-AP control block and starts soft-AP + * If mode is WIFI_MODE_APSTA, it creates soft-AP and station control block and starts soft-AP and station + * If mode is WIFI_MODE_NAN, it creates NAN control block and starts NAN + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: It doesn't normally happen, the function called inside the API was passed invalid argument, user should check if the WiFi related config is correct + * - ESP_ERR_NO_MEM: out of memory + * - ESP_ERR_WIFI_CONN: WiFi internal error, station or soft-AP control block wrong + * - ESP_FAIL: other WiFi internal errors + */ +esp_err_t esp_wifi_start(void); + +/** + * @brief Stop WiFi + * If mode is WIFI_MODE_STA, it stops station and frees station control block + * If mode is WIFI_MODE_AP, it stops soft-AP and frees soft-AP control block + * If mode is WIFI_MODE_APSTA, it stops station/soft-AP and frees station/soft-AP control block + * If mode is WIFI_MODE_NAN, it stops NAN and frees NAN control block + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + */ +esp_err_t esp_wifi_stop(void); + +/** + * @brief Restore WiFi stack persistent settings to default values + * + * This function will reset settings made using the following APIs: + * - esp_wifi_set_bandwidth, + * - esp_wifi_set_protocol, + * - esp_wifi_set_config related + * - esp_wifi_set_mode + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + */ +esp_err_t esp_wifi_restore(void); + +/** + * @brief Connect WiFi station to the AP. + * + * @attention 1. This API only impact WIFI_MODE_STA or WIFI_MODE_APSTA mode + * @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. + * @attention 4. This API attempts to connect to an Access Point (AP) only once. To enable reconnection in case of a connection failure, please use + * the 'failure_retry_cnt' feature in the 'wifi_sta_config_t'. Users are suggested to implement reconnection logic in their application + * for scenarios where the specified AP does not exist, or reconnection is desired after the device has received a disconnect event. + * + * @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_MODE: WiFi mode error + * - ESP_ERR_WIFI_CONN: WiFi internal error, station or soft-AP control block wrong + * - ESP_ERR_WIFI_SSID: SSID of AP which station connects is invalid + */ +esp_err_t esp_wifi_connect(void); + +/** + * @brief Disconnect WiFi station from the AP. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi was not initialized by esp_wifi_init + * - ESP_ERR_WIFI_NOT_STARTED: WiFi was not started by esp_wifi_start + * - ESP_FAIL: other WiFi internal errors + */ +esp_err_t esp_wifi_disconnect(void); + +/** + * @brief Currently this API is just an stub API + * + + * @return + * - ESP_OK: succeed + * - others: fail + */ +esp_err_t esp_wifi_clear_fast_connect(void); + +/** + * @brief deauthenticate all stations or associated id equals to aid + * + * @param aid when aid is 0, deauthenticate all stations, otherwise deauthenticate station whose associated id is aid + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_WIFI_NOT_STARTED: WiFi was not started by esp_wifi_start + * - ESP_ERR_INVALID_ARG: invalid argument + * - ESP_ERR_WIFI_MODE: WiFi mode is wrong + */ +esp_err_t esp_wifi_deauth_sta(uint16_t aid); + +/** + * @brief Scan all available APs. + * + * @attention If this API is called, the found APs are stored in WiFi driver dynamic allocated memory. And then + * can be freed in esp_wifi_scan_get_ap_records(), esp_wifi_scan_get_ap_record() or esp_wifi_clear_ap_list(), + * so call any one to free the memory once the scan is done. + * @attention The values of maximum active scan time and passive scan time per channel are limited to 1500 milliseconds. + * Values above 1500ms may cause station to disconnect from AP and are not recommended. + * + * @param config configuration settings for scanning, if set to NULL default settings will be used + * of which default values are show_hidden:false, scan_type:active, scan_time.active.min:0, + * scan_time.active.max:120 milliseconds, scan_time.passive:360 milliseconds + * home_chan_dwell_time:30ms + * + * @param block if block is true, this API will block the caller until the scan is done, otherwise + * it will return immediately + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_WIFI_NOT_STARTED: WiFi was not started by esp_wifi_start + * - ESP_ERR_WIFI_TIMEOUT: blocking scan is timeout + * - ESP_ERR_WIFI_STATE: WiFi still connecting when invoke esp_wifi_scan_start + * - others: refer to error code in esp_err.h + */ +esp_err_t esp_wifi_scan_start(const wifi_scan_config_t *config, bool block); + +/** + * @brief Set default parameters used for scanning by station. + * + * @attention The values set using this API are also used for scans used while connecting. + * + * @attention The values of maximum active scan time and passive scan time per channel are limited to 1500 milliseconds. + * + * @attention The home_chan_dwell_time needs to be a minimum of 30ms and a maximum of 150ms. + * + * @attention Set any of the parameters to 0 to indicate using the default parameters - + * scan_time.active.min : 0ms, scan_time.active.max : 120ms home_chan_dwell_time : 30ms + * scan_time.passive : 360ms + * + * @attention Default values can be retrieved using the macro WIFI_SCAN_PARAMS_DEFAULT_CONFIG() + * + * @attention Set the config parameter to NULL to reset previously set scan parameters to their default values. + * + * @param config default configuration settings for all scans by stations + * + * @return + * - ESP_OK: succeed + * - ESP_FAIL: failed as station mode has not been started yet + * - ESP_ERR_INVALID_ARG: values provided do not satisfy the requirements + * - ESP_ERR_NOT_SUPPORTED: This API is not supported in AP mode yet + * - ESP_ERR_INVALID_STATE: a scan/connect is in progress right now, cannot change scan parameters + * - others: refer to error code in esp_err.h + */ +esp_err_t esp_wifi_set_scan_parameters(const wifi_scan_default_params_t *config); + +/** + * @brief Get default parameters used for scanning by station. + * + * @param config structure variable within which scan default params will be stored + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_INVALID_ARG: passed parameter does not point to a valid memory + * - others: refer to error code in esp_err.h + */ +esp_err_t esp_wifi_get_scan_parameters(wifi_scan_default_params_t *config); + +/** + * @brief Stop the scan in process + * + * @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_STATE: WiFi is still connecting when esp_wifi_scan_stop() is invoked. + */ +esp_err_t esp_wifi_scan_stop(void); + +/** + * @brief Get number of APs found in last scan + * + * @param[out] number store number of APs found in last scan + * + * @attention This API can only be called when the scan is completed, otherwise it may get wrong value. + * + * @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_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_scan_get_ap_num(uint16_t *number); + +/** + * @brief Retrieve the list of APs found during the last scan. The returned AP list is sorted in descending order based on RSSI. + * + * @attention This API will free all memory occupied by scanned AP list. + * + * @param[inout] number As input param, it stores max AP number ap_records can hold. + * As output param, it receives the actual AP number this API returns. + * @param ap_records wifi_ap_record_t array to hold the found APs + * + * @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_INVALID_ARG: invalid argument + * - ESP_ERR_NO_MEM: out of memory + */ +esp_err_t esp_wifi_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records); + +/** + * @brief Get one AP record from the scanned AP list. + * + * @attention Different from esp_wifi_scan_get_ap_records(), this API only gets one AP record + * from the scanned AP list each time. This API will free the memory of one AP record, + * if the user doesn't get all records in the scannned AP list, then needs to call esp_wifi_clear_ap_list() + * to free the remaining memory. + * + * @param[out] ap_record pointer to one AP record + * + * @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_INVALID_ARG: invalid argument + * - ESP_FAIL: scan APs is NULL, means all AP records fetched or no AP found + */ +esp_err_t esp_wifi_scan_get_ap_record(wifi_ap_record_t *ap_record); + +/** + * @brief Clear AP list found in last scan + * + * @attention This API will free all memory occupied by scanned AP list. + * When the obtained AP list fails, AP records must be cleared,otherwise it may cause memory leakage. + * + * @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_MODE: WiFi mode is wrong + * - ESP_ERR_INVALID_ARG: It doesn't normally happen, the function called inside the API was passed invalid argument, user should check if the WiFi related config is correct + */ +esp_err_t esp_wifi_clear_ap_list(void); + +/** + * @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 + * + * @param ap_info the wifi_ap_record_t to hold AP information + * sta can get the connected ap's phy mode info through the struct member + * phy_11b,phy_11g,phy_11n,phy_lr in the wifi_ap_record_t struct. + * For example, phy_11b = 1 imply that ap support 802.11b mode + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_CONN: The station interface don't initialized + * - ESP_ERR_WIFI_NOT_CONNECT: The station is in disconnect status + */ +esp_err_t esp_wifi_sta_get_ap_info(wifi_ap_record_t *ap_info); + +/** + * @brief Set current WiFi power save type + * + * @attention Default power save type is WIFI_PS_MIN_MODEM. + * + * @param type power save type + * + * @return ESP_OK: succeed + */ +esp_err_t esp_wifi_set_ps(wifi_ps_type_t type); + +/** + * @brief Get current WiFi power save type + * + * @attention Default power save type is WIFI_PS_MIN_MODEM. + * + * @param[out] type: store current power save type + * + * @return ESP_OK: succeed + */ +esp_err_t esp_wifi_get_ps(wifi_ps_type_t *type); + +/** + * @brief Set protocol type of specified interface + * The default protocol is (WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N). + * if CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT and band mode is 2.4G, the default protocol is (WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_11AX). + * if CONFIG_SLAVE_SOC_WIFI_SUPPORT_5G and band mode is 5G, the default protocol is (WIFI_PROTOCOL_11A|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_11AC|WIFI_PROTOCOL_11AX). + * + * @attention 1. When WiFi band mode is 2.4G only, support 802.11b or 802.11bg or 802.11bgn or 802.11bgnax or LR mode + * @attention 2. When WiFi band mode is 5G only, support 802.11a or 802.11an or 802.11anac or 802.11anacax + * @attention 3. Can not set WiFi protocol under band mode 2.4G + 5G (WIFI_BAND_MODE_AUTO), you can use esp_wifi_set_protocols instead + * @attention 4. API return ESP_ERR_NOT_SUPPORTED if the band mode is set to 2.4G + 5G (WIFI_BAND_MODE_AUTO) + * + * @param ifx interface + * @param protocol_bitmap WiFi protocol bitmap + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_WIFI_IF: invalid interface + * - ESP_ERR_INVALID_ARG: invalid argument + * - ESP_ERR_NOT_SUPPORTED: This API is not supported when the band mode is set to 2.4G + 5G (WIFI_BAND_MODE_AUTO) + * - others: refer to error codes in esp_err.h + */ +esp_err_t esp_wifi_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap); + +/** + * @brief Get the current protocol bitmap of the specified interface + * + * @attention 1. When WiFi band mode is 2.4G only, it will return the protocol supported in the 2.4G band + * @attention 2. When WiFi band mode is 5G only, it will return the protocol supported in the 5G band + * @attention 3. Can not get WiFi protocol under band mode 2.4G + 5G (WIFI_BAND_MODE_AUTO), you can use esp_wifi_get_protocols instead + * @attention 4. API return ESP_ERR_NOT_SUPPORTED if the band mode is set to 2.4G + 5G (WIFI_BAND_MODE_AUTO) + * + * @param ifx interface + * @param[out] protocol_bitmap store current WiFi protocol bitmap of interface ifx + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_WIFI_IF: invalid interface + * - ESP_ERR_INVALID_ARG: invalid argument + * - ESP_ERR_NOT_SUPPORTED: This API is not supported when the band mode is set to 2.4G + 5G (WIFI_BAND_MODE_AUTO) + * - others: refer to error codes in esp_err.h + */ +esp_err_t esp_wifi_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap); + +/** + * @brief Set the bandwidth of specified interface + * + * @attention 1. WIFI_BW_HT40 is supported only when the interface support 11N + * @attention 2. When the interface supports 11AX/11AC, it only supports setting WIFI_BW_HT20. + * @attention 3. Can not set WiFi bandwidth under band mode 2.4G + 5G (WIFI_BAND_MODE_AUTO), you can use esp_wifi_set_bandwidths instead + * @attention 4. API return ESP_ERR_NOT_SUPPORTED if the band mode is set to 2.4G + 5G (WIFI_BAND_MODE_AUTO) + * + * @param ifx interface to be configured + * @param bw bandwidth + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_WIFI_IF: invalid interface + * - ESP_ERR_INVALID_ARG: invalid argument + * - ESP_ERR_NOT_SUPPORTED: This API is not supported when the band mode is set to 2.4G + 5G (WIFI_BAND_MODE_AUTO) + * - others: refer to error codes in esp_err.h + */ +esp_err_t esp_wifi_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw); + +/** + * @brief Get the bandwidth of specified interface + * + * @attention 1. Can not get WiFi bandwidth under band mode 2.4G + 5G (WIFI_BAND_MODE_AUTO), you can use esp_wifi_get_bandwidths instead + * @attention 2. API return ESP_ERR_NOT_SUPPORTED if the band mode is set to 2.4G + 5G (WIFI_BAND_MODE_AUTO) + * + * @param ifx interface to be configured + * @param[out] bw store bandwidth of interface ifx + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_WIFI_IF: invalid interface + * - ESP_ERR_INVALID_ARG: invalid argument + * - ESP_ERR_NOT_SUPPORTED: This API is not supported when the band mode is set to 2.4G + 5G (WIFI_BAND_MODE_AUTO) + */ +esp_err_t esp_wifi_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw); + +/** + * @brief Set primary/secondary channel of device + * + * @attention 1. This API should be called after esp_wifi_start() and before esp_wifi_stop() + * @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 remember 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. + * + * @param primary for HT20, primary is the channel number, for HT40, primary is the primary channel + * @param second for HT20, second is ignored, for HT40, second is the second channel + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_WIFI_IF: invalid interface + * - ESP_ERR_INVALID_ARG: invalid argument + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start + */ +esp_err_t esp_wifi_set_channel(uint8_t primary, wifi_second_chan_t second); + +/** + * @brief Get the primary/secondary channel of device + * + * @attention 1. API return false if try to get a interface that is not enable + * + * @param primary store current primary channel + * @param[out] second store current second channel + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_get_channel(uint8_t *primary, wifi_second_chan_t *second); + +/** + * @brief configure country info + * + * @attention 1. It is discouraged to call this API since this doesn't validate the per-country rules, + * it's up to the user to fill in all fields according to local regulations. + * Please use esp_wifi_set_country_code instead. + * @attention 2. The default country is "01" (world safe mode) {.cc="01", .schan=1, .nchan=11, .policy=WIFI_COUNTRY_POLICY_AUTO}. + * @attention 3. The third octet of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '. + * @attention 4. When the country policy is WIFI_COUNTRY_POLICY_AUTO, the country info of the AP to which + * the station is connected is used. E.g. if the configured country info is {.cc="US", .schan=1, .nchan=11} + * and the country info of the AP to which the station is connected is {.cc="JP", .schan=1, .nchan=14} + * then the country info that will be used is {.cc="JP", .schan=1, .nchan=14}. If the station disconnected + * from the AP the country info is set back to the country info of the station automatically, + * {.cc="US", .schan=1, .nchan=11} in the example. + * @attention 5. When the country policy is WIFI_COUNTRY_POLICY_MANUAL, then the configured country info is used always. + * @attention 6. When the country info is changed because of configuration or because the station connects to a different + * external AP, the country IE in probe response/beacon of the soft-AP is also changed. + * @attention 7. The country configuration is stored into flash. + * @attention 8. When this API is called, the PHY init data will switch to the PHY init data type corresponding to the + * country info. + * + * @param country the configured country info + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_set_country(const wifi_country_t *country); + +/** + * @brief get the current country info + * + * @param country country info + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_get_country(wifi_country_t *country); + +/** + * @brief Set MAC address of WiFi station, soft-AP or NAN interface. + * + * @attention 1. This API can only be called when the interface is disabled + * @attention 2. Above mentioned interfaces 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 + * @param mac the MAC address + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + * - ESP_ERR_WIFI_IF: invalid interface + * - ESP_ERR_WIFI_MAC: invalid mac address + * - ESP_ERR_WIFI_MODE: WiFi mode is wrong + * - others: refer to error codes in esp_err.h + */ +esp_err_t esp_wifi_set_mac(wifi_interface_t ifx, const uint8_t mac[6]); + +/** + * @brief Get mac of specified interface + * + * @param ifx interface + * @param[out] mac store mac of the interface ifx + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + * - ESP_ERR_WIFI_IF: invalid interface + */ +esp_err_t esp_wifi_get_mac(wifi_interface_t ifx, uint8_t mac[6]); + +/** + * @brief The RX callback function in the promiscuous mode. + * Each time a packet is received, the callback function will be called. + * + * @param buf Data received. Type of data in buffer (wifi_promiscuous_pkt_t or wifi_pkt_rx_ctrl_t) indicated by 'type' parameter. + * @param type promiscuous packet type. + * + */ +typedef void (* wifi_promiscuous_cb_t)(void *buf, wifi_promiscuous_pkt_type_t type); + +/** + * @brief Register the RX callback function in the promiscuous mode. + * + * Each time a packet is received, the registered callback function will be called. + * + * @param cb callback + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + */ +esp_err_t esp_wifi_set_promiscuous_rx_cb(wifi_promiscuous_cb_t cb); + +/** + * @brief Enable the promiscuous mode. + * + * @param en false - disable, true - enable + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + */ +esp_err_t esp_wifi_set_promiscuous(bool en); + +/** + * @brief Get the promiscuous mode. + * + * @param[out] en store the current status of promiscuous mode + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_get_promiscuous(bool *en); + +/** + * @brief Enable the promiscuous mode packet type filter. + * + * @note The default filter is to filter all packets except WIFI_PKT_MISC + * + * @param filter the packet type filtered in promiscuous mode. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + */ +esp_err_t esp_wifi_set_promiscuous_filter(const wifi_promiscuous_filter_t *filter); + +/** + * @brief Get the promiscuous filter. + * + * @param[out] filter store the current status of promiscuous filter + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_get_promiscuous_filter(wifi_promiscuous_filter_t *filter); + +/** + * @brief Enable subtype filter of the control packet in promiscuous mode. + * + * @note The default filter is to filter none control packet. + * + * @param filter the subtype of the control packet filtered in promiscuous mode. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + */ +esp_err_t esp_wifi_set_promiscuous_ctrl_filter(const wifi_promiscuous_filter_t *filter); + +/** + * @brief Get the subtype filter of the control packet in promiscuous mode. + * + * @param[out] filter store the current status of subtype filter of the control packet in promiscuous mode + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_get_promiscuous_ctrl_filter(wifi_promiscuous_filter_t *filter); + +/** + * @brief Set the configuration of the STA, AP or NAN + * + * @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. 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 for station and soft-AP + * + * @param interface interface + * @param conf station, soft-AP or NAN configuration + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + * - ESP_ERR_WIFI_IF: invalid interface + * - ESP_ERR_WIFI_MODE: invalid mode + * - ESP_ERR_WIFI_PASSWORD: invalid password + * - ESP_ERR_WIFI_NVS: WiFi internal NVS error + * - others: refer to the error code in esp_err.h + */ +esp_err_t esp_wifi_set_config(wifi_interface_t interface, wifi_config_t *conf); + +/** + * @brief Get configuration of specified interface + * + * @param interface interface + * @param[out] conf station or soft-AP configuration + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + * - ESP_ERR_WIFI_IF: invalid interface + */ +esp_err_t esp_wifi_get_config(wifi_interface_t interface, wifi_config_t *conf); + +/** + * @brief Forward declare wifi_sta_list_t. The definition depends on the target device + * that implements esp_wifi + */ +typedef struct wifi_sta_list_t wifi_sta_list_t; + +/** + * @brief Get STAs associated with soft-AP + * + * @attention SSC only API + * + * @param[out] sta station list + * ap can get the connected sta's phy mode info through the struct member + * phy_11b,phy_11g,phy_11n,phy_lr in the wifi_sta_info_t struct. + * For example, phy_11b = 1 imply that sta support 802.11b mode + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + * - ESP_ERR_WIFI_MODE: WiFi mode is wrong + * - ESP_ERR_WIFI_CONN: WiFi internal error, the station/soft-AP control block is invalid + */ +esp_err_t esp_wifi_ap_get_sta_list(wifi_sta_list_t *sta); + +/** + * @brief Get AID of STA connected with soft-AP + * + * @param mac STA's mac address + * @param[out] aid Store the AID corresponding to STA mac + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + * - ESP_ERR_NOT_FOUND: Requested resource not found + * - ESP_ERR_WIFI_MODE: WiFi mode is wrong + * - ESP_ERR_WIFI_CONN: WiFi internal error, the station/soft-AP control block is invalid + */ +esp_err_t esp_wifi_ap_get_sta_aid(const uint8_t mac[6], uint16_t *aid); + +/** + * @brief Set the WiFi API configuration storage type + * + * @attention 1. The default value is WIFI_STORAGE_FLASH + * + * @param storage : storage type + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_set_storage(wifi_storage_t storage); + +/** + * @brief Function signature for received Vendor-Specific Information Element callback. + * @param ctx Context argument, as passed to esp_wifi_set_vendor_ie_cb() when registering callback. + * @param type Information element type, based on frame type received. + * @param sa Source 802.11 address. + * @param vnd_ie Pointer to the vendor specific element data received. + * @param rssi Received signal strength indication. + */ +typedef void (*esp_vendor_ie_cb_t)(void *ctx, wifi_vendor_ie_type_t type, const uint8_t sa[6], const vendor_ie_data_t *vnd_ie, int rssi); + +/** + * @brief Set 802.11 Vendor-Specific Information Element + * + * @param enable If true, specified IE is enabled. If false, specified IE is removed. + * @param type Information Element type. Determines the frame type to associate with the IE. + * @param idx Index to set or clear. Each IE type can be associated with up to two elements (indices 0 & 1). + * @param vnd_ie Pointer to vendor specific element data. First 6 bytes should be a header with fields matching vendor_ie_data_t. + * If enable is false, this argument is ignored and can be NULL. Data does not need to remain valid after the function returns. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init() + * - ESP_ERR_INVALID_ARG: Invalid argument, including if first byte of vnd_ie is not WIFI_VENDOR_IE_ELEMENT_ID (0xDD) + * or second byte is an invalid length. + * - ESP_ERR_NO_MEM: Out of memory + */ +esp_err_t esp_wifi_set_vendor_ie(bool enable, wifi_vendor_ie_type_t type, wifi_vendor_ie_id_t idx, const void *vnd_ie); + +/** + * @brief Register Vendor-Specific Information Element monitoring callback. + * + * @param cb Callback function + * @param ctx Context argument, passed to callback function. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + */ +esp_err_t esp_wifi_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx); + +/** + * @brief Set maximum transmitting power after WiFi start. + * + * @attention 1. Maximum power before WiFi startup is limited by PHY init data bin. + * @attention 2. The value set by this API will be mapped to the max_tx_power of the structure wifi_country_t variable. + * @attention 3. Mapping Table {Power, max_tx_power} = {{8, 2}, {20, 5}, {28, 7}, {34, 8}, {44, 11}, + * {52, 13}, {56, 14}, {60, 15}, {66, 16}, {72, 18}, {80, 20}}. + * @attention 4. Param power unit is 0.25dBm, range is [8, 84] corresponding to 2dBm - 20dBm. + * @attention 5. Relationship between set value and actual value. As follows: {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}. + * + * @param power Maximum WiFi transmitting power. + * + * @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_INVALID_ARG: invalid argument, e.g. parameter is out of range + */ +esp_err_t esp_wifi_set_max_tx_power(int8_t power); + +/** + * @brief Get maximum transmitting power after WiFi start + * + * @param power Maximum WiFi transmitting power, unit is 0.25dBm. + * + * @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_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_get_max_tx_power(int8_t *power); + +/** + * @brief Set mask to enable or disable some WiFi events + * + * @attention 1. Mask can be created by logical OR of various WIFI_EVENT_MASK_ constants. + * Events which have corresponding bit set in the mask will not be delivered to the system event handler. + * @attention 2. Default WiFi event mask is WIFI_EVENT_MASK_AP_PROBEREQRECVED. + * @attention 3. There may be lots of stations sending probe request data around. + * Don't unmask this event unless you need to receive probe request data. + * + * @param mask WiFi event mask. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + */ +esp_err_t esp_wifi_set_event_mask(uint32_t mask); + +/** + * @brief Get mask of WiFi events + * + * @param mask WiFi event mask. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_get_event_mask(uint32_t *mask); + +/** + * @brief Send raw ieee80211 data + * + * @attention Currently only support for sending beacon/probe request/probe response/action and non-QoS + * data frame + * + * @param ifx interface if the Wi-Fi mode is Station, the ifx should be WIFI_IF_STA. If the Wi-Fi + * mode is SoftAP, the ifx should be WIFI_IF_AP. If the Wi-Fi mode is Station+SoftAP, the + * ifx should be WIFI_IF_STA or WIFI_IF_AP. If the ifx is wrong, the API returns ESP_ERR_WIFI_IF. + * @param buffer raw ieee80211 buffer + * @param len the length of raw buffer, the len must be <= 1500 Bytes and >= 24 Bytes + * @param en_sys_seq indicate whether use the internal sequence number. If en_sys_seq is false, the + * sequence in raw buffer is unchanged, otherwise it will be overwritten by WiFi driver with + * the system sequence number. + * Generally, if esp_wifi_80211_tx is called before the Wi-Fi connection has been set up, both + * en_sys_seq==true and en_sys_seq==false are fine. However, if the API is called after the Wi-Fi + * connection has been set up, en_sys_seq must be true, otherwise ESP_ERR_INVALID_ARG is returned. + * + * @return + * - ESP_OK: success + * - ESP_ERR_WIFI_IF: Invalid interface + * - ESP_ERR_INVALID_ARG: Invalid parameter + * - ESP_ERR_WIFI_NO_MEM: out of memory + */ + +esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, bool en_sys_seq); + +/** + * @brief The RX callback function of Channel State Information(CSI) data. + * + * Each time a CSI data is received, the callback function will be called. + * + * @param ctx context argument, passed to esp_wifi_set_csi_rx_cb() when registering callback function. + * @param data CSI data received. The memory that it points to will be deallocated after callback function returns. + * + */ +typedef void (* wifi_csi_cb_t)(void *ctx, wifi_csi_info_t *data); + +/** + * @brief Register the RX callback function of CSI data. + * + * Each time a CSI data is received, the callback function will be called. + * + * @param cb callback + * @param ctx context argument, passed to callback function + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + */ + +esp_err_t esp_wifi_set_csi_rx_cb(wifi_csi_cb_t cb, void *ctx); + +/** + * @brief Set CSI data configuration + * + * @param config configuration + * + * 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 or promiscuous mode is not enabled + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_set_csi_config(const wifi_csi_config_t *config); + +/** + * @brief Get CSI data configuration + * + * @param config configuration + * + * 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 or promiscuous mode is not enabled + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_get_csi_config(wifi_csi_config_t *config); + +/** + * @brief Enable or disable CSI + * + * @param en true - enable, false - disable + * + * 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 or promiscuous mode is not enabled + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_set_csi(bool en); + +/** + * @brief Set antenna GPIO configuration + * + * @param config Antenna GPIO configuration. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: Invalid argument, e.g. parameter is NULL, invalid GPIO number etc + */ +esp_err_t esp_wifi_set_ant_gpio(const wifi_ant_gpio_config_t *config) __attribute__((deprecated("Please use esp_phy_set_ant_gpio instead"))); + +/** + * @brief Get current antenna GPIO configuration + * + * @param config Antenna GPIO configuration. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument, e.g. parameter is NULL + */ +esp_err_t esp_wifi_get_ant_gpio(wifi_ant_gpio_config_t *config) __attribute__((deprecated("Please use esp_phy_get_ant_gpio instead"))); + +/** + * @brief Set antenna configuration + * + * @param config Antenna configuration. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: Invalid argument, e.g. parameter is NULL, invalid antenna mode or invalid GPIO number + */ +esp_err_t esp_wifi_set_ant(const wifi_ant_config_t *config) __attribute__((deprecated("Please use esp_phy_set_ant instead"))); + +/** + * @brief Get current antenna configuration + * + * @param config Antenna configuration. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument, e.g. parameter is NULL + */ +esp_err_t esp_wifi_get_ant(wifi_ant_config_t *config) __attribute__((deprecated("Please use esp_phy_get_ant instead"))); + +/** + * @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 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_INVALID_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_NOT_STARTED: WiFi is not started by esp_wifi_start + * - ESP_ERR_INVALID_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); + +/** + * @brief Set RSSI threshold, if average rssi gets lower than threshold, WiFi task will post event WIFI_EVENT_STA_BSS_RSSI_LOW. + * + * @attention If the user wants to receive another WIFI_EVENT_STA_BSS_RSSI_LOW event after receiving one, this API needs to be + * called again with an updated/same RSSI threshold. + * + * @param rssi threshold value in dbm between -100 to 10 + * Note that in some rare cases where signal strength is very strong, rssi values can be slightly positive. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_set_rssi_threshold(int32_t rssi); + +/** + * @brief Start an FTM Initiator session by sending FTM request + * If successful, event WIFI_EVENT_FTM_REPORT is generated with the result of the FTM procedure + * + * @attention 1. Use this API only in Station mode. + * @attention 2. If FTM is initiated on a different channel than Station is connected in or internal SoftAP is started in, + * FTM defaults to a single burst in ASAP mode. + * + * @param cfg FTM Initiator session configuration + * + * @return + * - ESP_OK: succeed + * - others: failed + */ +esp_err_t esp_wifi_ftm_initiate_session(wifi_ftm_initiator_cfg_t *cfg); + +/** + * @brief End the ongoing FTM Initiator session + * + * @attention This API works only on FTM Initiator + * + * @return + * - ESP_OK: succeed + * - others: failed + */ +esp_err_t esp_wifi_ftm_end_session(void); + +/** + * @brief Set offset in cm for FTM Responder. An equivalent offset is calculated in picoseconds + * and added in TOD of FTM Measurement frame (T1). + * + * @attention Use this API only in AP mode before performing FTM as responder + * + * @param offset_cm T1 Offset to be added in centimeters + * + * @return + * - ESP_OK: succeed + * - others: failed + */ +esp_err_t esp_wifi_ftm_resp_set_offset(int16_t offset_cm); + +/** + * @brief Get FTM measurements report copied into a user provided buffer. + * + * @attention 1. To get the FTM report, user first needs to allocate a buffer of size + * (sizeof(wifi_ftm_report_entry_t) * num_entries) where the API will fill up to num_entries + * valid FTM measurements in the buffer. Total number of entries can be found in the event + * WIFI_EVENT_FTM_REPORT as ftm_report_num_entries + * @attention 2. The internal FTM report is freed upon use of this API which means the API can only be used + * once after every FTM session initiated + * @attention 3. Passing the buffer as NULL merely frees the FTM report + * + * @param report Pointer to the buffer for receiving the FTM report + * @param num_entries Number of FTM report entries to be filled in the report + * + * @return + * - ESP_OK: succeed + * - others: failed + */ +esp_err_t esp_wifi_ftm_get_report(wifi_ftm_report_entry_t *report, uint8_t num_entries); + +/** + * @brief Enable or disable 11b rate of specified interface + * + * @attention 1. This API should be called after esp_wifi_init() and before esp_wifi_start(). + * @attention 2. Only when really need to disable 11b rate call this API otherwise don't call this. + * + * @param ifx Interface to be configured. + * @param disable true means disable 11b rate while false means enable 11b rate. + * + * @return + * - ESP_OK: succeed + * - others: failed + */ +esp_err_t esp_wifi_config_11b_rate(wifi_interface_t ifx, bool disable); + +#define ESP_WIFI_CONNECTIONLESS_INTERVAL_DEFAULT_MODE 0 +/** + * @brief Set wake interval for connectionless modules to wake up periodically. + * + * @attention 1. Only one wake interval for all connectionless modules. + * @attention 2. This configuration could work at connected status. + * When ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is enabled, this configuration could work at disconnected status. + * @attention 3. Event WIFI_EVENT_CONNECTIONLESS_MODULE_WAKE_INTERVAL_START would be posted each time wake interval starts. + * @attention 4. Recommend to configure interval in multiples of hundred. (e.g. 100ms) + * @attention 5. Recommend to configure interval to ESP_WIFI_CONNECTIONLESS_INTERVAL_DEFAULT_MODE to get stable performance at coexistence mode. + * + * @param wake_interval Milliseconds after would the chip wake up, from 1 to 65535. + */ +esp_err_t esp_wifi_connectionless_module_set_wake_interval(uint16_t wake_interval); + +/** + * @brief Request extra reference of Wi-Fi radio. + * Wi-Fi keep active state(RF opened) to be able to receive packets. + * + * @attention Please pair the use of `esp_wifi_force_wakeup_acquire` with `esp_wifi_force_wakeup_release`. + * + * @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_t esp_wifi_force_wakeup_acquire(void); + +/** + * @brief Release extra reference of Wi-Fi radio. + * Wi-Fi go to sleep state(RF closed) if no more use of radio. + * + * @attention Please pair the use of `esp_wifi_force_wakeup_acquire` with `esp_wifi_force_wakeup_release`. + * + * @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_t esp_wifi_force_wakeup_release(void); + +/** + * @brief configure country + * + * @attention 1. When ieee80211d_enabled, the country info of the AP to which + * the station is connected is used. E.g. if the configured country is US + * and the country info of the AP to which the station is connected is JP + * then the country info that will be used is JP. If the station disconnected + * from the AP the country info is set back to the country info of the station automatically, + * US in the example. + * @attention 2. When ieee80211d_enabled is disabled, then the configured country info is used always. + * @attention 3. When the country info is changed because of configuration or because the station connects to a different + * external AP, the country IE in probe response/beacon of the soft-AP is also changed. + * @attention 4. The country configuration is stored into flash. + * @attention 5. When this API is called, the PHY init data will switch to the PHY init data type corresponding to the + * country info. + * @attention 6. Supported country codes are "01"(world safe mode) "AT","AU","BE","BG","BR", + * "CA","CH","CN","CY","CZ","DE","DK","EE","ES","FI","FR","GB","GR","HK","HR","HU", + * "IE","IN","IS","IT","JP","KR","LI","LT","LU","LV","MT","MX","NL","NO","NZ","PL","PT", + * "RO","SE","SI","SK","TW","US" + * + * @attention 7. When country code "01" (world safe mode) is set, SoftAP mode won't contain country IE. + * @attention 8. The default country is "01" (world safe mode) and ieee80211d_enabled is TRUE. + * @attention 9. The third octet of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '. + * + * @param country the configured country ISO code + * @param ieee80211d_enabled 802.11d is enabled or not + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_set_country_code(const char *country, bool ieee80211d_enabled); + +/** + * @brief get the current country code + * + * @param country country code + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_get_country_code(char *country); + +/** + * @brief Config 80211 tx rate of specified interface + * + * @attention 1. This API should be called after esp_wifi_init() and before esp_wifi_start(). + * @attention 2. Can not set 80211 tx rate under 11A/11AC/11AX protocol, you can use esp_wifi_config_80211_tx instead. + * + * @param ifx Interface to be configured. + * @param rate Phy rate to be configured. + * + * @return + * - ESP_OK: succeed + * - others: failed + */ +esp_err_t esp_wifi_config_80211_tx_rate(wifi_interface_t ifx, wifi_phy_rate_t rate); + +/** + * @brief Config 80211 tx rate and phymode of specified interface + * + * @attention 1. This API should be called after esp_wifi_init() and before esp_wifi_start(). + + * + * @param ifx Interface to be configured. + * @param config rate_config to be configured. + * + * @return + * - ESP_OK: succeed + * - others: failed + */ +esp_err_t esp_wifi_config_80211_tx(wifi_interface_t ifx, wifi_tx_rate_config_t *config); + +/** + * @brief Disable PMF configuration for specified interface + * + * @attention This API should be called after esp_wifi_set_config() and before esp_wifi_start(). + * + * @param ifx Interface to be configured. + * + * @return + * - ESP_OK: succeed + * - others: failed + */ +esp_err_t esp_wifi_disable_pmf_config(wifi_interface_t ifx); + +/** + * @brief Get the Association id assigned to STA by AP + * + * @param[out] aid store the aid + * + * @attention aid = 0 if station is not connected to AP. + * + * @return + * - ESP_OK: succeed + */ +esp_err_t esp_wifi_sta_get_aid(uint16_t *aid); + +/** + * @brief Get the negotiated phymode after connection. + * + * @param[out] phymode store the negotiated phymode. + * + * @return + * - ESP_OK: succeed + */ +esp_err_t esp_wifi_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode); + +/** + * @brief Config dynamic carrier sense + * + * @attention This API should be called after esp_wifi_start(). + * + * @param enabled Dynamic carrier sense is enabled or not. + * + * @return + * - ESP_OK: succeed + * - others: failed + */ +esp_err_t esp_wifi_set_dynamic_cs(bool enabled); + +/** + * @brief Get the rssi information of AP to which the device is associated with + * + * @attention 1. This API should be called after station connected to AP. + * @attention 2. Use this API only in WIFI_MODE_STA or WIFI_MODE_APSTA mode. + * + * @param rssi store the rssi info received from last beacon. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_INVALID_ARG: invalid argument + * - ESP_FAIL: failed + */ +esp_err_t esp_wifi_sta_get_rssi(int *rssi); + +/** + * @brief Set WiFi current band. + * + * @attention 1. This API is only operational when the WiFi band mode is configured to 2.4G + 5G (WIFI_BAND_MODE_AUTO) + * @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. It is recommended not to use this API. If you want to change the current band, you can use esp_wifi_set_channel instead. + * + * @param[in] band WiFi band 2.4G / 5G + * + * @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_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_set_band(wifi_band_t band); + +/** + * @brief Get WiFi current band. + * + * @param[in] band store current band of WiFi + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_get_band(wifi_band_t* band); + +/** + * @brief Set WiFi band mode. + * + * @attention 1. When the WiFi band mode is set to 2.4G only, it operates exclusively on the 2.4GHz channels. + * @attention 2. When the WiFi band mode is set to 5G only, it operates exclusively on the 5GHz channels. + * @attention 3. When the WiFi band mode is set to 2.4G + 5G (WIFI_BAND_MODE_AUTO), it can operate on both the 2.4GHz and 5GHz channels. + * @attention 4. WiFi band mode can be set to 5G only or 2.4G + 5G (WIFI_BAND_MODE_AUTO) if CONFIG_SLAVE_SOC_WIFI_SUPPORT_5G is supported. + * @attention 5. If CONFIG_SLAVE_SOC_WIFI_SUPPORT_5G is not supported, the API will return ESP_ERR_INVALID_ARG when the band mode is set to either 5G only or 2.4G + 5G (WIFI_BAND_MODE_AUTO). + * @attention 6. When a WiFi band mode change triggers a band change, if no channel is set for the current band, a default channel will be assigned: channel 1 for 2.4G band and channel 36 for 5G band. + * + * @param[in] band_mode store the band mode of WiFi + * + * @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_INVALID_ARG: invalid argument + * + */ +esp_err_t esp_wifi_set_band_mode(wifi_band_mode_t band_mode); + +/** + * @brief get WiFi band mode. + * + * @param[in] band_mode store the band mode of WiFi + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_INVALID_ARG: invalid argument + */ + +esp_err_t esp_wifi_get_band_mode(wifi_band_mode_t* band_mode); + +#if CONFIG_ESP_COEX_POWER_MANAGEMENT +/** + * @brief Enable Wi-Fi coexistence power management + * + * @attention This API should be called after esp_wifi_init(). + * + * @param enabled Wi-Fi coexistence power management is enabled or not. + * + * @return + * - ESP_OK: succeed + * - others: failed + */ +esp_err_t esp_wifi_coex_pwr_configure(bool enabled); +#endif + +/** + * @brief Set the supported WiFi protocols for the specified interface. + * + * @attention 1. When the WiFi band mode is set to 2.4G only, it will not set 5G protocol + * @attention 2. When the WiFi band mode is set to 5G only, it will not set 2.4G protocol + * @attention 3. This API supports setting the maximum protocol. For example, if the 2.4G protocol is set to 802.11n, it will automatically configure to 802.11b/g/n. + * + * @param ifx interface + * @param protocols WiFi protocols include 2.4G protocol and 5G protocol + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_WIFI_IF: invalid interface + * - others: refer to error codes in esp_err.h + */ +esp_err_t esp_wifi_set_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols); + +/** + * @brief Get the current protocol of the specified interface and specified band + * + * @attention 1. The 5G protocol can only be read when CONFIG_SLAVE_SOC_WIFI_SUPPORT_5G is enabled. + * @attention 2. When the WiFi band mode is set to 2.4G only, it will not get 5G protocol + * @attention 3. When the WiFi band mode is set to 5G only, it will not get 2.4G protocol + * + * @param ifx interface + * @param[out] protocols store current WiFi protocols of interface ifx + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_WIFI_IF: invalid interface + * - ESP_ERR_INVALID_ARG: invalid argument + * - others: refer to error codes in esp_err.h + */ +esp_err_t esp_wifi_get_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols); + +/** + * @brief Set the bandwidth of specified interface and specified band + * + * @attention 1. WIFI_BW_HT40 is supported only when the interface support 11N + * @attention 2. When the interface supports 11AX/11AC, it only supports setting WIFI_BW_HT20. + * @attention 3. When the WiFi band mode is set to 2.4G only, it will not set 5G bandwidth + * @attention 4. When the WiFi band mode is set to 5G only, it will not set 2.4G bandwidth + * + * @param ifx interface to be configured + * @param bw WiFi bandwidths include 2.4G bandwidth and 5G bandwidth + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_WIFI_IF: invalid interface + * - ESP_ERR_INVALID_ARG: invalid argument + * - others: refer to error codes in esp_err.h + */ +esp_err_t esp_wifi_set_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t* bw); + +/** + * @brief Get the bandwidth of specified interface and specified band + * + * @attention 1. The 5G bandwidth can only be read when CONFIG_SLAVE_SOC_WIFI_SUPPORT_5G is enabled. + * @attention 2. When the WiFi band mode is set to 2.4G only, it will not get 5G bandwidth + * @attention 3. When the WiFi band mode is set to 5G only, it will not get 2.4G bandwidth + * + * @param ifx interface to be configured + * @param[out] bw store bandwidths of interface ifx + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_WIFI_IF: invalid interface + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_get_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw); + +#ifdef __cplusplus +} +#endif + +#endif /* __ESP_WIFI_H__ */ diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_ap_get_sta_list.h b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_ap_get_sta_list.h new file mode 100644 index 0000000..fc53918 --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_ap_get_sta_list.h @@ -0,0 +1,55 @@ +/* + * SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "esp_netif_types.h" +#include "esp_wifi_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef ESP_WIFI_MAX_CONN_NUM +// Number of maximum wifi connection may be undefined if we have no native wifi support on this target +// and at the same time there's no native interface injected by the wifi_remote component. +// In this case, we just let the header compilable, since no wifi API could be used (let's make a sanity check) +#if !CONFIG_SOC_WIFI_SUPPORTED && !CONFIG_ESP_WIFI_REMOTE_ENABLED && !CONFIG_ESP_HOST_WIFI_ENABLED +#define ESP_WIFI_MAX_CONN_NUM (15) +typedef struct wifi_sta_list_t wifi_sta_list_t; +#else +#error WiFi header mismatch! Please make sure you use the correct version of WiFi API +#endif +#endif // ESP_WIFI_MAX_CONN_NUM + +/** + * @brief station list structure + */ +typedef struct { + int num; /**< Number of connected stations */ + esp_netif_pair_mac_ip_t sta[ESP_WIFI_MAX_CONN_NUM]; /**< Connected stations */ +} wifi_sta_mac_ip_list_t; + +/** + * @brief Get IP information for stations connected to the Wi-Fi AP interface + * + * @note If `CONFIG_LWIP_DHCPS` is disabled then `ip` address field will not be populated in sta list + * + * @warning This API works only for the default Wi-Fi AP interface, i.e. esp-netif with key="WIFI_AP_DEF" + * + * @param[in] wifi_sta_list Wi-Fi station info list, returned from esp_wifi_ap_get_sta_list() + * @param[out] wifi_sta_ip_mac_list IP layer station info list, corresponding to MAC addresses provided in wifi_sta_list + * + * @return + * - ESP_OK + * - ESP_ERR_ESP_NETIF_NO_MEM + * - ESP_ERR_ESP_NETIF_INVALID_PARAMS + */ +esp_err_t esp_wifi_ap_get_sta_list_with_ip(const wifi_sta_list_t *wifi_sta_list, wifi_sta_mac_ip_list_t *wifi_sta_ip_mac_list); + +#ifdef __cplusplus +} +#endif diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_crypto_types.h b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_crypto_types.h new file mode 100644 index 0000000..a85b443 --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_crypto_types.h @@ -0,0 +1,422 @@ +/* + * SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ESP_WIFI_CRYPTO_TYPES_H__ +#define __ESP_WIFI_CRYPTO_TYPES_H__ + +/* This is an internal API header for configuring the implementation used for WiFi cryptographic + operations. + + During normal operation, you don't need to use any of these types or functions in this header. + See esp_wifi.h & esp_wifi_types.h instead. +*/ +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define ESP_WIFI_CRYPTO_VERSION 0x00000001 + +/* + * Enumeration for hash operations. + * When WPA2 is connecting, this enum is used to + * request a hash algorithm via crypto_hash_xxx functions. + */ +typedef enum { + ESP_CRYPTO_HASH_ALG_MD5, ESP_CRYPTO_HASH_ALG_SHA1, + ESP_CRYPTO_HASH_ALG_HMAC_MD5, ESP_CRYPTO_HASH_ALG_HMAC_SHA1, + ESP_CRYPTO_HASH_ALG_SHA256, ESP_CRYPTO_HASH_ALG_HMAC_SHA256 +} esp_crypto_hash_alg_t; + +/* + * Enumeration for block cipher operations. + * When WPA2 is connecting, this enum is used to request a block + * cipher algorithm via crypto_cipher_xxx functions. + */ +typedef enum { + ESP_CRYPTO_CIPHER_NULL, ESP_CRYPTO_CIPHER_ALG_AES, ESP_CRYPTO_CIPHER_ALG_3DES, + ESP_CRYPTO_CIPHER_ALG_DES, ESP_CRYPTO_CIPHER_ALG_RC2, ESP_CRYPTO_CIPHER_ALG_RC4 +} esp_crypto_cipher_alg_t; + +/* + * This structure is about the algorithm when do crypto_hash operation, for detail, + * please reference to the structure crypto_hash. + */ +typedef struct crypto_hash esp_crypto_hash_t; + +/* + * This structure is about the algorithm when do crypto_cipher operation, for detail, + * please reference to the structure crypto_cipher. + */ +typedef struct crypto_cipher esp_crypto_cipher_t; + +/** + * @brief The AES 128 encrypt callback function used by esp_wifi. + * + * @param key Encryption key. + * @param iv Encryption IV for CBC mode (16 bytes). + * @param data Data to encrypt in-place. + * @param data_len Length of data in bytes (must be divisible by 16) + */ +typedef int (*esp_aes_128_encrypt_t)(const unsigned char *key, const unsigned char *iv, unsigned char *data, int data_len); + +/** + * @brief The AES 128 decrypt callback function used by esp_wifi. + * + * @param key Decryption key. + * @param iv Decryption IV for CBC mode (16 bytes). + * @param data Data to decrypt in-place. + * @param data_len Length of data in bytes (must be divisible by 16) + * + */ +typedef int (*esp_aes_128_decrypt_t)(const unsigned char *key, const unsigned char *iv, unsigned char *data, int data_len); + +/** + * @brief The AES wrap callback function used by esp_wifi. + * + * @param kek 16-octet Key encryption key (KEK). + * @param n Length of the plaintext key in 64-bit units; + * @param plain Plaintext key to be wrapped, n * 64 bits + * @param cipher Wrapped key, (n + 1) * 64 bits + * + */ +typedef int (*esp_aes_wrap_t)(const unsigned char *kek, int n, const unsigned char *plain, unsigned char *cipher); + +/** + * @brief The AES unwrap callback function used by esp_wifi. + * + * @param kek 16-octet Key decryption key (KEK). + * @param n Length of the plaintext key in 64-bit units; + * @param cipher Wrapped key to be unwrapped, (n + 1) * 64 bits + * @param plain Plaintext key, n * 64 bits + * + */ +typedef int (*esp_aes_unwrap_t)(const unsigned char *kek, int n, const unsigned char *cipher, unsigned char *plain); + +/** + * @brief The SHA256 callback function used by esp_wifi. + * + * @param key Key for HMAC operations. + * @param key_len Length of the key in bytes. + * @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 (32 bytes). + * + */ +typedef int (*esp_hmac_sha256_vector_t)(const unsigned char *key, int key_len, int num_elem, + const unsigned char *addr[], const int *len, unsigned char *mac); + +/** + * @brief The SHA256 PRF callback function used by esp_wifi. + * + * @param key Key for PRF. + * @param key_len Length of the key in bytes. + * @param label A unique label for each purpose of the PRF. + * @param data Extra data to bind into the key. + * @param data_len Length of the data. + * @param buf Buffer for the generated pseudo-random key. + * @param buf_len Number of bytes of key to generate. + * + */ +typedef int (*esp_sha256_prf_t)(const unsigned char *key, int key_len, const char *label, + const unsigned char *data, int data_len, unsigned char *buf, int buf_len); + +/** + * @brief HMAC-MD5 callback function over data buffer (RFC 2104)' + * + * @param key Key for HMAC operations + * @param key_len Length of the key in bytes + * @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 + */ +typedef int (*esp_hmac_md5_t)(const unsigned char *key, unsigned int key_len, const unsigned char *data, + unsigned int data_len, unsigned char *mac); + +/** + * @brief HMAC-MD5 callback function over data vector (RFC 2104) + * + * @param key Key for HMAC operations + * @param key_len Length of the key in bytes + * @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 (16 bytes) + * Returns: 0 on success, -1 on failure + */ +typedef int (*esp_hmac_md5_vector_t)(const unsigned char *key, unsigned int key_len, unsigned int num_elem, + const unsigned char *addr[], const unsigned int *len, unsigned char *mac); + +/** + * @brief HMAC-SHA1 callback function over data buffer (RFC 2104) + * + * @param key Key for HMAC operations + * @param key_len Length of the key in bytes + * @param data Pointers to the data area + * @param data_len Length of the data area + * @param mac Buffer for the hash (20 bytes) + * Returns: 0 on success, -1 of failure + */ +typedef int (*esp_hmac_sha1_t)(const unsigned char *key, unsigned int key_len, const unsigned char *data, + unsigned int data_len, unsigned char *mac); + +/** + * @brief HMAC-SHA1 callback function over data vector (RFC 2104) + * + * @param key Key for HMAC operations + * @param key_len Length of the key in bytes + * @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 (20 bytes) + * Returns: 0 on success, -1 on failure + */ +typedef int (*esp_hmac_sha1_vector_t)(const unsigned char *key, unsigned int key_len, unsigned int num_elem, + const unsigned char *addr[], const unsigned int *len, unsigned char *mac); + +/** + * @brief SHA1-based Pseudo-Random Function (PRF) (IEEE 802.11i, 8.5.1.1) callback function + * + * @param key Key for PRF + * @param key_len Length of the key in bytes + * @param label A unique label for each purpose of the PRF + * @param data Extra data to bind into the key + * @param data_len Length of the data + * @param buf Buffer for the generated pseudo-random key + * @param buf_len Number of bytes of key to generate + * Returns: 0 on success, -1 of failure + * + * This function is used to derive new, cryptographically separate keys from a + * given key (e.g., PMK in IEEE 802.11i). + */ +typedef int (*esp_sha1_prf_t)(const unsigned char *key, unsigned int key_len, const char *label, + const unsigned char *data, unsigned int data_len, unsigned char *buf, unsigned int buf_len); + +/** + * @brief SHA-1 hash callback function for data vector + * + * @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 + * Returns: 0 on success, -1 on failure + */ +typedef int (*esp_sha1_vector_t)(unsigned int num_elem, const unsigned char *addr[], const unsigned int *len, + unsigned char *mac); + +/** + * @brief SHA1-based key derivation function (PBKDF2) callback function for IEEE 802.11i + * + * @param passphrase ASCII passphrase + * @param ssid SSID + * @param ssid_len SSID length in bytes + * @param iterations Number of iterations to run + * @param buf Buffer for the generated key + * @param buflen Length of the buffer in bytes + * Returns: 0 on success, -1 of failure + * + * This function is used to derive PSK for WPA-PSK. For this protocol, + * iterations is set to 4096 and buflen to 32. This function is described in + * IEEE Std 802.11-2004, Clause H.4. The main construction is from PKCS#5 v2.0. + */ +typedef int (*esp_pbkdf2_sha1_t)(const char *passphrase, const char *ssid, unsigned int ssid_len, + int iterations, unsigned char *buf, unsigned int buflen); + +/** + * @brief XOR RC4 stream callback function to given data with skip-stream-start + * + * @param key RC4 key + * @param keylen RC4 key length + * @param skip number of bytes to skip from the beginning of the RC4 stream + * @param data data to be XOR'ed with RC4 stream + * @param data_len buf length + * Returns: 0 on success, -1 on failure + * + * Generate RC4 pseudo random stream for the given key, skip beginning of the + * stream, and XOR the end result with the data buffer to perform RC4 + * encryption/decryption. + */ +typedef int (*esp_rc4_skip_t)(const unsigned char *key, unsigned int keylen, unsigned int skip, + unsigned char *data, unsigned int data_len); + +/** + * @brief MD5 hash callback function for data vector + * + * @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 + * Returns: 0 on success, -1 on failure + */ +typedef int (*esp_md5_vector_t)(unsigned int num_elem, const unsigned char *addr[], const unsigned int *len, + unsigned char *mac); + +/** + * @brief Encrypt one AES block callback function + * + * @param ctx Context pointer from aes_encrypt_init() + * @param plain Plaintext data to be encrypted (16 bytes) + * @param crypt Buffer for the encrypted data (16 bytes) + */ +typedef void (*esp_aes_encrypt_t)(void *ctx, const unsigned char *plain, unsigned char *crypt); + +/** + * @brief Initialize AES callback function for encryption + * + * @param key Encryption key + * @param len Key length in bytes (usually 16, i.e., 128 bits) + * Returns: Pointer to context data or %NULL on failure + */ +typedef void * (*esp_aes_encrypt_init_t)(const unsigned char *key, unsigned int len); + +/** + * @brief Deinitialize AES encryption callback function + * + * @param ctx Context pointer from aes_encrypt_init() + */ +typedef void (*esp_aes_encrypt_deinit_t)(void *ctx); + +/** + * @brief Decrypt one AES block callback function + * + * @param ctx Context pointer from aes_encrypt_init() + * @param crypt Encrypted data (16 bytes) + * @param plain Buffer for the decrypted data (16 bytes) + */ +typedef void (*esp_aes_decrypt_t)(void *ctx, const unsigned char *crypt, unsigned char *plain); + +/** + * @brief Initialize AES callback function for decryption + * + * @param key Decryption key + * @param len Key length in bytes (usually 16, i.e., 128 bits) + * Returns: Pointer to context data or %NULL on failure + */ +typedef void * (*esp_aes_decrypt_init_t)(const unsigned char *key, unsigned int len); + +/** + * @brief Deinitialize AES decryption callback function + * + * @param ctx Context pointer from aes_encrypt_init() + */ +typedef void (*esp_aes_decrypt_deinit_t)(void *ctx); + +/** + * @brief One-Key CBC MAC (OMAC1) hash with AES-128 callback function for MIC computation + * + * @param key 128-bit key for the hash operation + * @param data Data buffer for which a MIC is computed + * @param data_len Length of data buffer in bytes + * @param mic Buffer for MIC (128 bits, i.e., 16 bytes) + * Returns: 0 on success, -1 on failure + */ +typedef int (*esp_omac1_aes_128_t)(const uint8_t *key, const uint8_t *data, size_t data_len, + uint8_t *mic); + +/** + * @brief Decrypt data callback function using CCMP (Counter Mode CBC-MAC Protocol OR + * 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 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 + * @param espnow_pkt Indicates if it's an ESPNOW packet + * Returns: Pointer to decrypted data on success, NULL on failure + */ +typedef uint8_t * (*esp_ccmp_decrypt_t)(const uint8_t *tk, const uint8_t *ieee80211_hdr, + const uint8_t *data, size_t data_len, + size_t *decrypted_len, bool espnow_pkt); + +/** + * @brief Encrypt data callback function using CCMP (Counter Mode CBC-MAC Protocol OR + * 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 frame Pointer to IEEE802.11 frame including header + * @param len Length of the frame including header + * @param hdrlen Length of the header + * @param pn Packet Number counter + * @param keyid Key ID to be mentioned in CCMP Vector + * @param encrypted_len Length of the encrypted frame including header + */ +typedef uint8_t * (*esp_ccmp_encrypt_t)(const uint8_t *tk, uint8_t *frame, size_t len, size_t hdrlen, + uint8_t *pn, int keyid, size_t *encrypted_len); + +/** + * @brief One-Key GMAC hash callback function with AES for MIC computation + * + * @param key key for the hash operation + * @param keylen key length + * @param iv initialization vector + * @param iv_len initialization vector length + * @param aad aad + * @param aad_len aad length + * @param mic Buffer for MIC (128 bits, i.e., 16 bytes) + * Returns: 0 on success, -1 on failure + */ +typedef int (*esp_aes_gmac_t)(const uint8_t *key, size_t keylen, const uint8_t *iv, size_t iv_len, + const uint8_t *aad, size_t aad_len, uint8_t *mic); + +/** + * @brief SHA256 hash callback function for data vector + * @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 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); + +/** + * @brief CRC32 value callback function in little endian. + * + * @param crc Initial CRC value (result of last calculation or 0 for the first time) + * @param buf Data buffer that used to calculate the CRC value + * @param len Length of the data buffer + * @return CRC32 value + */ +typedef uint32_t (*esp_crc32_le_t)(uint32_t crc, uint8_t const *buf, uint32_t len); + +/** + * @brief The crypto callback function structure used by esp_wifi. + * The structure can be set as software crypto or the crypto optimized by device's + * hardware. + */ +typedef struct wpa_crypto_funcs_t { + uint32_t size; /**< The crypto callback function structure size */ + uint32_t version; /**< The crypto callback function structure version */ + esp_hmac_sha256_vector_t hmac_sha256_vector; /**< The SHA256 callback function used by esp_wifi */ + esp_pbkdf2_sha1_t pbkdf2_sha1; /**< SHA1-based key derivation function (PBKDF2) callback function for IEEE 802.11 */ + esp_aes_128_encrypt_t aes_128_encrypt; /**< The AES 128 encrypt callback function used by esp_wifi */ + esp_aes_128_decrypt_t aes_128_decrypt; /**< The AES 128 decrypt callback function used by esp_wifi */ + esp_omac1_aes_128_t omac1_aes_128; /**< One-Key CBC MAC (OMAC1) hash with AES-128 callback function for MIC computation */ + esp_ccmp_decrypt_t ccmp_decrypt; /**< Decrypt data callback function using CCMP */ + esp_ccmp_encrypt_t ccmp_encrypt; /**< Encrypt data callback function using CCMP */ + esp_aes_gmac_t aes_gmac; /**< One-Key GMAC hash callback function with AES for MIC computation */ + esp_sha256_vector_t sha256_vector; /**< SHA256 hash callback function for data vector */ +} wpa_crypto_funcs_t; + +/** + * @brief The crypto callback function structure used in mesh vendor IE encryption. The + * structure can be set as software crypto or the crypto optimized by device's + * hardware. + */ +typedef struct { + esp_aes_128_encrypt_t aes_128_encrypt; /**< Callback function used in mesh vendor IE encryption */ + esp_aes_128_decrypt_t aes_128_decrypt; /**< Callback function used in mesh vendor IE decryption */ +} mesh_crypto_funcs_t; + +#ifdef __cplusplus +} +#endif +#endif diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_default.h b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_default.h new file mode 100644 index 0000000..d30d512 --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_default.h @@ -0,0 +1,152 @@ +/* + * SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _ESP_WIFI_DEFAULT_H +#define _ESP_WIFI_DEFAULT_H + +#include "esp_netif.h" +#include "esp_wifi_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Attaches wifi station interface to supplied netif + * + * @param esp_netif instance to attach the wifi station to + * + * @return + * - ESP_OK on success + * - ESP_FAIL if attach failed + */ +esp_err_t esp_netif_attach_wifi_station(esp_netif_t *esp_netif); + +/** + * @brief Attaches wifi soft AP interface to supplied netif + * + * @param esp_netif instance to attach the wifi AP to + * + * @return + * - ESP_OK on success + * - ESP_FAIL if attach failed + */ +esp_err_t esp_netif_attach_wifi_ap(esp_netif_t *esp_netif); + +/** + * @brief Sets default wifi event handlers for STA interface + * + * @return + * - ESP_OK on success, error returned from esp_event_handler_register if failed + */ +esp_err_t esp_wifi_set_default_wifi_sta_handlers(void); + +/** + * @brief Sets default wifi event handlers for AP interface + * + * @return + * - ESP_OK on success, error returned from esp_event_handler_register if failed + */ +esp_err_t esp_wifi_set_default_wifi_ap_handlers(void); + +/** + * @brief Sets default wifi event handlers for NAN interface + * + * @return + * - ESP_OK on success, error returned from esp_event_handler_register if failed + */ +esp_err_t esp_wifi_set_default_wifi_nan_handlers(void); + +/** + * @brief Clears default wifi event handlers for supplied network interface + * + * @param esp_netif instance of corresponding if object + * + * @return + * - ESP_OK on success, error returned from esp_event_handler_register if failed + */ +esp_err_t esp_wifi_clear_default_wifi_driver_and_handlers(void *esp_netif); + +/** + * @brief Creates default WIFI AP. In case of any init error this API aborts. + * + * @note The API creates esp_netif object with default WiFi access point config, + * attaches the netif to wifi and registers wifi handlers to the default event loop. + * This API uses assert() to check for potential errors, so it could abort the program. + * (Note that the default event loop needs to be created prior to calling this API) + * + * @return pointer to esp-netif instance + */ +esp_netif_t* esp_netif_create_default_wifi_ap(void); + +/** + * @brief Creates default WIFI STA. In case of any init error this API aborts. + * + * @note The API creates esp_netif object with default WiFi station config, + * attaches the netif to wifi and registers wifi handlers to the default event loop. + * This API uses assert() to check for potential errors, so it could abort the program. + * (Note that the default event loop needs to be created prior to calling this API) + * + * @return pointer to esp-netif instance + */ +esp_netif_t* esp_netif_create_default_wifi_sta(void); + +/** + * @brief Creates default WIFI NAN. In case of any init error this API aborts. + * + * @note The API creates esp_netif object with default WiFi station config, + * attaches the netif to wifi and registers wifi handlers to the default event loop. + * (Note that the default event loop needs to be created prior to calling this API) + * + * @return pointer to esp-netif instance + */ +esp_netif_t* esp_netif_create_default_wifi_nan(void); + +/** + * @brief Destroys default WIFI netif created with esp_netif_create_default_wifi_...() API. + * + * @param[in] esp_netif object to detach from WiFi and destroy + * + * @note This API unregisters wifi handlers and detaches the created object from the wifi. + * (this function is a no-operation if esp_netif is NULL) + */ +void esp_netif_destroy_default_wifi(void *esp_netif); + +/** + * @brief Creates esp_netif WiFi object based on the custom configuration. + * + * @attention This API DOES NOT register default handlers! + * + * @param[in] wifi_if type of wifi interface + * @param[in] esp_netif_config inherent esp-netif configuration pointer + * + * @return pointer to esp-netif instance + */ +esp_netif_t* esp_netif_create_wifi(wifi_interface_t wifi_if, const esp_netif_inherent_config_t *esp_netif_config); + +/** + * @brief Creates default STA and AP network interfaces for esp-mesh. + * + * Both netifs are almost identical to the default station and softAP, but with + * DHCP client and server disabled. Please note that the DHCP client is typically + * enabled only if the device is promoted to a root node. + * + * Returns created interfaces which could be ignored setting parameters to NULL + * if an application code does not need to save the interface instances + * for further processing. + * + * @param[out] p_netif_sta pointer where the resultant STA interface is saved (if non NULL) + * @param[out] p_netif_ap pointer where the resultant AP interface is saved (if non NULL) + * + * @return ESP_OK on success + */ +esp_err_t esp_netif_create_default_wifi_mesh_netifs(esp_netif_t **p_netif_sta, esp_netif_t **p_netif_ap); + +#ifdef __cplusplus +} +#endif + +#endif //_ESP_WIFI_DEFAULT_H diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_he.h b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_he.h new file mode 100644 index 0000000..619c7b3 --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_he.h @@ -0,0 +1,238 @@ +/* + * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include +#include +#include "esp_err.h" +#include "esp_wifi_types.h" +#include "esp_wifi_he_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Set up an individual TWT agreement (NegotiationType=0) or change TWT parameters of the existing TWT agreement + * - TWT Wake Interval = TWT Wake Interval Mantissa * (2 ^ TWT Wake Interval Exponent), unit: us + * - e.g. TWT Wake Interval Mantissa = 512, TWT Wake Interval Exponent = 12, then TWT Wake Interval is 2097.152 ms + * Nominal Minimum Wake Duration = 255, then TWT Wake Duration is 65.28 ms + * + * @attention Support at most 8 TWT agreements, otherwise ESP_ERR_WIFI_TWT_FULL will be returned. + * Support sleep time up to (1 << 35) us. + * + * @param[in,out] setup_config pointer to itwt setup config structure. + * + * @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_CONN: WiFi internal error, station or soft-AP control block wrong + * - ESP_ERR_WIFI_NOT_CONNECT: The station is in disconnect status + * - ESP_ERR_WIFI_TWT_FULL: no available flow id + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_sta_itwt_setup(wifi_itwt_setup_config_t *setup_config); + +/** + * @brief Tear down individual TWT agreements + * + * @param[in] flow_id The value range is [0, 7]. + * FLOW_ID_ALL indicates tear down all individual TWT agreements. + * + * @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_CONN: WiFi internal error, station or soft-AP control block wrong + * - ESP_ERR_WIFI_NOT_CONNECT: The station is in disconnect status + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_sta_itwt_teardown(int flow_id); + +/** + * @brief Send a TWT Information frame to AP for suspending/resuming established iTWT agreements. + * + * @param[in] flow_id The value range is [0, 7]. + * FLOW_ID_ALL indicates suspend all individual TWT agreements + * @param[in] suspend_time_ms If the value is 0, indicates the specified flow_id or all established agreements will be suspended until resume by users. + * If the value is greater than 0, indicates the specified flow_id or all established agreements will be suspended until suspend_time_ms timeout, unit: ms. + * + * @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_CONN: WiFi internal error, station or soft-AP control block wrong + * - ESP_ERR_WIFI_NOT_ASSOC: WiFi is not associated + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_sta_itwt_suspend(int flow_id, int suspend_time_ms); + +/** + * @brief Get flow id status + * + * @param[in] flow_id_bitmap Flow id status bitmap with 8 bit. Each bit represents that whether the corresponding flow id is setup. + * 1: setup, 0: not setup. + * + * @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_CONN: WiFi internal error, station or soft-AP control block wrong + * - ESP_ERR_WIFI_NOT_CONNECT: The station is in disconnect status + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_sta_itwt_get_flow_id_status(int *flow_id_bitmap); + +/** + * @brief Send probe to update TSF time + * + * @attention In bad network, timeout_ms is variable with the network + * + * @param[in] timeout_ms The estimated time includes sending probe request and receiving probe response, unit: ms. + * + * @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_CONN: WiFi internal error, station or soft-AP control block wrong + * - ESP_ERR_WIFI_NOT_ASSOC: WiFi is not associated + */ +esp_err_t esp_wifi_sta_itwt_send_probe_req(int timeout_ms); + +/** + * @brief Set time offset with TBTT of target wake time field in itwt setup request frame. + * + * @param[in] offset_us Offset with TBTT of target wake time field in itwt setup request frame, range is [0, 102400], unit microseconds. + * + * @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_CONN: WiFi internal error, station or soft-AP control block wrong + * - ESP_ERR_WIFI_NOT_ASSOC: WiFi is not associated + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_sta_itwt_set_target_wake_time_offset(int offset_us); + +/** + * @brief Enable the reception statistics. + * + * @param[in] rx_stats indicate whether enable the reception statistics for HT, HE SU, HE ER SU and legacy + * @param[in] rx_mu_stats indicate whether enable the reception statistics for DL MU-MIMO and DL OFDMA + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_NO_MEM: out of memory + */ +esp_err_t esp_wifi_enable_rx_statistics(bool rx_stats, bool rx_mu_stats); + +/** + * @brief Enable the transmission statistics. + * + * @param[in] aci access category of the transmission + * @param[in] tx_stats indicate whether enable the transmission statistics + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_NO_MEM: out of memory + */ +esp_err_t esp_wifi_enable_tx_statistics(esp_wifi_aci_t aci, bool tx_stats); + +/** + * @brief Set up an broadcast TWT agreement (NegotiationType=3) or change TWT parameters of the existing TWT agreement + * - TWT Wake Interval = TWT Wake Interval Mantissa * (2 ^ TWT Wake Interval Exponent), unit: us + * - e.g. TWT Wake Interval Mantissa = 512, TWT Wake Interval Exponent = 12, then TWT Wake Interval is 2097.152 ms + * Nominal Minimum Wake Duration = 255, then TWT Wake Duration is 65.28 ms + * + * @attention Support at most 32 TWT agreements, otherwise ESP_ERR_WIFI_TWT_FULL will be returned. + * Support sleep time up to (1 << 35) us. + * + * @param[in,out] config pointer to btwt setup config structure. + * + * @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_CONN: WiFi internal error, station or soft-AP control block wrong + * - ESP_ERR_WIFI_NOT_CONNECT: The station is in disconnect status + * - ESP_ERR_WIFI_TWT_FULL: no available flow id + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_sta_btwt_setup(wifi_btwt_setup_config_t *config); + +/** + * @brief Tear down broadcast TWT agreements + * + * @param[in] btwt_id The value range is [0, 31]. + * BTWT_ID_ALL indicates tear down all broadcast TWT agreements. + * + * @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_CONN: WiFi internal error, station or soft-AP control block wrong + * - ESP_ERR_WIFI_NOT_CONNECT: The station is in disconnect status + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_sta_btwt_teardown(uint8_t btwt_id); + +/** + * @brief Get number of broadcast TWTs supported by the connected AP + * + * @param[out] btwt_number store number of btwts supported by the connected AP + * + * @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_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_sta_get_btwt_num(uint8_t *btwt_number); + +/** + * @brief Get broadcast TWT information + * + * @param[in] btwt_number As input param, it stores max btwt number AP supported. + * @param[in] btwt_info array to hold the btwt information supported by AP, and the array size must be at least as large as the BTWT number. + * + * @return + * - ESP_OK: succeed + * - ESP_FAIL: fail + * - ESP_ERR_WIFI_CONN: WiFi internal error, station or soft-AP control block wrong + */ +esp_err_t esp_wifi_sta_btwt_get_info(uint8_t btwt_number, esp_wifi_btwt_info_t *btwt_info); + +/** + * @brief Set WiFi TWT config + * + * @param[in] config pointer to the WiFi TWT configure structure. + * + * @return + * - ESP_OK: succeed + */ +esp_err_t esp_wifi_sta_twt_config(wifi_twt_config_t *config); + +/** + * @brief Enable bss color collision detection. + * + * @attention Currently, only STA BSS color collision detection is supported. + * + * @param ifx interface to be configured + * @param enable If true, when the STA detects a BSS color collision, it will report the BSS color collision event to the access point (AP). + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_IF: Invalid interface + * - 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_t esp_wifi_enable_bsscolor_collision_detection(wifi_interface_t ifx, bool enable); + +#ifdef __cplusplus +} +#endif diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_he_types.h b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_he_types.h new file mode 100644 index 0000000..c9a7690 --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_he_types.h @@ -0,0 +1,435 @@ +/* + * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include +#include +#include "esp_err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define FLOW_ID_ALL (8) +#define BTWT_ID_ALL (32) +#define BSS_MAX_COLOR (63) + +/** + * @brief Access category + */ +typedef enum { + ESP_WIFI_ACI_VO, /**< voice traffic */ + ESP_WIFI_ACI_VI, /**< video traffic */ + ESP_WIFI_ACI_BE, /**< best effort traffic */ + ESP_WIFI_ACI_BK, /**< background traffic */ + ESP_WIFI_ACI_MAX, /**< the max value */ +} esp_wifi_aci_t; + +/** + * @brief Channel state information(CSI) HE STBC CSI selection + */ +enum { + ESP_CSI_ACQUIRE_STBC_HELTF1, /**< HE STBC: select the first HE-LTF */ + ESP_CSI_ACQUIRE_STBC_HELTF2, /**< HE STBC: select the second HE-LTF */ + ESP_CSI_ACQUIRE_STBC_SAMPLE_HELTFS, /**< HE STBC: sample alternating scarier of HE-LTF1 and HE-LTF2 */ +}; + +/** + * @brief Channel state information(CSI) configuration type + */ +#if CONFIG_SLAVE_SOC_WIFI_MAC_VERSION_NUM == 3 +typedef struct { + uint32_t enable : 1; /**< enable to acquire CSI */ + uint32_t acquire_csi_legacy : 1; /**< enable to acquire L-LTF */ + uint32_t acquire_csi_force_lltf : 1; /**< enable to acquire L-LTF */ + uint32_t acquire_csi_ht20 : 1; /**< enable to acquire HT-LTF when receiving an HT20 PPDU */ + uint32_t acquire_csi_ht40 : 1; /**< enable to acquire HT-LTF when receiving an HT40 PPDU */ + uint32_t acquire_csi_vht : 1; /**< enable to acquire VHT-LTF when receiving an VHT20 PPDU */ + uint32_t acquire_csi_su : 1; /**< enable to acquire HE-LTF when receiving an HE20 SU PPDU */ + uint32_t acquire_csi_mu : 1; /**< enable to acquire HE-LTF when receiving an HE20 MU PPDU */ + uint32_t acquire_csi_dcm : 1; /**< enable to acquire HE-LTF when receiving an HE20 DCM applied PPDU */ + uint32_t acquire_csi_beamformed : 1; /**< enable to acquire HE-LTF when receiving an HE20 Beamformed applied PPDU */ + uint32_t acquire_csi_he_stbc_mode: 2; /**< when receiving an STBC applied HE PPDU, + 0- acquire the complete HE-LTF1 + 1- acquire the complete HE-LTF2 + 2- sample evenly among the HE-LTF1 and HE-LTF2 */ + + uint32_t val_scale_cfg : 4; /**< value 0-8 */ + uint32_t dump_ack_en : 1; /**< enable to dump 802.11 ACK frame, default disabled */ + uint32_t reserved : 15; /**< reserved */ +} wifi_csi_acquire_config_t; +#else +typedef struct { + uint32_t enable : 1; /**< enable to acquire CSI */ + uint32_t acquire_csi_legacy : 1; /**< enable to acquire L-LTF when receiving a 11g PPDU */ + uint32_t acquire_csi_ht20 : 1; /**< enable to acquire HT-LTF when receiving an HT20 PPDU */ + uint32_t acquire_csi_ht40 : 1; /**< enable to acquire HT-LTF when receiving an HT40 PPDU */ + uint32_t acquire_csi_su : 1; /**< enable to acquire HE-LTF when receiving an HE20 SU PPDU */ + uint32_t acquire_csi_mu : 1; /**< enable to acquire HE-LTF when receiving an HE20 MU PPDU */ + uint32_t acquire_csi_dcm : 1; /**< enable to acquire HE-LTF when receiving an HE20 DCM applied PPDU */ + uint32_t acquire_csi_beamformed : 1; /**< enable to acquire HE-LTF when receiving an HE20 Beamformed applied PPDU */ + uint32_t acquire_csi_he_stbc : 2; /**< when receiving an STBC applied HE PPDU, + 0- acquire the complete HE-LTF1 + 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 dump_ack_en : 1; /**< enable to dump 802.11 ACK frame, default disabled */ + uint32_t reserved : 19; /**< reserved */ +} wifi_csi_acquire_config_t; +#endif + +/** + * @brief HE variant HT Control field including OM(Operation mode) + */ +typedef struct { + uint32_t id : 2; /**< HE Variant ID = 3 */ + uint32_t ctrl_id : 4; /**< OM control ID: 1 */ + uint32_t rx_nss : 3; /**< the max. number of spatial streams for the reception, only accept 0. */ + uint32_t bw : 2; /**< the operating channel width for both reception and transmission, only accept 0. */ + uint32_t ul_mu_disable : 1; /**< disable UL MU operations */ + uint32_t tx_nsts : 3; /**< the max. number of spatial streams for the transmission, only accept 0. */ + uint32_t er_su_disable : 1; /**< disable the reception of 242-tone HE ER SU PPDU */ + uint32_t dl_mu_mimo_resounding_recommendation : 1; /**< indicate the STA suggests the AP either resounding the channel or increase the channel sounding frequency with the STA */ + uint32_t ul_mu_data_disable : 1; /**< disable UL MU data operations */ + uint32_t padding : 14; /**< padding bits */ +} esp_wifi_htc_omc_t; + +/** + * @brief TWT setup commands + */ +typedef enum { + TWT_REQUEST, /**< request to join a TWT without providing a set of TWT parameters */ + TWT_SUGGEST, /**< request to join a TWT and offer a set of preferred TWT parameters but might accept alternative TWT parameters */ + TWT_DEMAND, /**< request to join a TWT and currently accept only the indicated TWT parameters */ + TWT_GROUPING, /**< for S1G STA */ + TWT_ACCEPT, /**< accept the TWT request with the TWT parameters, also used in unsolicited TWT response */ + TWT_ALTERNATE, /**< indicate a counter-offer of TWT parameters without creation of a TWT agreement */ + TWT_DICTATE, /**< indicate no TWT agreement is created, but one is likely to be accepted only if the requesting STA transmits a new TWT setup request with the indicated TWT parameters */ + TWT_REJECT, /**< indicate that the negotiation has ended in failure to create a new TWT agreement */ +} wifi_twt_setup_cmds_t; + +/** + * @brief broadcast TWT setup config + */ +typedef struct { + wifi_twt_setup_cmds_t setup_cmd; /**< Indicates the type of TWT command*/ + uint8_t btwt_id; /**< When set up an broadcast TWT agreement, the broadcast twt id will be assigned by AP after a successful agreement setup. + broadcast twt id could be specified to a value in the range of [1, 31], but it might be change by AP in the response. + When change TWT parameters of the existing TWT agreement, broadcast twt id should be an existing one. The value range is [1, 31].*/ + uint16_t timeout_time_ms; /**< Timeout times of receiving setup action frame response, default 5s*/ +} wifi_btwt_setup_config_t; + +/** + * @brief Individual TWT setup config + */ +typedef struct { + wifi_twt_setup_cmds_t setup_cmd; /**< Indicates the type of TWT command */ + uint16_t trigger : 1; /**< 1: a trigger-enabled individual TWT, 0: a non-trigger-enabled individual TWT */ + uint16_t flow_type : 1; /**< 0: an announced individual TWT, 1: an unannounced individual TWT */ + uint16_t flow_id : 3; /**< When set up an individual TWT agreement, the flow id will be assigned by AP after a successful agreement setup. + flow_id could be specified to a value in the range of [0, 7], but it might be changed by AP in the response. + When change TWT parameters of the existing TWT agreement, flow_id should be an existing one. The value range is [0, 7]. */ + uint16_t wake_invl_expn : 5; /**< Individual TWT Wake Interval Exponent. The value range is [0, 31]. */ + uint16_t wake_duration_unit : 1; /**< Individual TWT Wake duration unit, 0: 256us 1: TU (TU = 1024us)*/ + uint16_t reserved : 5; /**< bit: 11.15 reserved */ + uint8_t min_wake_dura; /**< Nominal Minimum Wake Duration, indicates the minimum amount of time, in unit of 256 us, that the individual TWT requesting STA expects that it needs to be awake. The value range is [1, 255]. */ + uint16_t wake_invl_mant; /**< Individual TWT Wake Interval Mantissa. The value range is [1, 65535]. */ + uint16_t twt_id; /**< Individual TWT connection id, the value range is [0, 32767]. */ + uint16_t timeout_time_ms; /**< Timeout times of receiving setup action frame response, default 5s*/ +} wifi_twt_setup_config_t; + +typedef wifi_twt_setup_config_t wifi_itwt_setup_config_t; + +/** + * @brief HE SU GI and LTF types + */ +typedef enum { + HE_SU_ERSU_1_LTF_0_8_US_GI, /**< 1 LTF and 0.8 us GI */ + HE_SU_ERSU_2_LTF_0_8_US_GI, /**< 2 LTF and 0.8 us GI */ + HE_SU_ERSU_2_LTF_1_6_US_GI, /**< 2 LTF and 1.6 us GI */ + HE_SU_ERSU_4_LTF_3_2_US_GI, /**< 4 LTF and 3.2 us GI */ +} he_su_gi_and_ltf_type_t; + +/** + * @brief Reception format + */ +typedef enum { + RX_BB_FORMAT_11B = 0, /**< the reception frame is a 11b MPDU */ + RX_BB_FORMAT_11G = 1, /**< the reception frame is a 11g MPDU */ + RX_BB_FORMAT_11A = RX_BB_FORMAT_11G, /**< the reception frame is a 11a MPDU */ + RX_BB_FORMAT_HT = 2, /**< the reception frame is a HT MPDU */ + RX_BB_FORMAT_VHT = 3, /**< the reception frame is a VHT MPDU */ + RX_BB_FORMAT_HE_SU = 4, /**< the reception frame is a HE SU MPDU */ + RX_BB_FORMAT_HE_MU = 5, /**< the reception frame is a HE MU MPDU */ + RX_BB_FORMAT_HE_ERSU = 6, /**< the reception frame is a HE ER SU MPDU */ + RX_BB_FORMAT_HE_TB = 7, /**< the reception frame is a HE TB MPDU */ +} wifi_rx_bb_format_t; + +/** + * @brief RxControl Info + */ +#if CONFIG_SLAVE_SOC_WIFI_MAC_VERSION_NUM == 3 +typedef struct { + signed rssi: 8; /**< the RSSI of the reception frame */ + unsigned rate: 5; /**< if cur_bb_format is RX_BB_FORMAT_11B, it's the transmission rate. otherwise it's Rate field of L-SIG */ + unsigned : 1; /**< reserved */ + unsigned : 2; /**< reserved */ + unsigned : 12; /**< reserved */ + unsigned rxmatch0: 1; /**< indicate whether the reception frame is from interface 0 */ + unsigned rxmatch1: 1; /**< indicate whether the reception frame is from interface 1 */ + unsigned rxmatch2: 1; /**< indicate whether the reception frame is from interface 2 */ + unsigned rxmatch3: 1; /**< indicate whether the reception frame is from interface 3 */ + uint32_t he_siga1; /**< HE-SIGA1 or HT-SIG or VHT-SIG */ + unsigned rxend_state: 8; /**< reception state, 0: successful, others: failure */ + uint16_t he_siga2; /**< HE-SIGA2 */ + unsigned : 7; /**< reserved */ + unsigned is_group: 1; /**< indicate whether the reception is a group addressed frame */ + unsigned timestamp: 32; /**< timestamp. The local time when this packet is received. It is precise only if modem sleep or light sleep is not enabled. unit: microsecond */ + unsigned : 15; /**< reserved */ + unsigned : 15; /**< reserved */ + unsigned : 2; /**< reserved */ + signed noise_floor: 8; /**< the noise floor of the reception frame */ + signed : 8; /**< reserved */ + signed : 8; /**< reserved */ + unsigned : 8; /**< reserved */ + unsigned : 8; /**< reserved */ + unsigned : 8; /**< reserved */ + unsigned : 2; /**< reserved */ + unsigned sigb_len: 10; /**< the sigb length */ + unsigned : 1; /**< reserved */ + unsigned : 1; /**< reserved */ + unsigned : 1; /**< reserved */ + unsigned : 1; /**< reserved */ + unsigned channel: 8; /**< the primary channel */ + unsigned second: 8; /**< the second channel if in HT40 */ + unsigned : 4; /**< reserved */ + unsigned : 4; /**< reserved */ + unsigned : 1; /**< reserved */ + unsigned : 7; /**< reserved */ + unsigned : 2; /**< reserved */ + unsigned : 4; /**< reserved */ + unsigned : 2; /**< reserved */ + unsigned : 11; /**< reserved */ + unsigned : 1; /**< reserved */ + unsigned : 12; /**< reserved */ + unsigned : 12; /**< reserved */ + unsigned cur_bb_format: 4; /**< the format of the reception frame */ + unsigned rx_channel_estimate_len: 10; /**< the length of the channel information */ + unsigned rx_channel_estimate_info_vld: 1; /**< indicate the channel information is valid */ + unsigned : 5; /**< reserved */ + unsigned : 21; /**< reserved */ + unsigned : 10; /**< reserved */ + unsigned : 1; /**< reserved */ + unsigned : 3; /**< reserved */ + unsigned : 1; /**< reserved */ + unsigned : 6; /**< reserved */ + unsigned : 21; /**< reserved */ + unsigned : 1; /**< reserved */ + unsigned : 32; /**< reserved */ + unsigned : 7; /**< reserved */ + unsigned : 1; /**< reserved */ + unsigned : 8; /**< reserved */ + unsigned : 16; /**< reserved */ + unsigned sig_len: 14; /**< the length of the reception MPDU */ + unsigned : 2; /**< reserved */ + unsigned dump_len: 14; /**< the length of the reception MPDU excluding the FCS */ + unsigned : 2; /**< reserved */ + unsigned rx_state: 8; /**< reception state, 0: successful, others: failure */ + unsigned : 8; /**< reserved */ + unsigned : 16; /**< reserved */ +} __attribute__((packed)) esp_wifi_rxctrl_t; +#else +typedef struct { + signed rssi : 8; /**< the RSSI of the reception frame */ + unsigned rate : 5; /**< if cur_bb_format is RX_BB_FORMAT_11B, it's the transmission rate. otherwise it's Rate field of L-SIG */ + unsigned : 1; /**< reserved */ + unsigned : 2; /**< reserved */ + unsigned : 12; /**< reserved */ + unsigned rxmatch0 : 1; /**< indicate whether the reception frame is from interface 0 */ + unsigned rxmatch1 : 1; /**< indicate whether the reception frame is from interface 1 */ + unsigned rxmatch2 : 1; /**< indicate whether the reception frame is from interface 2 */ + unsigned rxmatch3 : 1; /**< indicate whether the reception frame is from interface 3 */ + uint32_t he_siga1; /**< HE-SIGA1 or HT-SIG */ + unsigned rxend_state : 8; /**< reception state, 0: successful, others: failure */ + uint16_t he_siga2; /**< HE-SIGA2 */ + unsigned : 7; /**< reserved */ + unsigned is_group : 1; /**< indicate whether the reception is a group addressed frame */ + unsigned timestamp : 32; /**< timestamp. The local time when this packet is received. It is precise only if modem sleep or light sleep is not enabled. unit: microsecond */ + unsigned : 15; /**< reserved */ + unsigned : 15; /**< reserved */ + unsigned : 2; /**< reserved */ + signed noise_floor : 8; /**< the noise floor of the reception frame */ + unsigned channel : 4; /**< the primary channel */ + unsigned second : 4; /**< the second channel if in HT40 */ + unsigned : 8; /**< reserved */ + unsigned : 8; /**< reserved */ + unsigned : 32; /**< reserved */ + unsigned : 32; /**< reserved */ + unsigned : 2; /**< reserved */ + unsigned : 4; /**< reserved */ + unsigned : 2; /**< reserved */ + unsigned rx_channel_estimate_len : 10; /**< the length of the channel information */ + unsigned rx_channel_estimate_info_vld : 1; /**< indicate the channel information is valid */ + unsigned : 1; /**< reserved */ + unsigned : 11; /**< reserved */ + unsigned : 1; /**< reserved */ + unsigned : 24; /**< reserved */ + unsigned cur_bb_format : 4; /**< the format of the reception frame */ + unsigned cur_single_mpdu : 1; /**< indicate whether the reception MPDU is a S-MPDU */ + unsigned : 3; /**< reserved */ + unsigned : 32; /**< reserved */ + unsigned : 32; /**< reserved */ + unsigned : 32; /**< reserved */ + unsigned : 32; /**< reserved */ + unsigned : 32; /**< reserved */ + unsigned : 32; /**< reserved */ + unsigned : 32; /**< reserved */ + unsigned : 32; /**< reserved */ + unsigned : 8; /**< reserved */ + unsigned he_sigb_len : 6; /**< the length of HE-SIGB */ + unsigned : 2; /**< reserved */ + unsigned : 8; /**< reserved */ + unsigned : 8; /**< reserved */ + unsigned : 32; /**< reserved */ + unsigned : 7; /**< reserved */ + unsigned : 1; /**< reserved */ + unsigned : 8; /**< reserved */ + unsigned : 16; /**< reserved */ + unsigned sig_len : 14; /**< the length of the reception MPDU */ + unsigned : 2; /**< reserved */ + unsigned dump_len : 14; /**< the length of the reception MPDU excluding the FCS */ + unsigned : 2; /**< reserved */ + unsigned rx_state : 8; /**< reception state, 0: successful, others: failure */ + unsigned : 24; /**< reserved */ +} __attribute__((packed)) esp_wifi_rxctrl_t; +#endif + +/** + * @brief bTWT setup status + */ +typedef enum { + BTWT_SETUP_TXFAIL, /**< station sends btwt setup request frame fail */ + BTWT_SETUP_SUCCESS, /**< station receives btwt setup response frame and setup btwt sucessfully */ + BTWT_SETUP_TIMEOUT, /**< timeout of receiving btwt setup response frame */ + BTWT_SETUP_FULL, /**< indicate there is no available btwt id */ + BTWT_SETUP_INVALID_ARG, /**< indicate invalid argument to setup btwt */ + BTWT_SETUP_INTERNAL_ERR, /**< indicate internal error to setup btwt */ +} wifi_btwt_setup_status_t; + +/** Argument structure for WIFI_EVENT_TWT_SET_UP event */ +typedef struct { + wifi_itwt_setup_config_t config; /**< itwt setup config, this value is determined by the AP */ + esp_err_t status; /**< itwt setup status, 1: indicate setup success, others : indicate setup fail */ + uint8_t reason; /**< itwt setup frame tx fail reason */ + uint64_t target_wake_time; /**< TWT SP start time */ +} wifi_event_sta_itwt_setup_t; + +/** + * @brief iTWT teardown status + */ +typedef enum { + ITWT_TEARDOWN_FAIL, /**< station sends teardown frame fail */ + ITWT_TEARDOWN_SUCCESS, /**< 1) station successfully sends teardown frame to AP; 2) station receives teardown frame from AP */ +} wifi_itwt_teardown_status_t; + +/** Argument structure for WIFI_EVENT_TWT_TEARDOWN event */ +typedef struct { + uint8_t flow_id; /**< flow id */ + wifi_itwt_teardown_status_t status; /**< itwt teardown status */ +} wifi_event_sta_itwt_teardown_t; + +/** Argument structure for WIFI_EVENT_BTWT_SET_UP event */ +typedef struct { + wifi_btwt_setup_status_t status; /**< indicate btwt setup status */ + wifi_twt_setup_cmds_t setup_cmd; /**< indicate the type of TWT command */ + uint8_t btwt_id; /**< indicate btwt id */ + uint8_t min_wake_dura; /**< Nominal Minimum Wake Duration, indicates the minimum amount of time, in unit of 256 us, that the TWT requesting STA expects that it needs to be awake. The value range is [1, 255]. */ + uint8_t wake_invl_expn; /**< TWT Wake Interval Exponent. The value range is [0, 31]. */ + uint16_t wake_invl_mant; /**< TWT Wake Interval Mantissa. The value range is [1, 65535]. */ + bool trigger; /**< 1: a trigger-enabled TWT, 0: a non-trigger-enabled TWT */ + uint8_t flow_type; /**< 0: an announced TWT, 1: an unannounced TWT */ + uint8_t reason; /**< btwt setup frame tx fail reason */ + uint64_t target_wake_time; /**< TWT SP start time */ +} wifi_event_sta_btwt_setup_t; + +/** + * @brief BTWT teardown status + */ +typedef enum { + BTWT_TEARDOWN_FAIL, /**< station sends teardown frame fail */ + BTWT_TEARDOWN_SUCCESS, /**< 1) station successfully sends teardown frame to AP; 2) station receives teardown frame from AP */ +} wifi_btwt_teardown_status_t; + +/** Argument structure for WIFI_EVENT_TWT_TEARDOWN event */ +typedef struct { + uint8_t btwt_id; /**< btwt id */ + wifi_btwt_teardown_status_t status; /**< btwt teardown status */ +} wifi_event_sta_btwt_teardown_t; + +/** + * @brief iTWT probe status + */ +typedef enum { + ITWT_PROBE_FAIL, /**< station sends probe request fail */ + ITWT_PROBE_SUCCESS, /**< 1) station receives beacon from AP; 2) station receives probe response from AP */ + ITWT_PROBE_TIMEOUT, /**< 1) timeout of receiving ACK in response of previously probe request sending by station + 2) timeout of receiving probe response in response of previously probe request sending by station */ + ITWT_PROBE_STA_DISCONNECTED, /**< station is not connected */ +} wifi_itwt_probe_status_t; + +/** Argument structure for WIFI_EVENT_ITWT_SEND_PROBE event */ +typedef struct { + wifi_itwt_probe_status_t status; /**< probe status */ + uint8_t reason; /**< failure reason */ +} wifi_event_sta_itwt_probe_t; + +/** Argument structure for WIFI_EVENT_ITWT_SUSPEND event */ +typedef struct { + esp_err_t status; /**< suspend status */ + uint8_t flow_id_bitmap; /**< bitmap of the suspended flow id */ + uint32_t actual_suspend_time_ms[8]; /**< the actual suspend time for each flow id, unit: ms */ +} wifi_event_sta_itwt_suspend_t; + +/** + * @brief TWT types + */ +typedef enum { + TWT_TYPE_INDIVIDUAL, /**< individual twt */ + TWT_TYPE_BROADCAST, /**< broadcast twt */ + TWT_TYPE_MAX, /**< the max value */ +} wifi_twt_type_t; + +/** Argument structure for twt configuration */ +typedef struct { + bool post_wakeup_event; /**< post twt wakeup event */ + bool twt_enable_keep_alive; /**< twt enable send qos null to keep alive */ +} wifi_twt_config_t; + +/** Argument structure for WIFI_EVENT_TWT_WAKEUP event */ +typedef struct { + wifi_twt_type_t twt_type; /**< twt type */ + uint8_t flow_id; /**< flow id */ +} wifi_event_sta_twt_wakeup_t; + +/** Argument structure for twt information */ +typedef struct { + bool btwt_id_in_use; /**< indicate whether the btwt id is in use or not */ + uint16_t btwt_trigger : 1; /**< 1: a trigger-enabled TWT, 0: a non-trigger-enabled TWT */ + uint16_t btwt_flow_type : 1; /**< 0: an announced TWT, 1: an unannounced TWT */ + uint16_t btwt_recommendation : 3; /**< indicate recommendations on the types of frames. 0: no constraints, [1, 3], [4, 7] reserved */ + uint16_t btwt_wake_interval_exponent : 5; /**< TWT Wake Interval Exponent. The value range is [0, 31]. */ + uint16_t btwt_rsvd : 6; /**< reserved */ + uint8_t btwt_wake_duration; /**< TWT Wake duration unit, 0: 256us 1: TU (TU = 1024us) */ + uint16_t btwt_wake_interval_mantissa; /**< TWT Wake Interval Mantissa. The value range is [1, 65535]. */ + uint16_t btwt_info_id : 5; /**< btwt id */ + uint16_t btwt_info_persistence : 8; /**< indicate the number of TBTTs during which the Broadcast TWT SPs corresponding to this broadcast TWT parameters set are present */ + uint16_t btwt_info_rsvd : 3; /**< reserved */ +} esp_wifi_btwt_info_t; + +#ifdef __cplusplus +} +#endif diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_netif.h b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_netif.h new file mode 100644 index 0000000..7dfa724 --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_netif.h @@ -0,0 +1,86 @@ +/* + * SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include +#include +#include "esp_err.h" +#include "esp_wifi_types.h" +#include "esp_netif_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Number of WiFi interfaces used by wifi-netif abstraction + */ +#define MAX_WIFI_IFS WIFI_IF_MAX + +/** + * @brief Forward declaration of WiFi interface handle + */ +typedef struct wifi_netif_driver* wifi_netif_driver_t; + +/** + * @brief Creates wifi driver instance to be used with esp-netif + * + * @param wifi_if wifi interface type (station, softAP) + * + * @return + * - pointer to wifi interface handle on success + * - NULL otherwise + */ +wifi_netif_driver_t esp_wifi_create_if_driver(wifi_interface_t wifi_if); + +/** + * @brief Destroys wifi driver instance + * + * @param h pointer to wifi interface handle + * + */ +void esp_wifi_destroy_if_driver(wifi_netif_driver_t h); + +/** + * @brief Return mac of specified wifi driver instance + * + * @param[in] ifx pointer to wifi interface handle + * @param[out] mac output mac address + * + * @return ESP_OK on success + * + */ +esp_err_t esp_wifi_get_if_mac(wifi_netif_driver_t ifx, uint8_t mac[6]); + +/** + * @brief Return true if the supplied interface instance is ready after start. + * Typically used when registering on receive callback, which ought to be + * installed as soon as AP started, but once STA gets connected. + * + * @param[in] ifx pointer to wifi interface handle + * + * @return + * - true if ready after interface started (typically Access Point type) + * - false if ready once interface connected (typically for Station type) + */ +bool esp_wifi_is_if_ready_when_started(wifi_netif_driver_t ifx); + +/** + * @brief Register interface receive callback function with argument + * + * @param[in] ifx pointer to wifi interface handle + * @param[in] fn function to be registered (typically esp_netif_receive) + * @param[in] arg argument to be supplied to registered function (typically esp_netif ptr) + * + * @return ESP_OK on success + * + */ +esp_err_t esp_wifi_register_if_rxcb(wifi_netif_driver_t ifx, esp_netif_receive_t fn, void * arg); + +#ifdef __cplusplus +} +#endif diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_types.h b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_types.h new file mode 100644 index 0000000..ef9f09c --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_types.h @@ -0,0 +1,29 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#pragma once + +#include "esp_wifi_types_generic.h" +#if __has_include("esp_wifi_types_native.h") +#include "esp_wifi_types_native.h" +#else + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * In case we have no native types, we can still provide opaque structs, + * so the most common APIs could work and others would compile. + * This could happen for chipsets with no wifi, yet without local esp_wifi_remote. + */ +typedef struct wifi_csi_config_t wifi_csi_config_t; +typedef struct wifi_pkt_rx_ctrl_t wifi_pkt_rx_ctrl_t; + +#ifdef __cplusplus +} +#endif + +#endif // __has_include("esp_wifi_types_native.h") diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_types_generic.h b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_types_generic.h new file mode 100644 index 0000000..94b3065 --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_types_generic.h @@ -0,0 +1,1401 @@ +/* + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef __ESP_WIFI_TYPES_H__ +#define __ESP_WIFI_TYPES_H__ + +#include +#include +#include "sdkconfig.h" +#include "esp_event_base.h" +#include "esp_interface.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Wi-Fi mode type + */ +typedef enum { + WIFI_MODE_NULL = 0, /**< Null mode */ + WIFI_MODE_STA, /**< Wi-Fi station mode */ + WIFI_MODE_AP, /**< Wi-Fi soft-AP mode */ + WIFI_MODE_APSTA, /**< Wi-Fi station + soft-AP mode */ + WIFI_MODE_NAN, /**< Wi-Fi NAN mode */ + WIFI_MODE_MAX +} wifi_mode_t; + +/** + * @brief Wi-Fi interface type + */ +typedef enum { + WIFI_IF_STA = ESP_IF_WIFI_STA, /**< Station interface */ + WIFI_IF_AP = ESP_IF_WIFI_AP, /**< Soft-AP interface */ +#if CONFIG_SLAVE_SOC_WIFI_NAN_SUPPORT || !CONFIG_SLAVE_SOC_WIFI_ENABLED + WIFI_IF_NAN = ESP_IF_WIFI_NAN, /**< NAN interface */ +#endif + WIFI_IF_MAX /**< Maximum number of interfaces */ +} wifi_interface_t; + +#define WIFI_OFFCHAN_TX_REQ 1 /**< Request off-channel transmission */ +#define WIFI_OFFCHAN_TX_CANCEL 0 /**< Cancel off-channel transmission */ + +#define WIFI_ROC_REQ 1 /**< Request remain on channel */ +#define WIFI_ROC_CANCEL 0 /**< Cancel remain on channel */ + +/** + * @brief Wi-Fi country policy + */ +typedef enum { + WIFI_COUNTRY_POLICY_AUTO, /**< Country policy is auto, use the country info of AP to which the station is connected */ + WIFI_COUNTRY_POLICY_MANUAL, /**< Country policy is manual, always use the configured country info */ +} wifi_country_policy_t; + +/** + * @brief Structure describing Wi-Fi country-based regional restrictions. + */ +typedef struct { + char cc[3]; /**< Country code string */ + uint8_t schan; /**< Start channel of the allowed 2.4GHz Wi-Fi channels */ + uint8_t nchan; /**< Total channel number of the allowed 2.4GHz Wi-Fi channels */ + int8_t max_tx_power; /**< This field is used for getting Wi-Fi maximum transmitting power, call esp_wifi_set_max_tx_power to set the maximum transmitting power. */ + wifi_country_policy_t policy; /**< Country policy */ +#if CONFIG_SLAVE_SOC_WIFI_SUPPORT_5G + uint32_t wifi_5g_channel_mask; /**< A bitmask representing the allowed 5GHz Wi-Fi channels. + Each bit in the mask corresponds to a specific channel as wifi_5g_channel_bit_t shown. + Bitmask set to 0 indicates 5GHz channels are allowed according to local regulatory rules. + Please note that configured bitmask takes effect only when policy is manual. */ +#endif +} wifi_country_t; + +/** + * @brief Wi-Fi authmode type + * Strength of authmodes + * Personal Networks : OPEN < WEP < WPA_PSK < OWE < WPA2_PSK = WPA_WPA2_PSK < WAPI_PSK < WPA3_PSK = WPA2_WPA3_PSK = DPP + * Enterprise Networks : WIFI_AUTH_WPA2_ENTERPRISE < WIFI_AUTH_WPA3_ENTERPRISE = WIFI_AUTH_WPA2_WPA3_ENTERPRISE < WIFI_AUTH_WPA3_ENT_192 + */ +typedef enum { + WIFI_AUTH_OPEN = 0, /**< Authenticate mode : open */ + WIFI_AUTH_WEP, /**< Authenticate mode : WEP */ + WIFI_AUTH_WPA_PSK, /**< Authenticate mode : WPA_PSK */ + WIFI_AUTH_WPA2_PSK, /**< Authenticate mode : WPA2_PSK */ + WIFI_AUTH_WPA_WPA2_PSK, /**< Authenticate mode : WPA_WPA2_PSK */ + WIFI_AUTH_ENTERPRISE, /**< Authenticate mode : Wi-Fi EAP security */ + WIFI_AUTH_WPA2_ENTERPRISE = WIFI_AUTH_ENTERPRISE, /**< Authenticate mode : Wi-Fi EAP security */ + WIFI_AUTH_WPA3_PSK, /**< Authenticate mode : WPA3_PSK */ + WIFI_AUTH_WPA2_WPA3_PSK, /**< Authenticate mode : WPA2_WPA3_PSK */ + WIFI_AUTH_WAPI_PSK, /**< Authenticate mode : WAPI_PSK */ + WIFI_AUTH_OWE, /**< Authenticate mode : OWE */ + WIFI_AUTH_WPA3_ENT_192, /**< Authenticate mode : WPA3_ENT_SUITE_B_192_BIT */ + WIFI_AUTH_WPA3_EXT_PSK, /**< This authentication mode will yield same result as WIFI_AUTH_WPA3_PSK and not recommended to be used. It will be deprecated in future, please use WIFI_AUTH_WPA3_PSK instead. */ + WIFI_AUTH_WPA3_EXT_PSK_MIXED_MODE, /**< This authentication mode will yield same result as WIFI_AUTH_WPA3_PSK and not recommended to be used. It will be deprecated in future, please use WIFI_AUTH_WPA3_PSK instead.*/ + WIFI_AUTH_DPP, /**< Authenticate mode : DPP */ + WIFI_AUTH_WPA3_ENTERPRISE, /**< Authenticate mode : WPA3-Enterprise Only Mode */ + WIFI_AUTH_WPA2_WPA3_ENTERPRISE, /**< Authenticate mode : WPA3-Enterprise Transition Mode */ + WIFI_AUTH_MAX +} wifi_auth_mode_t; + +/** + * @brief Wi-Fi disconnection reason codes + * + * These reason codes are used to indicate the cause of disconnection. + */ +typedef enum { + WIFI_REASON_UNSPECIFIED = 1, /**< Unspecified reason */ + WIFI_REASON_AUTH_EXPIRE = 2, /**< Authentication expired */ + WIFI_REASON_AUTH_LEAVE = 3, /**< Deauthentication due to leaving */ + WIFI_REASON_ASSOC_EXPIRE = 4, /**< Deprecated, will be removed in next IDF major release */ + WIFI_REASON_DISASSOC_DUE_TO_INACTIVITY = 4, /**< Disassociated due to inactivity */ + WIFI_REASON_ASSOC_TOOMANY = 5, /**< Too many associated stations */ + WIFI_REASON_NOT_AUTHED = 6, /**< Deprecated, will be removed in next IDF major release */ + WIFI_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6, /**< Class 2 frame received from nonauthenticated STA */ + WIFI_REASON_NOT_ASSOCED = 7, /**< Deprecated, will be removed in next IDF major release */ + WIFI_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7, /**< Class 3 frame received from nonassociated STA */ + WIFI_REASON_ASSOC_LEAVE = 8, /**< Deassociated due to leaving */ + WIFI_REASON_ASSOC_NOT_AUTHED = 9, /**< Association but not authenticated */ + WIFI_REASON_DISASSOC_PWRCAP_BAD = 10, /**< Disassociated due to poor power capability */ + WIFI_REASON_DISASSOC_SUPCHAN_BAD = 11, /**< Disassociated due to unsupported channel */ + WIFI_REASON_BSS_TRANSITION_DISASSOC = 12, /**< Disassociated due to BSS transition */ + WIFI_REASON_IE_INVALID = 13, /**< Invalid Information Element (IE) */ + WIFI_REASON_MIC_FAILURE = 14, /**< MIC failure */ + WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT = 15, /**< 4-way handshake timeout */ + WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT = 16, /**< Group key update timeout */ + WIFI_REASON_IE_IN_4WAY_DIFFERS = 17, /**< IE differs in 4-way handshake */ + WIFI_REASON_GROUP_CIPHER_INVALID = 18, /**< Invalid group cipher */ + WIFI_REASON_PAIRWISE_CIPHER_INVALID = 19, /**< Invalid pairwise cipher */ + WIFI_REASON_AKMP_INVALID = 20, /**< Invalid AKMP */ + WIFI_REASON_UNSUPP_RSN_IE_VERSION = 21, /**< Unsupported RSN IE version */ + WIFI_REASON_INVALID_RSN_IE_CAP = 22, /**< Invalid RSN IE capabilities */ + WIFI_REASON_802_1X_AUTH_FAILED = 23, /**< 802.1X authentication failed */ + WIFI_REASON_CIPHER_SUITE_REJECTED = 24, /**< Cipher suite rejected */ + WIFI_REASON_TDLS_PEER_UNREACHABLE = 25, /**< TDLS peer unreachable */ + WIFI_REASON_TDLS_UNSPECIFIED = 26, /**< TDLS unspecified */ + WIFI_REASON_SSP_REQUESTED_DISASSOC = 27, /**< SSP requested disassociation */ + WIFI_REASON_NO_SSP_ROAMING_AGREEMENT = 28, /**< No SSP roaming agreement */ + WIFI_REASON_BAD_CIPHER_OR_AKM = 29, /**< Bad cipher or AKM */ + WIFI_REASON_NOT_AUTHORIZED_THIS_LOCATION = 30, /**< Not authorized in this location */ + WIFI_REASON_SERVICE_CHANGE_PERCLUDES_TS = 31, /**< Service change precludes TS */ + WIFI_REASON_UNSPECIFIED_QOS = 32, /**< Unspecified QoS reason */ + WIFI_REASON_NOT_ENOUGH_BANDWIDTH = 33, /**< Not enough bandwidth */ + WIFI_REASON_MISSING_ACKS = 34, /**< Missing ACKs */ + WIFI_REASON_EXCEEDED_TXOP = 35, /**< Exceeded TXOP */ + WIFI_REASON_STA_LEAVING = 36, /**< Station leaving */ + WIFI_REASON_END_BA = 37, /**< End of Block Ack (BA) */ + WIFI_REASON_UNKNOWN_BA = 38, /**< Unknown Block Ack (BA) */ + WIFI_REASON_TIMEOUT = 39, /**< Timeout */ + WIFI_REASON_PEER_INITIATED = 46, /**< Peer initiated disassociation */ + WIFI_REASON_AP_INITIATED = 47, /**< AP initiated disassociation */ + WIFI_REASON_INVALID_FT_ACTION_FRAME_COUNT = 48, /**< Invalid FT action frame count */ + WIFI_REASON_INVALID_PMKID = 49, /**< Invalid PMKID */ + WIFI_REASON_INVALID_MDE = 50, /**< Invalid MDE */ + WIFI_REASON_INVALID_FTE = 51, /**< Invalid FTE */ + WIFI_REASON_TRANSMISSION_LINK_ESTABLISH_FAILED = 67, /**< Transmission link establishment failed */ + WIFI_REASON_ALTERATIVE_CHANNEL_OCCUPIED = 68, /**< Alternative channel occupied */ + + WIFI_REASON_BEACON_TIMEOUT = 200, /**< Beacon timeout */ + WIFI_REASON_NO_AP_FOUND = 201, /**< No AP found */ + WIFI_REASON_AUTH_FAIL = 202, /**< Authentication failed */ + WIFI_REASON_ASSOC_FAIL = 203, /**< Association failed */ + WIFI_REASON_HANDSHAKE_TIMEOUT = 204, /**< Handshake timeout */ + WIFI_REASON_CONNECTION_FAIL = 205, /**< Connection failed */ + WIFI_REASON_AP_TSF_RESET = 206, /**< AP TSF reset */ + WIFI_REASON_ROAMING = 207, /**< Roaming */ + WIFI_REASON_ASSOC_COMEBACK_TIME_TOO_LONG = 208, /**< Association comeback time too long */ + WIFI_REASON_SA_QUERY_TIMEOUT = 209, /**< SA query timeout */ + WIFI_REASON_NO_AP_FOUND_W_COMPATIBLE_SECURITY = 210, /**< No AP found with compatible security */ + WIFI_REASON_NO_AP_FOUND_IN_AUTHMODE_THRESHOLD = 211, /**< No AP found in auth mode threshold */ + WIFI_REASON_NO_AP_FOUND_IN_RSSI_THRESHOLD = 212, /**< No AP found in RSSI threshold */ +} wifi_err_reason_t; + +/** + * @brief Wi-Fi second channel type + */ +typedef enum { + WIFI_SECOND_CHAN_NONE = 0, /**< The channel width is HT20 */ + WIFI_SECOND_CHAN_ABOVE, /**< The channel width is HT40 and the secondary channel is above the primary channel */ + WIFI_SECOND_CHAN_BELOW, /**< The channel width is HT40 and the secondary channel is below the primary channel */ +} wifi_second_chan_t; + +#define WIFI_ACTIVE_SCAN_MIN_DEFAULT_TIME 0 /**< Default minimum active scan time per channel */ +#define WIFI_ACTIVE_SCAN_MAX_DEFAULT_TIME 120 /**< Default maximum active scan time per channel */ +#define WIFI_PASSIVE_SCAN_DEFAULT_TIME 360 /**< Default passive scan time per channel */ +#define WIFI_SCAN_HOME_CHANNEL_DWELL_DEFAULT_TIME 30 /**< Default time spent at home channel between scanning consecutive channels */ + +#define WIFI_SCAN_PARAMS_DEFAULT_CONFIG() { \ + .scan_time.active.min = WIFI_ACTIVE_SCAN_MIN_DEFAULT_TIME, \ + .scan_time.active.max = WIFI_ACTIVE_SCAN_MAX_DEFAULT_TIME, \ + .scan_time.passive = WIFI_PASSIVE_SCAN_DEFAULT_TIME, \ + .home_chan_dwell_time = WIFI_SCAN_HOME_CHANNEL_DWELL_DEFAULT_TIME\ +} + +/** + * @brief Wi-Fi scan type + */ +typedef enum { + WIFI_SCAN_TYPE_ACTIVE = 0, /**< Active scan */ + WIFI_SCAN_TYPE_PASSIVE, /**< Passive scan */ +} wifi_scan_type_t; + +/** + * @brief Range of active scan times per channel + */ +typedef struct { + uint32_t min; /**< Minimum active scan time per channel, units: millisecond */ + uint32_t max; /**< Maximum active scan time per channel, units: millisecond, values above 1500 ms may + cause station to disconnect from AP and are not recommended. */ +} wifi_active_scan_time_t; + +/** + * @brief Aggregate of active & passive scan time per channel + */ +typedef struct { + wifi_active_scan_time_t active; /**< Active scan time per channel, units: millisecond. */ + uint32_t passive; /**< Passive scan time per channel, units: millisecond, values above 1500 ms may + cause station to disconnect from AP and are not recommended. */ +} wifi_scan_time_t; + +/** + * @brief Channel bitmap for setting specific channels to be scanned + */ +typedef struct { + uint16_t ghz_2_channels; /**< Represents 2.4 GHz channels, that bits can be set as wifi_2g_channel_bit_t shown. */ + uint32_t ghz_5_channels; /**< Represents 5 GHz channels, that bits can be set as wifi_5g_channel_bit_t shown. */ +} wifi_scan_channel_bitmap_t; + +/** + * @brief Parameters for an SSID scan + */ +typedef struct { + uint8_t *ssid; /**< SSID of AP */ + uint8_t *bssid; /**< MAC address of AP */ + uint8_t channel; /**< Channel, scan the specific channel */ + bool show_hidden; /**< Enable it to scan AP whose SSID is hidden */ + wifi_scan_type_t scan_type; /**< Scan type, active or passive */ + wifi_scan_time_t scan_time; /**< Scan time per channel */ + uint8_t home_chan_dwell_time; /**< Time spent at home channel between scanning consecutive channels. */ + wifi_scan_channel_bitmap_t channel_bitmap; /**< Channel bitmap for setting specific channels to be scanned. + Please note that the 'channel' parameter above needs to be set to 0 to allow scanning by bitmap. + Also, note that only allowed channels configured by wifi_country_t can be scanned. */ +} wifi_scan_config_t; + +/** + * @brief Parameters default scan configurations + */ +typedef struct { + wifi_scan_time_t scan_time; /**< Scan time per channel */ + uint8_t home_chan_dwell_time;/**< Time spent at home channel between scanning consecutive channels.*/ +} wifi_scan_default_params_t; + +/** + * @brief Wi-Fi cipher type + */ +typedef enum { + WIFI_CIPHER_TYPE_NONE = 0, /**< The cipher type is none */ + WIFI_CIPHER_TYPE_WEP40, /**< The cipher type is WEP40 */ + WIFI_CIPHER_TYPE_WEP104, /**< The cipher type is WEP104 */ + WIFI_CIPHER_TYPE_TKIP, /**< The cipher type is TKIP */ + WIFI_CIPHER_TYPE_CCMP, /**< The cipher type is CCMP */ + WIFI_CIPHER_TYPE_TKIP_CCMP, /**< The cipher type is TKIP and CCMP */ + WIFI_CIPHER_TYPE_AES_CMAC128,/**< The cipher type is AES-CMAC-128 */ + WIFI_CIPHER_TYPE_SMS4, /**< The cipher type is SMS4 */ + WIFI_CIPHER_TYPE_GCMP, /**< The cipher type is GCMP */ + WIFI_CIPHER_TYPE_GCMP256, /**< The cipher type is GCMP-256 */ + WIFI_CIPHER_TYPE_AES_GMAC128,/**< The cipher type is AES-GMAC-128 */ + WIFI_CIPHER_TYPE_AES_GMAC256,/**< The cipher type is AES-GMAC-256 */ + WIFI_CIPHER_TYPE_UNKNOWN, /**< The cipher type is unknown */ +} wifi_cipher_type_t; + +/** + * @brief Wi-Fi bandwidth type + */ +typedef enum { + WIFI_BW_HT20 = 1, /**< Bandwidth is HT20 */ + WIFI_BW20 = WIFI_BW_HT20, /**< Bandwidth is 20 MHz */ + WIFI_BW_HT40 = 2, /**< Bandwidth is HT40 */ + WIFI_BW40 = WIFI_BW_HT40, /**< Bandwidth is 40 MHz */ + WIFI_BW80 = 3, /**< Bandwidth is 80 MHz */ + WIFI_BW160 = 4, /**< Bandwidth is 160 MHz */ + WIFI_BW80_BW80 = 5, /**< Bandwidth is 80 + 80 MHz */ +} wifi_bandwidth_t; + +/** + * @brief Wi-Fi antenna + */ +typedef enum { + WIFI_ANT_ANT0, /**< Wi-Fi antenna 0 */ + WIFI_ANT_ANT1, /**< Wi-Fi antenna 1 */ + WIFI_ANT_MAX, /**< Invalid Wi-Fi antenna */ +} wifi_ant_t; + +/** + * @brief Description of a Wi-Fi AP HE Info + */ +typedef struct { + uint8_t bss_color: 6; /**< The BSS Color value associated with the AP's corresponding BSS */ + uint8_t partial_bss_color: 1; /**< Indicates whether an AID assignment rule is based on the BSS color */ + uint8_t bss_color_disabled: 1; /**< Indicates whether the BSS color usage is disabled */ + uint8_t bssid_index; /**< In a M-BSSID set, identifies the non-transmitted BSSID */ +} wifi_he_ap_info_t; + +/** + * @brief Description of a Wi-Fi AP + */ +typedef struct { + uint8_t bssid[6]; /**< MAC address of AP */ + uint8_t ssid[33]; /**< SSID of AP */ + uint8_t primary; /**< Channel of AP */ + wifi_second_chan_t second; /**< Secondary channel of AP */ + int8_t rssi; /**< Signal strength of AP. Note that in some rare cases where signal strength is very strong, RSSI values can be slightly positive */ + wifi_auth_mode_t authmode; /**< Auth mode of AP */ + wifi_cipher_type_t pairwise_cipher; /**< Pairwise cipher of AP */ + wifi_cipher_type_t group_cipher; /**< Group cipher of AP */ + wifi_ant_t ant; /**< Antenna used to receive beacon from AP */ + uint32_t phy_11b: 1; /**< Bit: 0 flag to identify if 11b mode is enabled or not */ + uint32_t phy_11g: 1; /**< Bit: 1 flag to identify if 11g mode is enabled or not */ + uint32_t phy_11n: 1; /**< Bit: 2 flag to identify if 11n mode is enabled or not */ + uint32_t phy_lr: 1; /**< Bit: 3 flag to identify if low rate is enabled or not */ + uint32_t phy_11a: 1; /**< Bit: 4 flag to identify if 11ax mode is enabled or not */ + uint32_t phy_11ac: 1; /**< Bit: 5 flag to identify if 11ax mode is enabled or not */ + uint32_t phy_11ax: 1; /**< Bit: 6 flag to identify if 11ax mode is enabled or not */ + uint32_t wps: 1; /**< Bit: 7 flag to identify if WPS is supported or not */ + uint32_t ftm_responder: 1; /**< Bit: 8 flag to identify if FTM is supported in responder mode */ + uint32_t ftm_initiator: 1; /**< Bit: 9 flag to identify if FTM is supported in initiator mode */ + uint32_t reserved: 22; /**< Bit: 10..31 reserved */ + wifi_country_t country; /**< Country information of AP */ + wifi_he_ap_info_t he_ap; /**< HE AP info */ + wifi_bandwidth_t bandwidth; /**< Bandwidth of AP */ + uint8_t vht_ch_freq1; /**< This fields are used only AP bandwidth is 80 and 160 MHz, to transmit the center channel + frequency of the BSS. For AP bandwidth is 80 + 80 MHz, it is the center channel frequency + of the lower frequency segment.*/ + uint8_t vht_ch_freq2; /**< this fields are used only AP bandwidth is 80 + 80 MHz, and is used to transmit the center + channel frequency of the second segment. */ +} wifi_ap_record_t; + +/** + * @brief Wi-Fi scan method + */ +typedef enum { + WIFI_FAST_SCAN = 0, /**< Do fast scan, scan will end after find SSID match AP */ + WIFI_ALL_CHANNEL_SCAN, /**< All channel scan, scan will end after scan all the channel */ +} wifi_scan_method_t; + +/** + * @brief Wi-Fi sort AP method + */ +typedef enum { + WIFI_CONNECT_AP_BY_SIGNAL = 0, /**< Sort match AP in scan list by RSSI */ + WIFI_CONNECT_AP_BY_SECURITY, /**< Sort match AP in scan list by security mode */ +} wifi_sort_method_t; + +/** + * @brief Structure describing parameters for a Wi-Fi fast scan + */ +typedef struct { + int8_t rssi; /**< The minimum rssi to accept in the fast scan mode. Defaults to -127 if set to >= 0 */ + wifi_auth_mode_t authmode; /**< The weakest auth mode to accept in the fast scan mode + Note: In case this value is not set and password is set as per WPA2 standards(password len >= 8), it will be defaulted to WPA2 and device won't connect to deprecated WEP/WPA networks. Please set auth mode threshold as WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK to connect to WEP/WPA networks */ + uint8_t rssi_5g_adjustment; /**< The RSSI value of the 5G AP is within the rssi_5g_adjustment range compared to the 2G AP, the 5G AP will be given priority for connection. */ +} wifi_scan_threshold_t; + +/** + * @brief Wi-Fi power save type + */ +typedef enum { + WIFI_PS_NONE, /**< No power save */ + WIFI_PS_MIN_MODEM, /**< Minimum modem power saving. In this mode, station wakes up to receive beacon every DTIM period */ + WIFI_PS_MAX_MODEM, /**< Maximum modem power saving. In this mode, interval to receive beacons is determined by the listen_interval parameter in wifi_sta_config_t */ +} wifi_ps_type_t; + +/** + * @brief Argument structure for Wi-Fi band + */ +typedef enum { + WIFI_BAND_2G = 1, /**< Band is 2.4 GHz */ + WIFI_BAND_5G = 2, /**< Band is 5 GHz */ +} wifi_band_t; + +/** + * @brief Argument structure for Wi-Fi band mode + */ +typedef enum { + WIFI_BAND_MODE_2G_ONLY = 1, /**< Wi-Fi band mode is 2.4 GHz only */ + WIFI_BAND_MODE_5G_ONLY = 2, /**< Wi-Fi band mode is 5 GHz only */ + WIFI_BAND_MODE_AUTO = 3, /**< Wi-Fi band mode is 2.4 GHz + 5 GHz */ +} wifi_band_mode_t; + +#ifndef BIT +#define BIT(nr) (1 << (nr)) +#endif + +#define CHANNEL_TO_BIT_NUMBER(channel) ((channel >= 1 && channel <= 14) ? (channel) : \ + ((channel >= 36 && channel <= 64 && (channel - 36) % 4 == 0) ? ((channel - 36) / 4 + 1) : \ + ((channel >= 100 && channel <= 144 && (channel - 100) % 4 == 0) ? ((channel - 100) / 4 + 9) : \ + ((channel >= 149 && channel <= 177 && (channel - 149) % 4 == 0) ? ((channel - 149) / 4 + 21) : 0)))) + +#define BIT_NUMBER_TO_CHANNEL(bit_number, band) ((band == WIFI_BAND_2G) ? (bit_number) : \ + ((bit_number >= 1 && bit_number <= 8) ? ((bit_number - 1) * 4 + 36) : \ + ((bit_number >= 9 && bit_number <= 20) ? ((bit_number - 9) * 4 + 100) : \ + ((bit_number >= 21 && bit_number <= 28) ? ((bit_number - 21) * 4 + 149) : 0)))) + +#define CHANNEL_TO_BIT(channel) (BIT(CHANNEL_TO_BIT_NUMBER(channel))) + +/** Argument structure for 2.4G channels */ +typedef enum { + WIFI_CHANNEL_1 = BIT(1), /**< Wi-Fi channel 1 */ + WIFI_CHANNEL_2 = BIT(2), /**< Wi-Fi channel 2 */ + WIFI_CHANNEL_3 = BIT(3), /**< Wi-Fi channel 3 */ + WIFI_CHANNEL_4 = BIT(4), /**< Wi-Fi channel 4 */ + WIFI_CHANNEL_5 = BIT(5), /**< Wi-Fi channel 5 */ + WIFI_CHANNEL_6 = BIT(6), /**< Wi-Fi channel 6 */ + WIFI_CHANNEL_7 = BIT(7), /**< Wi-Fi channel 7 */ + WIFI_CHANNEL_8 = BIT(8), /**< Wi-Fi channel 8 */ + WIFI_CHANNEL_9 = BIT(9), /**< Wi-Fi channel 9 */ + WIFI_CHANNEL_10 = BIT(10), /**< Wi-Fi channel 10 */ + WIFI_CHANNEL_11 = BIT(11), /**< Wi-Fi channel 11 */ + WIFI_CHANNEL_12 = BIT(12), /**< Wi-Fi channel 12 */ + WIFI_CHANNEL_13 = BIT(13), /**< Wi-Fi channel 13 */ + WIFI_CHANNEL_14 = BIT(14), /**< Wi-Fi channel 14 */ +} wifi_2g_channel_bit_t; + +/** Argument structure for 5G channels */ +typedef enum { + WIFI_CHANNEL_36 = BIT(1), /**< Wi-Fi channel 36 */ + WIFI_CHANNEL_40 = BIT(2), /**< Wi-Fi channel 40 */ + WIFI_CHANNEL_44 = BIT(3), /**< Wi-Fi channel 44 */ + WIFI_CHANNEL_48 = BIT(4), /**< Wi-Fi channel 48 */ + WIFI_CHANNEL_52 = BIT(5), /**< Wi-Fi channel 52 */ + WIFI_CHANNEL_56 = BIT(6), /**< Wi-Fi channel 56 */ + WIFI_CHANNEL_60 = BIT(7), /**< Wi-Fi channel 60 */ + WIFI_CHANNEL_64 = BIT(8), /**< Wi-Fi channel 64 */ + WIFI_CHANNEL_100 = BIT(9), /**< Wi-Fi channel 100 */ + WIFI_CHANNEL_104 = BIT(10), /**< Wi-Fi channel 104 */ + WIFI_CHANNEL_108 = BIT(11), /**< Wi-Fi channel 108 */ + WIFI_CHANNEL_112 = BIT(12), /**< Wi-Fi channel 112 */ + WIFI_CHANNEL_116 = BIT(13), /**< Wi-Fi channel 116 */ + WIFI_CHANNEL_120 = BIT(14), /**< Wi-Fi channel 120 */ + WIFI_CHANNEL_124 = BIT(15), /**< Wi-Fi channel 124 */ + WIFI_CHANNEL_128 = BIT(16), /**< Wi-Fi channel 128 */ + WIFI_CHANNEL_132 = BIT(17), /**< Wi-Fi channel 132 */ + WIFI_CHANNEL_136 = BIT(18), /**< Wi-Fi channel 136 */ + WIFI_CHANNEL_140 = BIT(19), /**< Wi-Fi channel 140 */ + WIFI_CHANNEL_144 = BIT(20), /**< Wi-Fi channel 144 */ + WIFI_CHANNEL_149 = BIT(21), /**< Wi-Fi channel 149 */ + WIFI_CHANNEL_153 = BIT(22), /**< Wi-Fi channel 153 */ + WIFI_CHANNEL_157 = BIT(23), /**< Wi-Fi channel 157 */ + WIFI_CHANNEL_161 = BIT(24), /**< Wi-Fi channel 161 */ + WIFI_CHANNEL_165 = BIT(25), /**< Wi-Fi channel 165 */ + WIFI_CHANNEL_169 = BIT(26), /**< Wi-Fi channel 169 */ + WIFI_CHANNEL_173 = BIT(27), /**< Wi-Fi channel 173 */ + WIFI_CHANNEL_177 = BIT(28), /**< Wi-Fi channel 177 */ +} wifi_5g_channel_bit_t; + +#define WIFI_PROTOCOL_11B 0x1 /**< 802.11b protocol */ +#define WIFI_PROTOCOL_11G 0x2 /**< 802.11g protocol */ +#define WIFI_PROTOCOL_11N 0x4 /**< 802.11n protocol */ +#define WIFI_PROTOCOL_LR 0x8 /**< Low Rate protocol */ +#define WIFI_PROTOCOL_11A 0x10 /**< 802.11a protocol */ +#define WIFI_PROTOCOL_11AC 0x20 /**< 802.11ac protocol */ +#define WIFI_PROTOCOL_11AX 0x40 /**< 802.11ax protocol */ + +/** + * @brief Description of a Wi-Fi protocols + */ +typedef struct { + uint16_t ghz_2g; /**< Represents 2.4 GHz protocol, support 802.11b or 802.11g or 802.11n or 802.11ax or LR mode */ + uint16_t ghz_5g; /**< Represents 5 GHz protocol, support 802.11a or 802.11n or 802.11ac or 802.11ax */ +} wifi_protocols_t; + +/** + * @brief Description of a Wi-Fi band bandwidths + */ +typedef struct { + wifi_bandwidth_t ghz_2g; /**< Represents 2.4 GHz bandwidth */ + wifi_bandwidth_t ghz_5g; /**< Represents 5 GHz bandwidth */ +} wifi_bandwidths_t; + +/** + * @brief Configuration structure for Protected Management Frame + */ +typedef struct { + bool capable; /**< Deprecated variable. Device will always connect in PMF mode if other device also advertises PMF capability. */ + bool required; /**< Advertises that Protected Management Frame is required. Device will not associate to non-PMF capable devices. */ +} wifi_pmf_config_t; + +/** + * @brief Configuration for SAE PWE derivation + */ +typedef enum { + WPA3_SAE_PWE_UNSPECIFIED, + WPA3_SAE_PWE_HUNT_AND_PECK, + WPA3_SAE_PWE_HASH_TO_ELEMENT, + WPA3_SAE_PWE_BOTH, +} wifi_sae_pwe_method_t; + +/** + * @brief Configuration for SAE-PK + */ +typedef enum { + WPA3_SAE_PK_MODE_AUTOMATIC = 0, + WPA3_SAE_PK_MODE_ONLY = 1, + WPA3_SAE_PK_MODE_DISABLED = 2, +} wifi_sae_pk_mode_t; + +/** + * @brief Soft-AP configuration settings for the device + */ +typedef struct { + uint8_t ssid[32]; /**< SSID of soft-AP. If ssid_len field is 0, this must be a Null terminated string. Otherwise, length is set according to ssid_len. */ + uint8_t password[64]; /**< Password of soft-AP. */ + uint8_t ssid_len; /**< Optional length of SSID field. */ + uint8_t channel; /**< Channel of soft-AP */ + wifi_auth_mode_t authmode; /**< Auth mode of soft-AP. Do not support AUTH_WEP, AUTH_WAPI_PSK and AUTH_OWE in soft-AP mode. When the auth mode is set to WPA2_PSK, WPA2_WPA3_PSK or WPA3_PSK, the pairwise cipher will be overwritten with WIFI_CIPHER_TYPE_CCMP. */ + uint8_t ssid_hidden; /**< Broadcast SSID or not, default 0, broadcast the SSID */ + uint8_t max_connection; /**< Max number of stations allowed to connect in */ + uint16_t beacon_interval; /**< Beacon interval which should be multiples of 100. Unit: TU(time unit, 1 TU = 1024 us). Range: 100 ~ 60000. Default value: 100 */ + uint8_t csa_count; /**< Channel Switch Announcement Count. Notify the station that the channel will switch after the csa_count beacon intervals. Default value: 3 */ + uint8_t dtim_period; /**< Dtim period of soft-AP. Range: 1 ~ 10. Default value: 1 */ + wifi_cipher_type_t pairwise_cipher; /**< Pairwise cipher of SoftAP, group cipher will be derived using this. Cipher values are valid starting from WIFI_CIPHER_TYPE_TKIP, enum values before that will be considered as invalid and default cipher suites(TKIP+CCMP) will be used. Valid cipher suites in softAP mode are WIFI_CIPHER_TYPE_TKIP, WIFI_CIPHER_TYPE_CCMP and WIFI_CIPHER_TYPE_TKIP_CCMP. */ + bool ftm_responder; /**< Enable FTM Responder mode */ + wifi_pmf_config_t pmf_cfg; /**< Configuration for Protected Management Frame */ + wifi_sae_pwe_method_t sae_pwe_h2e; /**< Configuration for SAE PWE derivation method */ + uint8_t transition_disable; /**< Whether to enable transition disable feature */ +} wifi_ap_config_t; + +#define SAE_H2E_IDENTIFIER_LEN 32 /**< Length of the password identifier for H2E */ + +/** + * @brief STA configuration settings for the device + */ +typedef struct { + uint8_t ssid[32]; /**< SSID of target AP. */ + uint8_t password[64]; /**< Password of target AP. */ + wifi_scan_method_t scan_method; /**< Do all channel scan or fast scan */ + bool bssid_set; /**< Whether set MAC address of target AP or not. Generally, station_config.bssid_set needs to be 0; and it needs to be 1 only when users need to check the MAC address of the AP.*/ + uint8_t bssid[6]; /**< MAC address of target AP*/ + uint8_t channel; /**< Channel hint for target AP. For 2.4G AP, set to 1~13 to scan starting from the specified channel before connecting to AP. For 5G AP, set to 36~177 (36, 40, 44 ... 177) to scan starting from the specified channel before connecting to AP. Set to 0 for no preference */ + uint16_t listen_interval; /**< Listen interval for ESP32 station to receive beacon when WIFI_PS_MAX_MODEM is set. Units: AP beacon intervals. Defaults to 3 if set to 0. */ + wifi_sort_method_t sort_method; /**< Sort the connect AP in the list by rssi or security mode */ + wifi_scan_threshold_t threshold; /**< When scan_threshold is set, only APs which have an auth mode that is more secure than the selected auth mode and a signal stronger than the minimum RSSI will be used. */ + wifi_pmf_config_t pmf_cfg; /**< Configuration for Protected Management Frame. Will be advertised in RSN Capabilities in RSN IE. */ + uint32_t rm_enabled: 1; /**< Whether Radio Measurements are enabled for the connection */ + uint32_t btm_enabled: 1; /**< Whether BSS Transition Management is enabled for the connection. Note that when btm is enabled, the application itself should not set specific bssid (i.e using bssid_set and bssid in this config)or channel to connect to. This defeats the purpose of a BTM supported network, and hence if btm is supported and a specific bssid or channel is set in this config, it will be cleared from the config at the first disconnection or connection so that the device can roam to other BSS. It is recommended not to set BSSID when BTM is enabled. */ + uint32_t mbo_enabled: 1; /**< Whether MBO is enabled for the connection. Note that when mbo is enabled, the application itself should not set specific bssid (i.e using bssid_set and bssid in this config)or channel to connect to. This defeats the purpose of a MBO supported network, and hence if btm is supported and a specific bssid or channel is set in this config, it will be cleared from the config at the first disconnection or connection so that the device can roam to other BSS. It is recommended not to set BSSID when MBO is enabled. Enabling mbo here, automatically enables btm and rm above.*/ + uint32_t ft_enabled: 1; /**< Whether FT is enabled for the connection */ + uint32_t owe_enabled: 1; /**< Whether OWE is enabled for the connection */ + uint32_t transition_disable: 1; /**< Whether to enable transition disable feature */ + uint32_t reserved: 26; /**< Reserved for future feature set */ + wifi_sae_pwe_method_t sae_pwe_h2e; /**< Configuration for SAE PWE derivation method */ + wifi_sae_pk_mode_t sae_pk_mode; /**< Configuration for SAE-PK (Public Key) Authentication method */ + uint8_t failure_retry_cnt; /**< Number of connection retries station will do before moving to next AP. scan_method should be set as WIFI_ALL_CHANNEL_SCAN to use this config. + Note: Enabling this may cause connection time to increase in case best AP doesn't behave properly. */ + uint32_t he_dcm_set: 1; /**< Whether DCM max.constellation for transmission and reception is set. */ + uint32_t he_dcm_max_constellation_tx: 2; /**< Indicate the max.constellation for DCM in TB PPDU the STA supported. 0: not supported. 1: BPSK, 2: QPSK, 3: 16-QAM. The default value is 3. */ + uint32_t he_dcm_max_constellation_rx: 2; /**< Indicate the max.constellation for DCM in both Data field and HE-SIG-B field the STA supported. 0: not supported. 1: BPSK, 2: QPSK, 3: 16-QAM. The default value is 3. */ + uint32_t he_mcs9_enabled: 1; /**< Whether to support HE-MCS 0 to 9. The default value is 0. */ + uint32_t he_su_beamformee_disabled: 1; /**< Whether to disable support for operation as an SU beamformee. */ + uint32_t he_trig_su_bmforming_feedback_disabled: 1; /**< Whether to disable support the transmission of SU feedback in an HE TB sounding sequence. */ + uint32_t he_trig_mu_bmforming_partial_feedback_disabled: 1; /**< Whether to disable support the transmission of partial-bandwidth MU feedback in an HE TB sounding sequence. */ + uint32_t he_trig_cqi_feedback_disabled: 1; /**< Whether to disable support the transmission of CQI feedback in an HE TB sounding sequence. */ + uint32_t he_reserved: 22; /**< Reserved for future feature set */ + uint8_t sae_h2e_identifier[SAE_H2E_IDENTIFIER_LEN]; /**< Password identifier for H2E. this needs to be null terminated string */ +} wifi_sta_config_t; + +/** + * @brief NAN Discovery start configuration + */ +typedef struct { + uint8_t op_channel; /**< NAN Discovery operating channel */ + uint8_t master_pref; /**< Device's preference value to serve as NAN Master */ + uint8_t scan_time; /**< Scan time in seconds while searching for a NAN cluster */ + uint16_t warm_up_sec; /**< Warm up time before assuming NAN Anchor Master role */ +} wifi_nan_config_t; + +/** + * @brief Configuration data for device's AP or STA or NAN. + * + * The usage of this union (for ap, sta or nan configuration) is determined by the accompanying + * interface argument passed to esp_wifi_set_config() or esp_wifi_get_config() + * + */ +typedef union { + wifi_ap_config_t ap; /**< Configuration of AP */ + wifi_sta_config_t sta; /**< Configuration of STA */ + wifi_nan_config_t nan; /**< Configuration of NAN */ +} wifi_config_t; + +/** + * @brief Description of STA associated with AP + */ +typedef struct { + uint8_t mac[6]; /**< MAC address */ + int8_t rssi; /**< Current average rssi of sta connected */ + uint32_t phy_11b: 1; /**< Bit: 0 flag to identify if 11b mode is enabled or not */ + uint32_t phy_11g: 1; /**< Bit: 1 flag to identify if 11g mode is enabled or not */ + uint32_t phy_11n: 1; /**< Bit: 2 flag to identify if 11n mode is enabled or not */ + uint32_t phy_lr: 1; /**< Bit: 3 flag to identify if low rate is enabled or not */ + uint32_t phy_11a: 1; /**< Bit: 4 flag to identify if 11ax mode is enabled or not */ + uint32_t phy_11ac: 1; /**< Bit: 5 flag to identify if 11ax mode is enabled or not */ + uint32_t phy_11ax: 1; /**< Bit: 6 flag to identify if 11ax mode is enabled or not */ + uint32_t is_mesh_child: 1; /**< Bit: 7 flag to identify mesh child */ + uint32_t reserved: 24; /**< Bit: 8..31 reserved */ +} wifi_sta_info_t; + +/** + * @brief Wi-Fi storage type + */ +typedef enum { + WIFI_STORAGE_FLASH, /**< All configuration will store in both memory and flash */ + WIFI_STORAGE_RAM, /**< All configuration will only store in the memory */ +} wifi_storage_t; + +/** + * @brief Vendor Information Element type + * + * Determines the frame type that the IE will be associated with. + */ +typedef enum { + WIFI_VND_IE_TYPE_BEACON, /**< Beacon frame */ + WIFI_VND_IE_TYPE_PROBE_REQ, /**< Probe request frame */ + WIFI_VND_IE_TYPE_PROBE_RESP, /**< Probe response frame */ + WIFI_VND_IE_TYPE_ASSOC_REQ, /**< Association request frame */ + WIFI_VND_IE_TYPE_ASSOC_RESP, /**< Association response frame */ +} wifi_vendor_ie_type_t; + +/** + * @brief Vendor Information Element index + * + * Each IE type can have up to two associated vendor ID elements. + */ +typedef enum { + WIFI_VND_IE_ID_0, /**< Vendor ID element 0 */ + WIFI_VND_IE_ID_1, /**< Vendor ID element 1 */ +} wifi_vendor_ie_id_t; + +#define WIFI_VENDOR_IE_ELEMENT_ID 0xDD /**< Vendor Information Element ID */ + +/** + * @brief Operation PHY mode + */ +typedef enum { + WIFI_PHY_MODE_LR, /**< PHY mode for Low Rate */ + WIFI_PHY_MODE_11B, /**< PHY mode for 11b */ + WIFI_PHY_MODE_11G, /**< PHY mode for 11g */ + WIFI_PHY_MODE_11A, /**< PHY mode for 11a */ + WIFI_PHY_MODE_HT20, /**< PHY mode for Bandwidth HT20 */ + WIFI_PHY_MODE_HT40, /**< PHY mode for Bandwidth HT40 */ + WIFI_PHY_MODE_HE20, /**< PHY mode for Bandwidth HE20 */ + WIFI_PHY_MODE_VHT20,/**< PHY mode for Bandwidth VHT20 */ +} wifi_phy_mode_t; + +/** + * @brief Vendor Information Element header + * + * The first bytes of the Information Element will match this header. Payload follows. + */ +typedef struct { + uint8_t element_id; /**< Should be set to WIFI_VENDOR_IE_ELEMENT_ID (0xDD) */ + uint8_t length; /**< Length of all bytes in the element data following this field. Minimum 4. */ + uint8_t vendor_oui[3]; /**< Vendor identifier (OUI). */ + uint8_t vendor_oui_type; /**< Vendor-specific OUI type. */ + uint8_t payload[0]; /**< Payload. Length is equal to value in 'length' field, minus 4. */ +} vendor_ie_data_t; + +/** + * @brief Promiscuous frame type + * + * Passed to promiscuous mode RX callback to indicate the type of parameter in the buffer. + * + */ +typedef enum { + WIFI_PKT_MGMT, /**< Management frame, indicates 'buf' argument is wifi_promiscuous_pkt_t */ + WIFI_PKT_CTRL, /**< Control frame, indicates 'buf' argument is wifi_promiscuous_pkt_t */ + WIFI_PKT_DATA, /**< Data frame, indicates 'buf' argument is wifi_promiscuous_pkt_t */ + WIFI_PKT_MISC, /**< Other type, such as MIMO etc. 'buf' argument is wifi_promiscuous_pkt_t but the payload is zero length. */ +} wifi_promiscuous_pkt_type_t; + +#define WIFI_PROMIS_FILTER_MASK_ALL (0xFFFFFFFF) /**< Filter all packets */ +#define WIFI_PROMIS_FILTER_MASK_MGMT (1) /**< Filter the packets with type of WIFI_PKT_MGMT */ +#define WIFI_PROMIS_FILTER_MASK_CTRL (1<<1) /**< Filter the packets with type of WIFI_PKT_CTRL */ +#define WIFI_PROMIS_FILTER_MASK_DATA (1<<2) /**< Filter the packets with type of WIFI_PKT_DATA */ +#define WIFI_PROMIS_FILTER_MASK_MISC (1<<3) /**< Filter the packets with type of WIFI_PKT_MISC */ +#define WIFI_PROMIS_FILTER_MASK_DATA_MPDU (1<<4) /**< Filter the MPDU which is a kind of WIFI_PKT_DATA */ +#define WIFI_PROMIS_FILTER_MASK_DATA_AMPDU (1<<5) /**< Filter the AMPDU which is a kind of WIFI_PKT_DATA */ +#define WIFI_PROMIS_FILTER_MASK_FCSFAIL (1<<6) /**< Filter the FCS failed packets, do not open it in general */ + +#define WIFI_PROMIS_CTRL_FILTER_MASK_ALL (0xFF800000) /**< Filter all control packets */ +#define WIFI_PROMIS_CTRL_FILTER_MASK_WRAPPER (1<<23) /**< Filter the control packets with subtype of Control Wrapper */ +#define WIFI_PROMIS_CTRL_FILTER_MASK_BAR (1<<24) /**< Filter the control packets with subtype of Block Ack Request */ +#define WIFI_PROMIS_CTRL_FILTER_MASK_BA (1<<25) /**< Filter the control packets with subtype of Block Ack */ +#define WIFI_PROMIS_CTRL_FILTER_MASK_PSPOLL (1<<26) /**< Filter the control packets with subtype of PS-Poll */ +#define WIFI_PROMIS_CTRL_FILTER_MASK_RTS (1<<27) /**< Filter the control packets with subtype of RTS */ +#define WIFI_PROMIS_CTRL_FILTER_MASK_CTS (1<<28) /**< Filter the control packets with subtype of CTS */ +#define WIFI_PROMIS_CTRL_FILTER_MASK_ACK (1<<29) /**< Filter the control packets with subtype of ACK */ +#define WIFI_PROMIS_CTRL_FILTER_MASK_CFEND (1<<30) /**< Filter the control packets with subtype of CF-END */ +#define WIFI_PROMIS_CTRL_FILTER_MASK_CFENDACK (1<<31) /**< Filter the control packets with subtype of CF-END+CF-ACK */ + +/** + * @brief Mask for filtering different packet types in promiscuous mode + */ +typedef struct { + uint32_t filter_mask; /**< OR of one or more filter values WIFI_PROMIS_FILTER_* */ +} wifi_promiscuous_filter_t; + +#define WIFI_EVENT_MASK_ALL (0xFFFFFFFF) /**< Mask all Wi-Fi events */ +#define WIFI_EVENT_MASK_NONE (0) /**< Mask none of the Wi-Fi events */ +#define WIFI_EVENT_MASK_AP_PROBEREQRECVED (BIT(0)) /**< Mask SYSTEM_EVENT_AP_PROBEREQRECVED event */ + +/** + * @brief CSI data type + * + */ +typedef struct wifi_csi_info_t wifi_csi_info_t; + +/** + * @brief Wi-Fi GPIO configuration for antenna selection + * + */ +typedef struct { + uint8_t gpio_select: 1, /**< Whether this GPIO is connected to external antenna switch */ + gpio_num: 7; /**< The GPIO number that connects to external antenna switch */ +} wifi_ant_gpio_t; + +/** + * @brief Wi-Fi GPIOs configuration for antenna selection + * + */ +typedef struct { + wifi_ant_gpio_t gpio_cfg[4]; /**< The configurations of GPIOs that connect to external antenna switch */ +} wifi_ant_gpio_config_t; + +/** + * @brief Wi-Fi antenna mode + * + */ +typedef enum { + WIFI_ANT_MODE_ANT0, /**< Enable Wi-Fi antenna 0 only */ + WIFI_ANT_MODE_ANT1, /**< Enable Wi-Fi antenna 1 only */ + WIFI_ANT_MODE_AUTO, /**< Enable Wi-Fi antenna 0 and 1, automatically select an antenna */ + WIFI_ANT_MODE_MAX, /**< Invalid Wi-Fi enabled antenna */ +} wifi_ant_mode_t; + +/** + * @brief Wi-Fi antenna configuration + * + */ +typedef struct { + wifi_ant_mode_t rx_ant_mode; /**< Wi-Fi antenna mode for receiving */ + wifi_ant_t rx_ant_default; /**< Default antenna mode for receiving, it's ignored if rx_ant_mode is not WIFI_ANT_MODE_AUTO */ + wifi_ant_mode_t tx_ant_mode; /**< Wi-Fi antenna mode for transmission, it can be set to WIFI_ANT_MODE_AUTO only if rx_ant_mode is set to WIFI_ANT_MODE_AUTO */ + uint8_t enabled_ant0: 4, /**< Index (in antenna GPIO configuration) of enabled WIFI_ANT_MODE_ANT0 */ + enabled_ant1: 4; /**< Index (in antenna GPIO configuration) of enabled WIFI_ANT_MODE_ANT1 */ +} wifi_ant_config_t; + +/** + * @brief The Rx callback function of Action Tx operations + * + * @param hdr Pointer to the IEEE 802.11 Header structure + * @param payload Pointer to the Payload following 802.11 Header + * @param len Length of the Payload + * @param channel Channel number the frame is received on + * + */ +typedef int (* wifi_action_rx_cb_t)(uint8_t *hdr, uint8_t *payload, + size_t len, uint8_t channel); +/** + * @brief Action Frame Tx Request + */ +typedef struct { + wifi_interface_t ifx; /**< Wi-Fi interface to send request to */ + uint8_t dest_mac[6]; /**< Destination MAC address */ + bool no_ack; /**< Indicates no ack required */ + wifi_action_rx_cb_t rx_cb; /**< Rx Callback to receive any response */ + uint32_t data_len; /**< Length of the appended Data */ + uint8_t data[0]; /**< Appended Data payload */ +} wifi_action_tx_req_t; + +/** + * @brief FTM Initiator configuration + * + */ +typedef struct { + uint8_t resp_mac[6]; /**< MAC address of the FTM Responder */ + uint8_t channel; /**< Primary channel of the FTM Responder */ + uint8_t frm_count; /**< No. of FTM frames requested in terms of 4 or 8 bursts (allowed values - 0(No pref), 16, 24, 32, 64) */ + uint16_t burst_period; /**< Requested period between FTM bursts in 100's of milliseconds (allowed values 0(No pref) - 100) */ + bool use_get_report_api; /**< True - Using esp_wifi_ftm_get_report to get FTM report, False - Using ftm_report_data from + WIFI_EVENT_FTM_REPORT to get FTM report */ +} wifi_ftm_initiator_cfg_t; + +#define ESP_WIFI_NAN_MAX_SVC_SUPPORTED 2 /**< Maximum number of NAN services supported */ +#define ESP_WIFI_NAN_DATAPATH_MAX_PEERS 2 /**< Maximum number of NAN datapath peers supported */ + +#define ESP_WIFI_NDP_ROLE_INITIATOR 1 /**< Initiator role for NAN Data Path */ +#define ESP_WIFI_NDP_ROLE_RESPONDER 2 /**< Responder role for NAN Data Path */ + +#define ESP_WIFI_MAX_SVC_NAME_LEN 256 /**< Maximum length of NAN service name */ +#define ESP_WIFI_MAX_FILTER_LEN 256 /**< Maximum length of NAN service filter */ +#define ESP_WIFI_MAX_SVC_INFO_LEN 64 /**< Maximum length of NAN service info */ +#define ESP_WIFI_MAX_FUP_SSI_LEN 2048 /**< Maximum length of NAN Service Specific Info in a Follow-up frame */ +#define ESP_WIFI_MAX_SVC_SSI_LEN 512 /**< Maximum length of NAN Service Specific Info in Publish/Subscribe SDF's */ +#define ESP_WIFI_MAX_NEIGHBOR_REP_LEN 64 /**< Maximum length of NAN Neighbor Report */ +#define WIFI_OUI_LEN 3 /**< Length of OUI bytes in IE or attributes */ + +/** + * @brief Protocol types in NAN service specific info attribute + * + */ +typedef enum { + WIFI_SVC_PROTO_RESERVED = 0, /**< Value 0 Reserved */ + WIFI_SVC_PROTO_BONJOUR = 1, /**< Bonjour Protocol */ + WIFI_SVC_PROTO_GENERIC = 2, /**< Generic Service Protocol */ + WIFI_SVC_PROTO_CSA_MATTER = 3, /**< CSA Matter specific protocol */ + WIFI_SVC_PROTO_MAX, /**< Values 4-255 Reserved */ +} wifi_nan_svc_proto_t; + +/** + * @brief WFA defined Protocol types in NAN service specific info attribute + * + */ +typedef struct { + uint8_t wfa_oui[WIFI_OUI_LEN]; /**< WFA OUI - 0x50, 0x6F, 0x9A */ + wifi_nan_svc_proto_t proto; /**< WFA defined protocol types */ + uint8_t payload[0]; /**< Service Info payload */ +} wifi_nan_wfa_ssi_t; + +/** + * @brief NAN Services types + * + */ +typedef enum { + NAN_PUBLISH_SOLICITED, /**< Send unicast Publish frame to Subscribers that match the requirement */ + NAN_PUBLISH_UNSOLICITED,/**< Send broadcast Publish frames in every Discovery Window(DW) */ + NAN_SUBSCRIBE_ACTIVE, /**< Send broadcast Subscribe frames in every DW */ + NAN_SUBSCRIBE_PASSIVE, /**< Passively listens to Publish frames */ +} wifi_nan_service_type_t; + +/** + * @brief NAN Publish service configuration parameters + * + */ +typedef struct { + char service_name[ESP_WIFI_MAX_SVC_NAME_LEN]; /**< Service name identifier */ + wifi_nan_service_type_t type; /**< Service type */ + char matching_filter[ESP_WIFI_MAX_FILTER_LEN]; /**< Comma separated filters for filtering services */ + char svc_info[ESP_WIFI_MAX_SVC_INFO_LEN]; /**< To be deprecated in next major release, use ssi instead */ + uint8_t single_replied_event: 1; /**< Give single Replied event or every time */ + uint8_t datapath_reqd: 1; /**< NAN Datapath required for the service */ + uint8_t fsd_reqd: 1; /**< Further Service Discovery(FSD) required */ + uint8_t fsd_gas: 1; /**< 0 - Follow-up used for FSD, 1 - GAS used for FSD */ + uint8_t reserved: 4; /**< Reserved */ + uint16_t ssi_len; /**< Length of service specific info, maximum allowed length - ESP_WIFI_MAX_SVC_SSI_LEN */ + uint8_t *ssi; /**< Service Specific Info of type wifi_nan_wfa_ssi_t for WFA defined protocols, otherwise proprietary and defined by Applications */ +} wifi_nan_publish_cfg_t; + +/** + * @brief NAN Subscribe service configuration parameters + * + */ +typedef struct { + char service_name[ESP_WIFI_MAX_SVC_NAME_LEN]; /**< Service name identifier */ + wifi_nan_service_type_t type; /**< Service type */ + char matching_filter[ESP_WIFI_MAX_FILTER_LEN]; /**< Comma separated filters for filtering services */ + char svc_info[ESP_WIFI_MAX_SVC_INFO_LEN]; /**< To be deprecated in next major release, use ssi instead */ + uint8_t single_match_event: 1; /**< Give single Match event(per SSI update) or every time */ + uint8_t datapath_reqd: 1; /**< NAN Datapath required for the service */ + uint8_t fsd_reqd: 1; /**< Further Service Discovery(FSD) required */ + uint8_t fsd_gas: 1; /**< 0 - Follow-up used for FSD, 1 - GAS used for FSD */ + uint8_t reserved: 4; /**< Reserved */ + uint16_t ssi_len; /**< Length of service specific info, maximum allowed length - ESP_WIFI_MAX_SVC_SSI_LEN */ + uint8_t *ssi; /**< Service Specific Info of type wifi_nan_wfa_ssi_t for WFA defined protocols, otherwise proprietary and defined by Applications */ +} wifi_nan_subscribe_cfg_t; + +/** + * @brief NAN Follow-up parameters + * + */ +typedef struct { + uint8_t inst_id; /**< Own service instance id */ + uint8_t peer_inst_id; /**< Peer's service instance id */ + uint8_t peer_mac[6]; /**< Peer's MAC address */ + char svc_info[ESP_WIFI_MAX_SVC_INFO_LEN]; /**< To be deprecated in next major release, use ssi instead */ + uint16_t ssi_len; /**< Length of service specific info, maximum allowed length - ESP_WIFI_MAX_FUP_SSI_LEN */ + uint8_t *ssi; /**< Service Specific Info of type wifi_nan_wfa_ssi_t for WFA defined protocols, otherwise proprietary and defined by Applications */ +} wifi_nan_followup_params_t; + +/** + * @brief NAN Datapath Request parameters + * + */ +typedef struct { + uint8_t pub_id; /**< Publisher's service instance id */ + uint8_t peer_mac[6]; /**< Peer's MAC address */ + bool confirm_required; /**< NDP Confirm frame required */ +} wifi_nan_datapath_req_t; + +/** + * @brief NAN Datapath Response parameters + * + */ +typedef struct { + bool accept; /**< True - Accept incoming NDP, False - Reject it */ + uint8_t ndp_id; /**< NAN Datapath Identifier */ + uint8_t peer_mac[6]; /**< Peer's MAC address */ +} wifi_nan_datapath_resp_t; + +/** + * @brief NAN Datapath End parameters + * + */ +typedef struct { + uint8_t ndp_id; /**< NAN Datapath Identifier */ + uint8_t peer_mac[6]; /**< Peer's MAC address */ +} wifi_nan_datapath_end_req_t; + +/** + * @brief Wi-Fi PHY rate encodings + * + * @note Rate Table: MCS Rate and Guard Interval Information + * | MCS RATE | HT20 | HT40 | HE20 | VHT20 | + * |-----------------------------|-------------------------|-------------------------|-------------------------|-------------------------| + * | WIFI_PHY_RATE_MCS0_LGI | 6.5 Mbps (800 ns) | 13.5 Mbps (800 ns) | 8.1 Mbps (1600 ns) | 6.5 Mbps (800 ns) | + * | WIFI_PHY_RATE_MCS1_LGI | 13 Mbps (800 ns) | 27 Mbps (800 ns) | 16.3 Mbps (1600 ns) | 13 Mbps (800 ns) | + * | WIFI_PHY_RATE_MCS2_LGI | 19.5 Mbps (800 ns) | 40.5 Mbps (800 ns) | 24.4 Mbps (1600 ns) | 19.5 Mbps (800 ns) | + * | WIFI_PHY_RATE_MCS3_LGI | 26 Mbps (800 ns) | 54 Mbps (800 ns) | 32.5 Mbps (1600 ns) | 26 Mbps (800 ns) | + * | WIFI_PHY_RATE_MCS4_LGI | 39 Mbps (800 ns) | 81 Mbps (800 ns) | 48.8 Mbps (1600 ns) | 39 Mbps (800 ns) | + * | WIFI_PHY_RATE_MCS5_LGI | 52 Mbps (800 ns) | 108 Mbps (800 ns) | 65 Mbps (1600 ns) | 52 Mbps (800 ns) | + * | WIFI_PHY_RATE_MCS6_LGI | 58.5 Mbps (800 ns) | 121.5 Mbps (800 ns) | 73.1 Mbps (1600 ns) | 58.5 Mbps (800 ns) | + * | WIFI_PHY_RATE_MCS7_LGI | 65 Mbps (800 ns) | 135 Mbps (800 ns) | 81.3 Mbps (1600 ns) | 65 Mbps (800 ns) | + * | WIFI_PHY_RATE_MCS8_LGI | | | 97.5 Mbps (1600 ns) | | + * | WIFI_PHY_RATE_MCS9_LGI | | | 108.3 Mbps (1600 ns) | | + * + * @note + * | MCS RATE | HT20 | HT40 | HE20 | VHT20 | + * |-----------------------------|-------------------------|-------------------------|-------------------------|-------------------------| + * | WIFI_PHY_RATE_MCS0_SGI | 7.2 Mbps (400 ns) | 15 Mbps (400 ns) | 8.6 Mbps (800 ns) | 7.2 Mbps (400 ns) | + * | WIFI_PHY_RATE_MCS1_SGI | 14.4 Mbps (400 ns) | 30 Mbps (400 ns) | 17.2 Mbps (800 ns) | 14.4 Mbps (400 ns) | + * | WIFI_PHY_RATE_MCS2_SGI | 21.7 Mbps (400 ns) | 45 Mbps (400 ns) | 25.8 Mbps (800 ns) | 21.7 Mbps (400 ns) | + * | WIFI_PHY_RATE_MCS3_SGI | 28.9 Mbps (400 ns) | 60 Mbps (400 ns) | 34.4 Mbps (800 ns) | 28.9 Mbps (400 ns) | + * | WIFI_PHY_RATE_MCS4_SGI | 43.3 Mbps (400 ns) | 90 Mbps (400 ns) | 51.6 Mbps (800 ns) | 43.3 Mbps (400 ns) | + * | WIFI_PHY_RATE_MCS5_SGI | 57.8 Mbps (400 ns) | 120 Mbps (400 ns) | 68.8 Mbps (800 ns) | 57.8 Mbps (400 ns) | + * | WIFI_PHY_RATE_MCS6_SGI | 65 Mbps (400 ns) | 135 Mbps (400 ns) | 77.4 Mbps (800 ns) | 65 Mbps (400 ns) | + * | WIFI_PHY_RATE_MCS7_SGI | 72.2 Mbps (400 ns) | 150 Mbps (400 ns) | 86 Mbps (800 ns) | 72.2 Mbps (400 ns) | + * | WIFI_PHY_RATE_MCS8_SGI | | | 103.2 Mbps (800 ns) | | + * | WIFI_PHY_RATE_MCS9_SGI | | | 114.7 Mbps (800 ns) | | + * + */ +typedef enum { + WIFI_PHY_RATE_1M_L = 0x00, /**< 1 Mbps with long preamble */ + WIFI_PHY_RATE_2M_L = 0x01, /**< 2 Mbps with long preamble */ + WIFI_PHY_RATE_5M_L = 0x02, /**< 5.5 Mbps with long preamble */ + WIFI_PHY_RATE_11M_L = 0x03, /**< 11 Mbps with long preamble */ + WIFI_PHY_RATE_2M_S = 0x05, /**< 2 Mbps with short preamble */ + WIFI_PHY_RATE_5M_S = 0x06, /**< 5.5 Mbps with short preamble */ + WIFI_PHY_RATE_11M_S = 0x07, /**< 11 Mbps with short preamble */ + WIFI_PHY_RATE_48M = 0x08, /**< 48 Mbps */ + WIFI_PHY_RATE_24M = 0x09, /**< 24 Mbps */ + WIFI_PHY_RATE_12M = 0x0A, /**< 12 Mbps */ + WIFI_PHY_RATE_6M = 0x0B, /**< 6 Mbps */ + WIFI_PHY_RATE_54M = 0x0C, /**< 54 Mbps */ + WIFI_PHY_RATE_36M = 0x0D, /**< 36 Mbps */ + WIFI_PHY_RATE_18M = 0x0E, /**< 18 Mbps */ + WIFI_PHY_RATE_9M = 0x0F, /**< 9 Mbps */ + + WIFI_PHY_RATE_MCS0_LGI = 0x10, /**< MCS0 with long GI */ + WIFI_PHY_RATE_MCS1_LGI = 0x11, /**< MCS1 with long GI */ + WIFI_PHY_RATE_MCS2_LGI = 0x12, /**< MCS2 with long GI */ + WIFI_PHY_RATE_MCS3_LGI = 0x13, /**< MCS3 with long GI */ + WIFI_PHY_RATE_MCS4_LGI = 0x14, /**< MCS4 with long GI */ + WIFI_PHY_RATE_MCS5_LGI = 0x15, /**< MCS5 with long GI */ + WIFI_PHY_RATE_MCS6_LGI = 0x16, /**< MCS6 with long GI */ + WIFI_PHY_RATE_MCS7_LGI = 0x17, /**< MCS7 with long GI */ +#if CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT || !CONFIG_SLAVE_SOC_WIFI_SUPPORTED + WIFI_PHY_RATE_MCS8_LGI, /**< MCS8 with long GI */ + WIFI_PHY_RATE_MCS9_LGI, /**< MCS9 with long GI */ +#endif + + WIFI_PHY_RATE_MCS0_SGI, /**< MCS0 with short GI */ + WIFI_PHY_RATE_MCS1_SGI, /**< MCS1 with short GI */ + WIFI_PHY_RATE_MCS2_SGI, /**< MCS2 with short GI */ + WIFI_PHY_RATE_MCS3_SGI, /**< MCS3 with short GI */ + WIFI_PHY_RATE_MCS4_SGI, /**< MCS4 with short GI */ + WIFI_PHY_RATE_MCS5_SGI, /**< MCS5 with short GI */ + WIFI_PHY_RATE_MCS6_SGI, /**< MCS6 with short GI */ + WIFI_PHY_RATE_MCS7_SGI, /**< MCS7 with short GI */ +#if CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT || !CONFIG_SLAVE_SOC_WIFI_SUPPORTED + WIFI_PHY_RATE_MCS8_SGI, /**< MCS8 with short GI */ + WIFI_PHY_RATE_MCS9_SGI, /**< MCS9 with short GI */ +#endif + WIFI_PHY_RATE_LORA_250K = 0x29, /**< Espressif-specific Long Range mode rate, 250 Kbps */ + WIFI_PHY_RATE_LORA_500K = 0x2A, /**< Espressif-specific Long Range mode rate, 500 Kbps */ + WIFI_PHY_RATE_MAX, +} wifi_phy_rate_t; + +/** + * @brief Wi-Fi event declarations + */ +typedef enum { + WIFI_EVENT_WIFI_READY = 0, /**< Wi-Fi ready */ + WIFI_EVENT_SCAN_DONE, /**< Finished scanning AP */ + WIFI_EVENT_STA_START, /**< Station start */ + WIFI_EVENT_STA_STOP, /**< Station stop */ + WIFI_EVENT_STA_CONNECTED, /**< Station connected to AP */ + WIFI_EVENT_STA_DISCONNECTED, /**< Station disconnected from AP */ + WIFI_EVENT_STA_AUTHMODE_CHANGE, /**< The auth mode of AP connected by device's station changed */ + + WIFI_EVENT_STA_WPS_ER_SUCCESS, /**< Station WPS succeeds in enrollee mode */ + WIFI_EVENT_STA_WPS_ER_FAILED, /**< Station WPS fails in enrollee mode */ + WIFI_EVENT_STA_WPS_ER_TIMEOUT, /**< Station WPS timeout in enrollee mode */ + WIFI_EVENT_STA_WPS_ER_PIN, /**< Station WPS pin code in enrollee mode */ + WIFI_EVENT_STA_WPS_ER_PBC_OVERLAP, /**< Station WPS overlap in enrollee mode */ + + WIFI_EVENT_AP_START, /**< Soft-AP start */ + WIFI_EVENT_AP_STOP, /**< Soft-AP stop */ + WIFI_EVENT_AP_STACONNECTED, /**< A station connected to Soft-AP */ + WIFI_EVENT_AP_STADISCONNECTED, /**< A station disconnected from Soft-AP */ + WIFI_EVENT_AP_PROBEREQRECVED, /**< Receive probe request packet in soft-AP interface */ + + WIFI_EVENT_FTM_REPORT, /**< Receive report of FTM procedure */ + + /* Add next events after this only */ + WIFI_EVENT_STA_BSS_RSSI_LOW, /**< AP's RSSI crossed configured threshold */ + WIFI_EVENT_ACTION_TX_STATUS, /**< Status indication of Action Tx operation */ + WIFI_EVENT_ROC_DONE, /**< Remain-on-Channel operation complete */ + + WIFI_EVENT_STA_BEACON_TIMEOUT, /**< Station beacon timeout */ + + WIFI_EVENT_CONNECTIONLESS_MODULE_WAKE_INTERVAL_START, /**< Connectionless module wake interval start */ + /* Add next events after this only */ + + WIFI_EVENT_AP_WPS_RG_SUCCESS, /**< Soft-AP wps succeeds in registrar mode */ + WIFI_EVENT_AP_WPS_RG_FAILED, /**< Soft-AP wps fails in registrar mode */ + WIFI_EVENT_AP_WPS_RG_TIMEOUT, /**< Soft-AP wps timeout in registrar mode */ + WIFI_EVENT_AP_WPS_RG_PIN, /**< Soft-AP wps pin code in registrar mode */ + WIFI_EVENT_AP_WPS_RG_PBC_OVERLAP, /**< Soft-AP wps overlap in registrar mode */ + + WIFI_EVENT_ITWT_SETUP, /**< iTWT setup */ + WIFI_EVENT_ITWT_TEARDOWN, /**< iTWT teardown */ + WIFI_EVENT_ITWT_PROBE, /**< iTWT probe */ + WIFI_EVENT_ITWT_SUSPEND, /**< iTWT suspend */ + WIFI_EVENT_TWT_WAKEUP, /**< TWT wakeup */ + WIFI_EVENT_BTWT_SETUP, /**< bTWT setup */ + WIFI_EVENT_BTWT_TEARDOWN, /**< bTWT teardown*/ + + WIFI_EVENT_NAN_STARTED, /**< NAN Discovery has started */ + WIFI_EVENT_NAN_STOPPED, /**< NAN Discovery has stopped */ + WIFI_EVENT_NAN_SVC_MATCH, /**< NAN Service Discovery match found */ + WIFI_EVENT_NAN_REPLIED, /**< Replied to a NAN peer with Service Discovery match */ + WIFI_EVENT_NAN_RECEIVE, /**< Received a Follow-up message */ + 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, /**< Wi-Fi home channel change,doesn't occur when scanning */ + + WIFI_EVENT_STA_NEIGHBOR_REP, /**< Received Neighbor Report response */ + + WIFI_EVENT_AP_WRONG_PASSWORD, /**< a station tried to connect with wrong password */ + + WIFI_EVENT_MAX, /**< Invalid Wi-Fi event ID */ +} wifi_event_t; + +/** @cond **/ +/** @brief Wi-Fi event base declaration */ +ESP_EVENT_DECLARE_BASE(WIFI_EVENT); +/** @endcond **/ + +/** + * @brief Argument structure for WIFI_EVENT_SCAN_DONE event + */ +typedef struct { + uint32_t status; /**< Status of scanning APs: 0 — success, 1 - failure */ + uint8_t number; /**< Number of scan results */ + uint8_t scan_id; /**< Scan sequence number, used for block scan */ +} wifi_event_sta_scan_done_t; + +/** + * @brief Argument structure for WIFI_EVENT_STA_CONNECTED event + */ +typedef struct { + uint8_t ssid[32]; /**< SSID of connected AP */ + uint8_t ssid_len; /**< SSID length of connected AP */ + uint8_t bssid[6]; /**< BSSID of connected AP*/ + uint8_t channel; /**< Channel of connected AP*/ + wifi_auth_mode_t authmode;/**< Authentication mode used by the connection*/ + uint16_t aid; /**< Authentication id assigned by the connected AP */ +} wifi_event_sta_connected_t; + +/** + * @brief Argument structure for WIFI_EVENT_STA_DISCONNECTED event + */ +typedef struct { + uint8_t ssid[32]; /**< SSID of disconnected AP */ + uint8_t ssid_len; /**< SSID length of disconnected AP */ + uint8_t bssid[6]; /**< BSSID of disconnected AP */ + uint8_t reason; /**< Disconnection reason */ + int8_t rssi; /**< Disconnection RSSI */ +} wifi_event_sta_disconnected_t; + +/** + * @brief Argument structure for WIFI_EVENT_STA_AUTHMODE_CHANGE event + */ +typedef struct { + wifi_auth_mode_t old_mode; /**< Old auth mode of AP */ + wifi_auth_mode_t new_mode; /**< New auth mode of AP */ +} wifi_event_sta_authmode_change_t; + +/** + * @brief Argument structure for WIFI_EVENT_STA_WPS_ER_PIN event + */ +typedef struct { + uint8_t pin_code[8]; /**< PIN code of station in enrollee mode */ +} wifi_event_sta_wps_er_pin_t; + +/** + * @brief Argument structure for WIFI_EVENT_STA_WPS_ER_FAILED event + */ +typedef enum { + WPS_FAIL_REASON_NORMAL = 0, /**< WPS normal fail reason */ + WPS_FAIL_REASON_RECV_M2D, /**< WPS receive M2D frame */ + WPS_FAIL_REASON_RECV_DEAUTH, /**< Recv deauth from AP while wps handshake */ + WPS_FAIL_REASON_MAX /**< Max WPS fail reason */ +} wifi_event_sta_wps_fail_reason_t; + +#define MAX_SSID_LEN 32 /**< Maximum length of SSID */ +#define MAX_PASSPHRASE_LEN 64 /**< Maximum length of passphrase */ +#define MAX_WPS_AP_CRED 3 /**< Maximum number of AP credentials received from WPS handshake */ + +/** + * @brief 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; + +/** + * @brief Argument structure for WIFI_EVENT_AP_STACONNECTED event + */ +typedef struct { + uint8_t mac[6]; /**< MAC address of the station connected to Soft-AP */ + uint8_t aid; /**< AID assigned by the Soft-AP to the connected station */ + bool is_mesh_child; /**< Flag indicating whether the connected station is a mesh child */ +} wifi_event_ap_staconnected_t; + +/** + * @brief Argument structure for WIFI_EVENT_AP_STADISCONNECTED event + */ +typedef struct { + uint8_t mac[6]; /**< MAC address of the station disconnects from the soft-AP */ + uint8_t aid; /**< AID that the Soft-AP assigned to the disconnected station */ + bool is_mesh_child; /**< Flag indicating whether the disconnected station is a mesh child */ + uint16_t reason; /**< Disconnection reason */ +} wifi_event_ap_stadisconnected_t; + +/** + * @brief Argument structure for WIFI_EVENT_AP_PROBEREQRECVED event + */ +typedef struct { + int rssi; /**< Received probe request signal strength */ + uint8_t mac[6]; /**< MAC address of the station which send probe request */ +} wifi_event_ap_probe_req_rx_t; + +/** + * @brief Argument structure for WIFI_EVENT_STA_BSS_RSSI_LOW event + */ +typedef struct { + int32_t rssi; /**< RSSI value of bss */ +} wifi_event_bss_rssi_low_t; + +/** + * @brief 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 + * + */ +typedef enum { + FTM_STATUS_SUCCESS = 0, /**< FTM exchange is successful */ + FTM_STATUS_UNSUPPORTED, /**< Peer does not support FTM */ + FTM_STATUS_CONF_REJECTED, /**< Peer rejected FTM configuration in FTM Request */ + FTM_STATUS_NO_RESPONSE, /**< Peer did not respond to FTM Requests */ + FTM_STATUS_FAIL, /**< Unknown error during FTM exchange */ + FTM_STATUS_NO_VALID_MSMT, /**< FTM session did not result in any valid measurements */ + FTM_STATUS_USER_TERM, /**< User triggered termination */ +} wifi_ftm_status_t; + +/** + * @brief Structure representing a report entry for Fine Timing Measurement (FTM) in Wi-Fi. + * + * This structure holds the information related to the FTM process between a Wi-Fi FTM Initiator + * and a Wi-Fi FTM Responder. FTM is used for precise distance measurement by timing the exchange + * of frames between devices. + */ +typedef struct { + uint8_t dlog_token; /**< Dialog Token of the FTM frame */ + int8_t rssi; /**< RSSI of the FTM frame received */ + uint32_t rtt; /**< Round Trip Time in pSec with a peer */ + uint64_t t1; /**< Time of departure of FTM frame from FTM Responder in pSec */ + uint64_t t2; /**< Time of arrival of FTM frame at FTM Initiator in pSec */ + uint64_t t3; /**< Time of departure of ACK from FTM Initiator in pSec */ + uint64_t t4; /**< Time of arrival of ACK at FTM Responder in pSec */ +} wifi_ftm_report_entry_t; + +/** + * @brief Argument structure for WIFI_EVENT_FTM_REPORT event + */ +typedef struct { + uint8_t peer_mac[6]; /**< MAC address of the FTM Peer */ + wifi_ftm_status_t status; /**< Status of the FTM operation */ + uint32_t rtt_raw; /**< Raw average Round-Trip-Time with peer in Nano-Seconds */ + uint32_t rtt_est; /**< Estimated Round-Trip-Time with peer in Nano-Seconds */ + uint32_t dist_est; /**< Estimated one-way distance in Centi-Meters */ + wifi_ftm_report_entry_t *ftm_report_data; /**< Pointer to FTM Report, should be freed after use. Note: Highly recommended + to use API esp_wifi_ftm_get_report to get the report instead of using this */ + uint8_t ftm_report_num_entries; /**< Number of entries in the FTM Report data */ +} wifi_event_ftm_report_t; + +#define WIFI_STATIS_BUFFER (1<<0) /**< Buffer status */ +#define WIFI_STATIS_RXTX (1<<1) /**< RX/TX status */ +#define WIFI_STATIS_HW (1<<2) /**< Hardware status */ +#define WIFI_STATIS_DIAG (1<<3) /**< Diagnostic status */ +#define WIFI_STATIS_PS (1<<4) /**< Power save status */ +#define WIFI_STATIS_ALL (-1) /**< All status */ + +/** + * @brief Argument structure for WIFI_EVENT_ACTION_TX_STATUS event + */ +typedef struct { + wifi_interface_t ifx; /**< Wi-Fi interface to send request to */ + uint32_t context; /**< Context to identify the request */ + uint8_t da[6]; /**< Destination MAC address */ + uint8_t status; /**< Status of the operation */ +} wifi_event_action_tx_status_t; + +/** + * @brief Argument structure for WIFI_EVENT_ROC_DONE event + */ +typedef struct { + uint32_t context; /**< Context to identify the request */ +} wifi_event_roc_done_t; + +/** + * @brief Argument structure for WIFI_EVENT_AP_WPS_RG_PIN event + */ +typedef struct { + uint8_t pin_code[8]; /**< PIN code of station in enrollee mode */ +} wifi_event_ap_wps_rg_pin_t; + +/** + * @brief WPS fail reason + */ +typedef enum { + WPS_AP_FAIL_REASON_NORMAL = 0, /**< WPS normal fail reason */ + WPS_AP_FAIL_REASON_CONFIG, /**< WPS failed due to incorrect config */ + WPS_AP_FAIL_REASON_AUTH, /**< WPS failed during auth */ + WPS_AP_FAIL_REASON_MAX, /**< Max WPS fail reason */ +} wps_fail_reason_t; + +/** + * @brief Argument structure for WIFI_EVENT_AP_WPS_RG_FAILED event + */ +typedef struct { + wps_fail_reason_t reason; /**< WPS failure reason wps_fail_reason_t */ + uint8_t peer_macaddr[6]; /**< Enrollee mac address */ +} wifi_event_ap_wps_rg_fail_reason_t; + +/** + * @brief Argument structure for WIFI_EVENT_AP_WPS_RG_SUCCESS event + */ +typedef struct { + uint8_t peer_macaddr[6]; /**< Enrollee mac address */ +} wifi_event_ap_wps_rg_success_t; + +/** + * @brief Argument structure for WIFI_EVENT_NAN_SVC_MATCH event + */ +typedef struct { + uint8_t subscribe_id; /**< Subscribe Service Identifier */ + uint8_t publish_id; /**< Publish Service Identifier */ + uint8_t pub_if_mac[6]; /**< NAN Interface MAC of the Publisher */ + bool update_pub_id; /**< Indicates whether publisher's service ID needs to be updated */ + uint8_t datapath_reqd: 1; /**< NAN Datapath required for the service */ + uint8_t fsd_reqd: 1; /**< Further Service Discovery(FSD) required */ + uint8_t fsd_gas: 1; /**< 0 - Follow-up used for FSD, 1 - GAS used for FSD */ + uint8_t reserved: 5; /**< Reserved */ + uint32_t reserved_1; /**< Reserved */ + uint32_t reserved_2; /**< Reserved */ + uint8_t ssi_version; /**< Indicates version of SSI in Publish instance, 0 if not available */ + uint16_t ssi_len; /**< Length of service specific info */ + uint8_t ssi[]; /**< Service specific info of Publisher */ +} wifi_event_nan_svc_match_t; + +/** + * @brief Argument structure for WIFI_EVENT_NAN_REPLIED event + */ +typedef struct { + uint8_t publish_id; /**< Publish Service Identifier */ + uint8_t subscribe_id; /**< Subscribe Service Identifier */ + uint8_t sub_if_mac[6]; /**< NAN Interface MAC of the Subscriber */ + uint32_t reserved_1; /**< Reserved */ + uint32_t reserved_2; /**< Reserved */ + uint16_t ssi_len; /**< Length of service specific info */ + uint8_t ssi[]; /**< Service specific info of Subscriber */ +} wifi_event_nan_replied_t; + +/** + * @brief Argument structure for WIFI_EVENT_NAN_RECEIVE event + */ +typedef struct { + uint8_t inst_id; /**< Our Service Identifier */ + uint8_t peer_inst_id; /**< Peer's Service Identifier */ + uint8_t peer_if_mac[6]; /**< Peer's NAN Interface MAC */ + uint8_t peer_svc_info[ESP_WIFI_MAX_SVC_INFO_LEN];/**< To be deprecated in next major release, use ssi instead */ + uint32_t reserved_1; /**< Reserved */ + uint32_t reserved_2; /**< Reserved */ + uint16_t ssi_len; /**< Length of service specific info */ + uint8_t ssi[]; /**< Service specific info from Follow-up */ +} wifi_event_nan_receive_t; + +/** + * @brief Argument structure for WIFI_EVENT_NDP_INDICATION event + */ +typedef struct { + uint8_t publish_id; /**< Publish Id for NAN Service */ + uint8_t ndp_id; /**< NDP instance id */ + uint8_t peer_nmi[6]; /**< Peer's NAN Management Interface MAC */ + uint8_t peer_ndi[6]; /**< Peer's NAN Data Interface MAC */ + uint8_t svc_info[ESP_WIFI_MAX_SVC_INFO_LEN];/**< To be deprecated in next major release, use ssi instead */ + uint32_t reserved_1; /**< Reserved */ + uint32_t reserved_2; /**< Reserved */ + uint16_t ssi_len; /**< Length of service specific info */ + uint8_t ssi[]; /**< Service specific info from NDP/NDPE Attribute */ +} wifi_event_ndp_indication_t; + +/** + * @brief Argument structure for WIFI_EVENT_NDP_CONFIRM event + */ +typedef struct { + uint8_t status; /**< NDP status code */ + uint8_t ndp_id; /**< NDP instance id */ + uint8_t peer_nmi[6]; /**< Peer's NAN Management Interface MAC */ + uint8_t peer_ndi[6]; /**< Peer's NAN Data Interface MAC */ + uint8_t own_ndi[6]; /**< Own NAN Data Interface MAC */ + uint8_t svc_info[ESP_WIFI_MAX_SVC_INFO_LEN];/**< To be deprecated in next major release, use ssi instead */ + uint32_t reserved_1; /**< Reserved */ + uint32_t reserved_2; /**< Reserved */ + uint16_t ssi_len; /**< Length of Service Specific Info */ + uint8_t ssi[]; /**< Service specific info from NDP/NDPE Attribute */ +} wifi_event_ndp_confirm_t; + +/** + * @brief Argument structure for WIFI_EVENT_NDP_TERMINATED event + */ +typedef struct { + uint8_t reason; /**< Termination reason code */ + uint8_t ndp_id; /**< NDP instance id */ + uint8_t init_ndi[6]; /**< Initiator's NAN Data Interface MAC */ +} wifi_event_ndp_terminated_t; + +/** + * @brief Argument structure for WIFI_EVENT_STA_NEIGHBOR_REP event + */ +typedef struct { + uint8_t report[ESP_WIFI_MAX_NEIGHBOR_REP_LEN]; /**< Neighbor Report received from the AP (will be deprecated in next major release, use n_report instead)*/ + uint16_t report_len; /**< Length of the report*/ + uint8_t n_report[]; /**< Neighbor Report received from the AP*/ +} wifi_event_neighbor_report_t; + +/** Argument structure for WIFI_EVENT_AP_WRONG_PASSWORD event */ +typedef struct { + uint8_t mac[6]; /**< MAC address of the station trying to connect to Soft-AP */ +} wifi_event_ap_wrong_password_t; + +/** + * @brief Argument structure for wifi_tx_rate_config + */ +typedef struct { + wifi_phy_mode_t phymode; /**< Phymode of specified interface */ + wifi_phy_rate_t rate; /**< Rate of specified interface */ + bool ersu; /**< Using ERSU to send frame, ERSU is a transmission mode related to 802.11 ax. + ERSU is always used in long distance transmission, and its frame has lower rate compared with SU mode */ + bool dcm; /**< Using dcm rate to send frame */ +} wifi_tx_rate_config_t; + +#ifdef __cplusplus +} +#endif + +#endif /* __ESP_WIFI_TYPES_H__ */ diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_types_native.h b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_types_native.h new file mode 100644 index 0000000..0963572 --- /dev/null +++ b/components/esp_wifi_remote/idf_tag_v5.4.2/include/injected/esp_wifi_types_native.h @@ -0,0 +1,134 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "sdkconfig.h" +#include "esp_wifi_types_generic.h" +#if CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT +#include "esp_wifi_he_types.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if CONFIG_SLAVE_IDF_TARGET_ESP32C2 +#define ESP_WIFI_MAX_CONN_NUM (4) /**< max number of stations which can connect to ESP32C2 soft-AP */ +#elif CONFIG_SLAVE_IDF_TARGET_ESP32C3 || CONFIG_SLAVE_IDF_TARGET_ESP32C6 || CONFIG_SLAVE_IDF_TARGET_ESP32C5 || CONFIG_SLAVE_IDF_TARGET_ESP32C61 +#define ESP_WIFI_MAX_CONN_NUM (10) /**< max number of stations which can connect to ESP32C3/ESP32C6/ESP32C5/ESP32C61 soft-AP */ +#else +#define ESP_WIFI_MAX_CONN_NUM (15) /**< max number of stations which can connect to ESP32/ESP32S3/ESP32S2 soft-AP */ +#endif + +/** @brief List of stations associated with the Soft-AP */ +typedef struct wifi_sta_list_t { + wifi_sta_info_t sta[ESP_WIFI_MAX_CONN_NUM]; /**< station list */ + int num; /**< number of stations in the list (other entries are invalid) */ +} wifi_sta_list_t; + +#if CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT +typedef esp_wifi_rxctrl_t wifi_pkt_rx_ctrl_t; +#else +/** @brief Received packet radio metadata header, this is the common header at the beginning of all promiscuous mode RX callback buffers */ +typedef struct { + signed rssi: 8; /**< Received Signal Strength Indicator(RSSI) of packet. unit: dBm */ + unsigned rate: 5; /**< PHY rate encoding of the packet. Only valid for non HT(11bg) packet */ + unsigned : 1; /**< reserved */ + unsigned sig_mode: 2; /**< Protocol of the received packet, 0: non HT(11bg) packet; 1: HT(11n) packet; 3: VHT(11ac) packet */ + unsigned : 16; /**< reserved */ + unsigned mcs: 7; /**< Modulation Coding Scheme. If is HT(11n) packet, shows the modulation, range from 0 to 76(MSC0 ~ MCS76) */ + unsigned cwb: 1; /**< Channel Bandwidth of the packet. 0: 20MHz; 1: 40MHz */ + unsigned : 16; /**< reserved */ + unsigned smoothing: 1; /**< Set to 1 indicates that channel estimate smoothing is recommended. + Set to 0 indicates that only per-carrierindependent (unsmoothed) channel estimate is recommended. */ + unsigned not_sounding: 1; /**< Set to 0 indicates that PPDU is a sounding PPDU. Set to 1indicates that the PPDU is not a sounding PPDU. + sounding PPDU is used for channel estimation by the request receiver */ + unsigned : 1; /**< reserved */ + unsigned aggregation: 1; /**< Aggregation. 0: MPDU packet; 1: AMPDU packet */ + unsigned stbc: 2; /**< Space Time Block Code(STBC). 0: non STBC packet; 1: STBC packet */ + unsigned fec_coding: 1; /**< Forward Error Correction(FEC). Flag is set for 11n packets which are LDPC */ + unsigned sgi: 1; /**< Short Guide Interval(SGI). 0: Long GI; 1: Short GI */ +#if CONFIG_SLAVE_IDF_TARGET_ESP32 + signed noise_floor: 8; /**< noise floor of Radio Frequency Module(RF). unit: dBm*/ +#elif CONFIG_SLAVE_IDF_TARGET_ESP32S2 || CONFIG_SLAVE_IDF_TARGET_ESP32S3 || CONFIG_SLAVE_IDF_TARGET_ESP32C3 || CONFIG_SLAVE_IDF_TARGET_ESP32C2 + unsigned : 8; /**< reserved */ +#endif + unsigned ampdu_cnt: 8; /**< the number of subframes aggregated in AMPDU */ + unsigned channel: 4; /**< primary channel on which this packet is received */ + unsigned secondary_channel: 4; /**< secondary channel on which this packet is received. 0: none; 1: above; 2: below */ + unsigned : 8; /**< reserved */ + unsigned timestamp: 32; /**< timestamp. The local time when this packet is received. It is precise only if modem sleep or light sleep is not enabled. unit: microsecond */ + unsigned : 32; /**< reserved */ +#if CONFIG_SLAVE_IDF_TARGET_ESP32S2 + unsigned : 32; /**< reserved */ +#elif CONFIG_SLAVE_IDF_TARGET_ESP32S3 || CONFIG_SLAVE_IDF_TARGET_ESP32C3 || CONFIG_SLAVE_IDF_TARGET_ESP32C2 + signed noise_floor: 8; /**< noise floor of Radio Frequency Module(RF). unit: dBm*/ + unsigned : 24; /**< reserved */ + unsigned : 32; /**< reserved */ +#endif + unsigned : 31; /**< reserved */ + unsigned ant: 1; /**< antenna number from which this packet is received. 0: WiFi antenna 0; 1: WiFi antenna 1 */ +#if CONFIG_SLAVE_IDF_TARGET_ESP32S2 + signed noise_floor: 8; /**< noise floor of Radio Frequency Module(RF). unit: dBm*/ + unsigned : 24; /**< reserved */ +#elif CONFIG_SLAVE_IDF_TARGET_ESP32S3 || CONFIG_SLAVE_IDF_TARGET_ESP32C3 || CONFIG_SLAVE_IDF_TARGET_ESP32C2 + unsigned : 32; /**< reserved */ + unsigned : 32; /**< reserved */ + unsigned : 32; /**< reserved */ +#endif + unsigned sig_len: 12; /**< length of packet including Frame Check Sequence(FCS) */ + unsigned : 12; /**< reserved */ + unsigned rx_state: 8; /**< state of the packet. 0: no error; others: error numbers which are not public */ +} wifi_pkt_rx_ctrl_t; +#endif + +/** + * @brief Channel state information(CSI) configuration type + * + */ +#if CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT +typedef wifi_csi_acquire_config_t wifi_csi_config_t; +#else +typedef struct { + bool lltf_en; /**< enable to receive legacy long training field(lltf) data. Default enabled */ + bool htltf_en; /**< enable to receive HT long training field(htltf) data. Default enabled */ + bool stbc_htltf2_en; /**< enable to receive space time block code HT long training field(stbc-htltf2) data. Default enabled */ + bool ltf_merge_en; /**< enable to generate htlft data by averaging lltf and ht_ltf data when receiving HT packet. Otherwise, use ht_ltf data directly. Default enabled */ + 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 // !CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT + +/** @brief Payload passed to 'buf' parameter of promiscuous mode RX callback. + */ +typedef struct { + wifi_pkt_rx_ctrl_t rx_ctrl; /**< metadata header */ + uint8_t payload[0]; /**< Data or management payload. Length of payload is described by rx_ctrl.sig_len. Type of content determined by packet type argument of callback. */ +} wifi_promiscuous_pkt_t; + +/** + * @brief CSI data type + * + */ +typedef struct wifi_csi_info_t { + wifi_pkt_rx_ctrl_t rx_ctrl;/**< received packet radio metadata header of the CSI data */ + uint8_t mac[6]; /**< source MAC address of the CSI data */ + uint8_t dmac[6]; /**< destination MAC address of the CSI data */ + bool first_word_invalid; /**< first four bytes of the CSI data is invalid or not, true indicates the first four bytes is invalid due to hardware limitation */ + int8_t *buf; /**< valid buffer of CSI data */ + uint16_t len; /**< valid length of CSI data */ + uint8_t *hdr; /**< header of the wifi packet */ + uint8_t *payload; /**< payload of the wifi packet */ + uint16_t payload_len; /**< payload len of the wifi packet */ + uint16_t rx_seq; /**< rx sequence number of the wifi packet */ +} wifi_csi_info_t; + +#ifdef __cplusplus +} +#endif diff --git a/components/esp_wifi_remote/idf_tag_v5.4.2/wifi_apps/roaming_app/src/Kconfig.roaming b/components/esp_wifi_remote/idf_tag_v5.4.2/wifi_apps/roaming_app/src/Kconfig.roaming new file mode 100644 index 0000000..e69de29