diff --git a/platformio.ini b/platformio.ini index 53d44b3..55662ef 100644 --- a/platformio.ini +++ b/platformio.ini @@ -75,8 +75,6 @@ extra_scripts = build_flags = ${env.build_flags} -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE - -DCONFIG_NIMBLE_CPP_LOG_LEVEL=0 - -DCONFIG_BT_NIMBLE_LOG_LEVEL=0 [env:esp32-gl-s10] extends = env:esp32 @@ -150,15 +148,6 @@ board_build.cmake_extra_args = build_flags = ${env.build_flags} -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE - -DCONFIG_NIMBLE_CPP_LOG_LEVEL=0 - -DCONFIG_BT_NIMBLE_LOG_LEVEL=0 - -DCONFIG_WIFI_RMT_ESPNOW_MAX_ENCRYPT_NUM=7 - -DCONFIG_WIFI_RMT_CACHE_TX_BUFFER_NUM=32 - -DCONFIG_WIFI_RMT_TX_BUFFER_TYPE=0 - -DCONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=16 - -DCONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=32 - -DCONFIG_WIFI_RMT_DYNAMIC_RX_MGMT_BUF=0 - -DCONFIG_WIFI_RMT_SOFTAP_SUPPORT=y [env:esp32_dbg] extends = env:esp32 @@ -168,8 +157,6 @@ board_build.cmake_extra_args = build_flags = ${env.build_flags} -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG - -DCONFIG_NIMBLE_CPP_LOG_LEVEL=0 - -DCONFIG_BT_NIMBLE_LOG_LEVEL=0 -DDEBUG_NUKIHUB [env:esp32-gl-s10_dbg] @@ -189,8 +176,6 @@ board_build.cmake_extra_args = build_flags = ${env.build_flags} -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG - -DCONFIG_NIMBLE_CPP_LOG_LEVEL=0 - -DCONFIG_BT_NIMBLE_LOG_LEVEL=0 -DDEBUG_NUKIHUB [env:esp32-c5_dbg] @@ -201,8 +186,6 @@ board_build.cmake_extra_args = build_flags = ${env.build_flags} -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG - -DCONFIG_NIMBLE_CPP_LOG_LEVEL=0 - -DCONFIG_BT_NIMBLE_LOG_LEVEL=0 -DDEBUG_NUKIHUB [env:esp32-c6_dbg] @@ -213,8 +196,6 @@ board_build.cmake_extra_args = build_flags = ${env.build_flags} -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG - -DCONFIG_NIMBLE_CPP_LOG_LEVEL=0 - -DCONFIG_BT_NIMBLE_LOG_LEVEL=0 -DDEBUG_NUKIHUB [env:esp32-h2_dbg] @@ -226,8 +207,6 @@ board_build.cmake_extra_args = build_flags = ${env.build_flags} -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG - -DCONFIG_NIMBLE_CPP_LOG_LEVEL=0 - -DCONFIG_BT_NIMBLE_LOG_LEVEL=0 -DDEBUG_NUKIHUB [env:esp32-s3_dbg] @@ -238,8 +217,6 @@ board_build.cmake_extra_args = build_flags = ${env.build_flags} -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG - -DCONFIG_NIMBLE_CPP_LOG_LEVEL=0 - -DCONFIG_BT_NIMBLE_LOG_LEVEL=0 -DDEBUG_NUKIHUB [env:esp32-s3-oct_dbg] @@ -250,8 +227,6 @@ board_build.cmake_extra_args = build_flags = ${env.build_flags} -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG - -DCONFIG_NIMBLE_CPP_LOG_LEVEL=0 - -DCONFIG_BT_NIMBLE_LOG_LEVEL=0 -DDEBUG_NUKIHUB [env:esp32-solo1_dbg] @@ -262,8 +237,6 @@ board_build.cmake_extra_args = build_flags = ${env.build_flags} -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG - -DCONFIG_NIMBLE_CPP_LOG_LEVEL=0 - -DCONFIG_BT_NIMBLE_LOG_LEVEL=0 -DDEBUG_NUKIHUB [env:esp32-p4_dbg] @@ -274,13 +247,4 @@ board_build.cmake_extra_args = build_flags = ${env.build_flags} -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG - -DCONFIG_NIMBLE_CPP_LOG_LEVEL=0 - -DCONFIG_BT_NIMBLE_LOG_LEVEL=0 - -DDEBUG_NUKIHUB - -DCONFIG_WIFI_RMT_ESPNOW_MAX_ENCRYPT_NUM=7 - -DCONFIG_WIFI_RMT_CACHE_TX_BUFFER_NUM=32 - -DCONFIG_WIFI_RMT_TX_BUFFER_TYPE=0 - -DCONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=16 - -DCONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=32 - -DCONFIG_WIFI_RMT_DYNAMIC_RX_MGMT_BUF=0 - -DCONFIG_WIFI_RMT_SOFTAP_SUPPORT=y \ No newline at end of file + -DDEBUG_NUKIHUB \ No newline at end of file diff --git a/resources/espressif__esp_wifi_remote/.component_hash b/resources/espressif__esp_wifi_remote/.component_hash new file mode 100644 index 0000000..611fba0 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/.component_hash @@ -0,0 +1 @@ +6448c379c1dceef7f0dedd30635006118e8b768be884f3804d4a94930556e08c \ No newline at end of file diff --git a/resources/espressif__esp_wifi_remote/.cz.yaml b/resources/espressif__esp_wifi_remote/.cz.yaml new file mode 100644 index 0000000..34ca378 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/.cz.yaml @@ -0,0 +1,8 @@ +--- +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.9.2 + version_files: + - idf_component.yml diff --git a/resources/espressif__esp_wifi_remote/CHANGELOG.md b/resources/espressif__esp_wifi_remote/CHANGELOG.md new file mode 100644 index 0000000..f91502f --- /dev/null +++ b/resources/espressif__esp_wifi_remote/CHANGELOG.md @@ -0,0 +1,236 @@ +# Changelog + +## [0.9.2](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.9.2) + +### Bug Fixes + +- Update per v5.5 espressif/esp-idf@dd9f8bfcbcc1 ([49fdd4a](https://github.com/espressif/esp-wifi-remote/commit/49fdd4a)) + +## [0.9.1](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.9.1) + +### Bug Fixes + +- Update per v5.4 espressif/esp-idf@c9cc85b68c15 ([4040eac](https://github.com/espressif/esp-wifi-remote/commit/4040eac)) +- Update per v5.3 espressif/esp-idf@1c63e3e70c18 ([188d87b](https://github.com/espressif/esp-wifi-remote/commit/188d87b)) + +## [0.9.0](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.9.0) + +### Features + +- Add release v5.4.1 ([b3ca515](https://github.com/espressif/esp-wifi-remote/commit/b3ca515)) +- Add release v5.3.3 ([06367d2](https://github.com/espressif/esp-wifi-remote/commit/06367d2)) + +### Bug Fixes + +- Update per v5.3 espressif/esp-idf@04a0e6304b2f ([d1f85ce](https://github.com/espressif/esp-wifi-remote/commit/d1f85ce)) +- Update per v5.5 espressif/esp-idf@c00d092bdb4e ([8598951](https://github.com/espressif/esp-wifi-remote/commit/8598951)) +- Update per v5.4 espressif/esp-idf@90c008fe8c4a ([d8f4109](https://github.com/espressif/esp-wifi-remote/commit/d8f4109)) +- Update per v5.5 espressif/esp-idf@07540f3253d ([245379e](https://github.com/espressif/esp-wifi-remote/commit/245379e)) +- Update per v5.4 espressif/esp-idf@f8b1c0976aeb ([c17cb8f](https://github.com/espressif/esp-wifi-remote/commit/c17cb8f)) + +## [0.8.5](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.8.5) + +### Bug Fixes + +- Update per v5.5 espressif/esp-idf@4355fc8fbc6b ([215d007](https://github.com/espressif/esp-wifi-remote/commit/215d007)) +- Add esp_now.h to injected headers ([09ffacc](https://github.com/espressif/esp-wifi-remote/commit/09ffacc)) + +## [0.8.4](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.8.4) + +### Bug Fixes + +- Update per v5.4 espressif/esp-idf@e72c3b4ee437 ([cfc3e3f](https://github.com/espressif/esp-wifi-remote/commit/cfc3e3f)) +- Update per v5.5 espressif/esp-idf@895e897ee789 ([ea26450](https://github.com/espressif/esp-wifi-remote/commit/ea26450)) + +## [0.8.3](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.8.3) + +### Bug Fixes + +- Fix to propagate remote wifi settings to esp_wifi ([4ea96e1](https://github.com/espressif/esp-wifi-remote/commit/4ea96e1)) + +## [0.8.2](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.8.2) + +### Bug Fixes + +- Inject also esp_mesh headers ([4ac7fbd](https://github.com/espressif/esp-wifi-remote/commit/4ac7fbd)) + +## [0.8.1](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.8.1) + +### Bug Fixes + +- Update per v5.3 espressif/esp-idf@91622962fcd ([8c4f00d](https://github.com/espressif/esp-wifi-remote/commit/8c4f00d)) + +## [0.8.0](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.8.0) + +### Features + +- Copy additional wifi headers to prepend-dir ([a936924](https://github.com/espressif/esp-wifi-remote/commit/a936924)) +- Add injected headers with slave/remote configs ([485d261](https://github.com/espressif/esp-wifi-remote/commit/485d261)) +- use WIFI_RMT_ prefix for remote wifi configs ([e1a9d6b](https://github.com/espressif/esp-wifi-remote/commit/e1a9d6b)) + +### Bug Fixes + +- Update per v5.5 espressif/esp-idf@c0580480852 ([8ab3732](https://github.com/espressif/esp-wifi-remote/commit/8ab3732)) +- Update headers and configs on supported versions ([1279776](https://github.com/espressif/esp-wifi-remote/commit/1279776)) +- Preprocess injected headers ([6e981ff](https://github.com/espressif/esp-wifi-remote/commit/6e981ff)) + +## [0.7.2](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.7.2) + +### Bug Fixes + +- Add specific versions for v5.3.2, v5.3.1 ([ccebced](https://github.com/espressif/esp-wifi-remote/commit/ccebced)) +- Update per v5.3 espressif/esp-idf4724d7c5e79 ([9d76715](https://github.com/espressif/esp-wifi-remote/commit/9d76715)) +- Add specific version for v5.4 tag ([076d80b](https://github.com/espressif/esp-wifi-remote/commit/076d80b)) + +## [0.7.1](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.7.1) + +### Bug Fixes + +- Update per v5.4 espressif/esp-idf@597cfcb4 ([006309e](https://github.com/espressif/esp-wifi-remote/commit/006309e)) + +## [0.7.0](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.7.0) + +### Features + +- Support for esp32h4 ([3666134](https://github.com/espressif/esp-wifi-remote/commit/3666134)) + +### Bug Fixes + +- Fixed ignore tag for multiple definitions ([3c4bc4a](https://github.com/espressif/esp-wifi-remote/commit/3c4bc4a)) + +## [0.6.2](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.6.2) + +### Bug Fixes + +- Allow global configs to be defined multiple times ([deb6d4c](https://github.com/espressif/esp-wifi-remote/commit/deb6d4c)) +- Account for global target configs in slave select ([0ffdd63](https://github.com/espressif/esp-wifi-remote/commit/0ffdd63)) + +## [0.6.1](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.6.1) + +### Bug Fixes + +- Ignore potential duplicate of Kconfg symbols ([14e0339](https://github.com/espressif/esp-wifi-remote/commit/14e0339)) + +## [0.6.0](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.6.0) + +### Features + +- Add static config headers ([b419fd6](https://github.com/espressif/esp-wifi-remote/commit/b419fd6)) +- Generate static default config header ([a0e98bc](https://github.com/espressif/esp-wifi-remote/commit/a0e98bc), [#13](https://github.com/espressif/esp-wifi-remote/issues/13)) + +## [0.5.5](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.5.5) + +### Bug Fixes + +- Update per v5.4 espressif/esp-idf@318ad17991f ([1ae9f08](https://github.com/espressif/esp-wifi-remote/commit/1ae9f08)) + +## [0.5.4](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.5.4) + +### Bug Fixes + +- Update per v5.3 espressif/esp-idf@20cda6424 ([cad6646](https://github.com/espressif/esp-wifi-remote/commit/cad6646)) + +## [0.5.3](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.5.3) + +### Bug Fixes + +- Update per v5.5 espressif/esp-idf@a1631199dc8 ([b4d934d](https://github.com/espressif/esp-wifi-remote/commit/b4d934d)) +- Update per v5.3 espressif/esp-idf@da39fcebc48 ([a01226f](https://github.com/espressif/esp-wifi-remote/commit/a01226f)) +- Update per IDF-v5.5 espressif/esp-idf@53e65c845b ([a8d1057](https://github.com/espressif/esp-wifi-remote/commit/a8d1057)) + +## [0.5.2](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.5.2) + +### Features + +- Add wifi-remote target test ([f413031](https://github.com/espressif/esp-wifi-remote/commit/f413031)) +- Make UART port number configurable ([c088f44](https://github.com/espressif/esp-wifi-remote/commit/c088f44)) + +### Bug Fixes + +- Fix script to skip preview targets missing config.caps ([469dbaf](https://github.com/espressif/esp-wifi-remote/commit/469dbaf)) +- Update v5.4 per espressif/esp-idf@e65acc95109 ([c2110d6](https://github.com/espressif/esp-wifi-remote/commit/c2110d6)) + +## [0.5.1](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.5.1) + +### Bug Fixes + +- Update per IDF-v5.5 espressif/esp-idf@e65acc9510 ([cb6bf06](https://github.com/espressif/esp-wifi-remote/commit/cb6bf06)) +- Update per espressif/esp-idf@87bb09d746 ([2dfc63c](https://github.com/espressif/esp-wifi-remote/commit/2dfc63c)) + +## [0.5.0](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.5.0) + +### Features + +- Add support for IDF-v5.5 ([1e03fb8](https://github.com/espressif/esp-wifi-remote/commit/1e03fb8)) + +## [0.4.1](https://github.com/espressif/esp-wifi-remote/commits/wifi_remote-v0.4.1) + +### Bug Fixes + +- Remove unused Kconfig from scripts ([3c5d58f](https://github.com/espressif/esp-wifi-remote/commit/3c5d58f)) +- Disable WiFi remote impl if ESP_HOST_WIFI_ENABLED=y ([1f6fe16](https://github.com/espressif/esp-wifi-remote/commit/1f6fe16)) + +## [0.4.0](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.4.0) + +### Features + +- Make esp_hosted default RPC library ([1b62adbd](https://github.com/espressif/esp-protocols/commit/1b62adbd)) +- Add build test for current IDF examples ([50c113e4](https://github.com/espressif/esp-protocols/commit/50c113e4)) +- Support for IDF v5.3 in a separate directory ([bde97203](https://github.com/espressif/esp-protocols/commit/bde97203)) +- Support for IDF v5.4 via a separate dir ([e9ac41e1](https://github.com/espressif/esp-protocols/commit/e9ac41e1)) +- Add slave selection and peview targets ([345c4577](https://github.com/espressif/esp-protocols/commit/345c4577)) + +### Bug Fixes + +- Fix CMake to use inherent IDF build vars ([c454ec09](https://github.com/espressif/esp-protocols/commit/c454ec09)) +- Update per v5.4 espressif/esp-idf@97e42349 ([ff5dac70](https://github.com/espressif/esp-protocols/commit/ff5dac70)) +- Fix CI builds to generate configs per slave selection ([8795d164](https://github.com/espressif/esp-protocols/commit/8795d164)) +- Depend on esp_hosted only on targets with no WiFi ([7ca5ed1d](https://github.com/espressif/esp-protocols/commit/7ca5ed1d)) +- Update per espressif/esp-idf@27f61966 ([2e53b81f](https://github.com/espressif/esp-protocols/commit/2e53b81f)) +- Fix checking API compat against reference dir ([1a57a878](https://github.com/espressif/esp-protocols/commit/1a57a878)) + +## [0.3.0](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.3.0) + +### Features + +- add esp_wifi_internal_tx_by_ref ([ba35d14e](https://github.com/espressif/esp-protocols/commit/ba35d14e)) +- Make wifi_remote depend on esp_hosted ([ac9972aa](https://github.com/espressif/esp-protocols/commit/ac9972aa)) + +## [0.2.3](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.2.3) + +### Bug Fixes + +- Fix server event/command race condtion using eventfd ([732b1d5](https://github.com/espressif/esp-protocols/commit/732b1d5)) +- Lock server before marshalling events ([9e13870](https://github.com/espressif/esp-protocols/commit/9e13870)) + +## [0.2.2](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.2.2) + +### Bug Fixes + +- Added more netif options for eppp connection ([24ce867](https://github.com/espressif/esp-protocols/commit/24ce867)) +- Do not restrict EPPP config to RSA keys only ([f05c765](https://github.com/espressif/esp-protocols/commit/f05c765), [#570](https://github.com/espressif/esp-protocols/issues/570)) + +## [0.2.1](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.2.1) + +### Bug Fixes + +- Added misc wifi API in eppp impl ([93256d1](https://github.com/espressif/esp-protocols/commit/93256d1)) +- Updated eppp dependency not to use fixed version ([3a48c06](https://github.com/espressif/esp-protocols/commit/3a48c06)) + +## [0.2.0](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.2.0) + +### Features + +- Add support for simple eppp based RPC ([fd168d8](https://github.com/espressif/esp-protocols/commit/fd168d8)) + +### Bug Fixes + +- Make services restartable, code cleanup ([6c82ce2](https://github.com/espressif/esp-protocols/commit/6c82ce2)) +- Add examples to CI ([d2b7c55](https://github.com/espressif/esp-protocols/commit/d2b7c55)) + +## [0.1.12](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.1.12) + +### Features + +- Added generation step for wifi_remote based on IDF ([dfb00358](https://github.com/espressif/esp-protocols/commit/dfb00358)) +- Move to esp-protocols ([edc3c2d](https://github.com/espressif/esp-protocols/commit/edc3c2d)) diff --git a/resources/espressif__esp_wifi_remote/CMakeLists.txt b/resources/espressif__esp_wifi_remote/CMakeLists.txt new file mode 100644 index 0000000..f1bc3f1 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/CMakeLists.txt @@ -0,0 +1,59 @@ +if(NOT CONFIG_ESP_WIFI_ENABLED AND NOT CONFIG_ESP_HOST_WIFI_ENABLED) + set(src_wifi_is_remote esp_wifi_remote.c esp_wifi_remote_net.c) +endif() + +if(CONFIG_ESP_WIFI_REMOTE_LIBRARY_EPPP) + set(src_wifi_remote_eppp eppp/wifi_remote_rpc_client.cpp eppp/wifi_remote_rpc_server.cpp eppp/eppp_init.c) +endif() + +idf_component_register(INCLUDE_DIRS include + SRCS ${src_wifi_is_remote} + ${src_wifi_remote_eppp} + PRIV_INCLUDE_DIRS eppp + REQUIRES esp_event esp_netif + PRIV_REQUIRES esp_wifi esp-tls vfs) + + +set(IDF_VER_DIR "${CMAKE_CURRENT_SOURCE_DIR}/idf_v${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}") + +# Check if we're on tagged version of ESP-IDF and if we need to supply specific version +string(REGEX MATCH "^v[0-9]+\\.[0-9]+(\\.[0-9]+)?(-dirty)?$" IDF_VER_TAG "${IDF_VER}") +if (IDF_VER_TAG) + string(REGEX REPLACE "-dirty$" "" IDF_VER_TAG "${IDF_VER_TAG}") + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/idf_tag_${IDF_VER_TAG}") + set(IDF_VER_DIR "${CMAKE_CURRENT_SOURCE_DIR}/idf_tag_${IDF_VER_TAG}") + endif() +endif() + +idf_component_get_property(wifi esp_wifi COMPONENT_LIB) + +set(TARGET_INCLUDE_TYPE "INTERFACE") +set(TARGET_SOURCE_TYPE "INTERFACE") +if(NOT CONFIG_ESP_WIFI_ENABLED AND NOT CONFIG_ESP_HOST_WIFI_ENABLED) + set(src_wifi_with_remote ${IDF_VER_DIR}/esp_wifi_with_remote.c) + # We need to build wifi sources with wifi-remote properties, so the injected wifi headers are used + get_target_property(wifi_sources ${wifi} SOURCES) + set_target_properties(${wifi} PROPERTIES SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/dummy_src.c") + set(TARGET_INCLUDE_TYPE "PUBLIC") + set(TARGET_SOURCE_TYPE "PRIVATE") +endif() + +if(CONFIG_ESP_WIFI_REMOTE_LIBRARY_EPPP) + set(TARGET_INCLUDE_TYPE "PUBLIC") + set(TARGET_SOURCE_TYPE "PRIVATE") +else() + set(src_wifi_remote_weak ${IDF_VER_DIR}/esp_wifi_remote_weak.c) +endif() + + +target_include_directories(${COMPONENT_LIB} ${TARGET_INCLUDE_TYPE} ${IDF_VER_DIR}/include) +target_sources(${COMPONENT_LIB} ${TARGET_SOURCE_TYPE} ${src_wifi_remote_weak} + ${src_wifi_with_remote} + ${wifi_sources}) + +# Update wifi include directories to prepend the injected dir with modified headers supporting SLAVE capability +get_target_property(original_wifi_dirs ${wifi} INTERFACE_INCLUDE_DIRECTORIES) +set(updated_wifi_dirs "${IDF_VER_DIR}/include/injected" ${original_wifi_dirs}) +set_target_properties(${wifi} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${updated_wifi_dirs}") + +target_link_libraries(${wifi} PUBLIC ${COMPONENT_LIB}) diff --git a/resources/espressif__esp_wifi_remote/Kconfig b/resources/espressif__esp_wifi_remote/Kconfig new file mode 100644 index 0000000..3dd2acc --- /dev/null +++ b/resources/espressif__esp_wifi_remote/Kconfig @@ -0,0 +1,34 @@ +menu "Wi-Fi Remote" + config ESP_WIFI_REMOTE_ENABLED + bool + default y if !ESP_HOST_WIFI_ENABLED + default n if ESP_HOST_WIFI_ENABLED + + if ESP_WIFI_REMOTE_ENABLED + orsource "./idf_v5.5/Kconfig.slave_select.in" + orsource "./idf_v5.5/Kconfig.soc_wifi_caps.in" + orsource "./Kconfig.rpc.in" + + menu "Wi-Fi configuration" + orsource "./idf_v5.5/Kconfig.wifi.in" + endmenu + endif + if !ESP_WIFI_REMOTE_ENABLED + + # This helper variables is only used to indicate that Wi-Fi remote if OFF + # and explains why + config ESP_WIFI_REMOTE_IS_DISABLED + bool "Wi-Fi Remote is disabled (Host Wi-Fi is ON)" + default y + help + Wi-Fi Remote is disabled because ESP_HOST_WIFI_ENABLED is ON. + These options are mutually exclusive. + Disable ESP_HOST_WIFI_ENABLED to use ESP_WIFI_REMOTE. + + config ESP_WIFI_REMOTE_FORCE_DISABLED + bool + default y + select ESP_WIFI_REMOTE_IS_DISABLED + endif + +endmenu # Wi-Fi Remote diff --git a/resources/espressif__esp_wifi_remote/Kconfig.rpc.in b/resources/espressif__esp_wifi_remote/Kconfig.rpc.in new file mode 100644 index 0000000..5c679b9 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/Kconfig.rpc.in @@ -0,0 +1,81 @@ +choice ESP_WIFI_REMOTE_LIBRARY + prompt "Choose WiFi-remote implementation" + default ESP_WIFI_REMOTE_LIBRARY_HOSTED + help + Select type of WiFi Remote implementation + + ESP-HOSTED is the default and most versatile option. + It's also possible to use EPPP, which uses PPPoS link between micros and NAPT, so it's slower + and less universal. + + config ESP_WIFI_REMOTE_LIBRARY_HOSTED + bool "ESP-HOSTED" + config ESP_WIFI_REMOTE_LIBRARY_EPPP + bool "EPPP" +endchoice + + if ESP_WIFI_REMOTE_LIBRARY_EPPP + + config ESP_WIFI_REMOTE_EPPP_UART_PORT + int "UART port number" + default 1 + range 0 3 + help + UART Port number. + + config ESP_WIFI_REMOTE_EPPP_UART_TX_PIN + int "TXD Pin Number" + default 10 + range 0 54 + help + Pin number of UART TX. + + config ESP_WIFI_REMOTE_EPPP_UART_RX_PIN + int "RXD Pin Number" + default 11 + range 0 54 + help + Pin number of UART RX. + + config ESP_WIFI_REMOTE_EPPP_NETIF_PRIORITY + int "Routing priority of eppp netif" + default 100 + range 0 256 + help + Set the priority of the wifi-remote netif. + The bigger the number the higher the priority. + The interface which is up and with the highest priority will act as a default GW. + + config ESP_WIFI_REMOTE_EPPP_NETIF_DESCRIPTION + string "eppp network interface description" + default "example_netif_sta" + help + Textual description of the wifi remote network interface. + By default it is set to "example_netif_sta" to be used in IDF protocol example + as default wifi station substitution. + + config ESP_WIFI_REMOTE_EPPP_SERVER_CA + string "Servers CA certificate" + default "--- Please copy content of the CA certificate ---" + + config ESP_WIFI_REMOTE_EPPP_CLIENT_CRT + string "Client certificate" + default "--- Please copy content of the Client certificate ---" + + config ESP_WIFI_REMOTE_EPPP_CLIENT_KEY + string "Client key" + default "--- Please copy content of the Client key ---" + + config ESP_WIFI_REMOTE_EPPP_CLIENT_CA + string "Clients CA certificate" + default "--- Please copy content of the CA certificate ---" + + config ESP_WIFI_REMOTE_EPPP_SERVER_CRT + string "Server certificate" + default "--- Please copy content of the Client certificate ---" + + config ESP_WIFI_REMOTE_EPPP_SERVER_KEY + string "Server key" + default "--- Please copy content of the Client key ---" + + endif diff --git a/resources/espressif__esp_wifi_remote/LICENSE b/resources/espressif__esp_wifi_remote/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/resources/espressif__esp_wifi_remote/README.md b/resources/espressif__esp_wifi_remote/README.md new file mode 100644 index 0000000..f15c9db --- /dev/null +++ b/resources/espressif__esp_wifi_remote/README.md @@ -0,0 +1,26 @@ +# esp_wifi_remote + +[![Component Registry](https://components.espressif.com/components/espressif/esp_wifi_remote/badge.svg)](https://components.espressif.com/components/espressif/esp_wifi_remote) + +The `esp_wifi_remote` component is designed to extend WiFi functionality to ESP chipsets that lack native WiFi support. By simply adding a dependency to this component from your project, you gain access to WiFi capabilities via the WiFi-remote menuconfig and standard `esp_wifi` interface. + +Moreover, `esp_wifi_remote` can be utilized on ESP chipsets that do support native WiFi, providing an additional WiFi interface through the `esp_wifi_remote` API. + +To employ this component, a slave device -- capable of WiFi connectivity -- must be connected to your target device in a specified manner, as defined by the transport layer of [`esp_hosted`](https://github.com/espressif/esp-hosted). + +Functionally, `esp_wifi_remote` wraps the public API of `esp_wifi`, offering a set of function call namespaces prefixed with esp_wifi_remote. These calls are translated into Remote Procedure Calls (RPC) to another target device (referred to as the "slave" device), which then executes the appropriate `esp_wifi` APIs. + +Notably, `esp_wifi_remote` heavily relies on a specific version of the `esp_wifi` component. Consequently, the majority of its headers, sources, and configuration files are pre-generated based on the actual version of `esp_wifi`. + +It's important to highlight that `esp_wifi_remote` does not directly implement the RPC calls; rather, it relies on dependencies for this functionality. Presently, only esp_hosted is supported to provide the RPC functionality required by esp_wifi_remote. + + +## Dependencies on `esp_wifi` + +Public API needs to correspond exactly to the `esp_wifi` API. Some of the internal types depend on the actual wifi target, as well as some default configuration values. Therefore it's easier to maintain consistency between this component and the exact version of `esp_wifi` automatically in CI: + +* We extract function prototypes from `esp_wifi.h` and use them to generate `esp_wifi_remote` function declarations. +* We process the local `esp_wifi_types_native.h` and replace `CONFIG_IDF_TARGET` to `CONFIG_SLAVE_IDF_TARGET` and `CONFIG_SOC_WIFI_...` to `CONFIG_SLAVE_....` +* Similarly we process `esp_wifi`'s Kconfig, so the dependencies are on the slave target and slave SOC capabilities. + +Please check the [README.md](./scripts/README.md) for more details on the generation step and testing consistency. diff --git a/resources/espressif__esp_wifi_remote/dummy_src.c b/resources/espressif__esp_wifi_remote/dummy_src.c new file mode 100644 index 0000000..e69de29 diff --git a/resources/espressif__esp_wifi_remote/eppp/eppp_init.c b/resources/espressif__esp_wifi_remote/eppp/eppp_init.c new file mode 100644 index 0000000..0fe8ab2 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/eppp/eppp_init.c @@ -0,0 +1,23 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#include "esp_log.h" +#include "esp_wifi.h" +#include "eppp_link.h" + +__attribute__((weak)) esp_netif_t *wifi_remote_eppp_init(eppp_type_t role) +{ + uint32_t our_ip = role == EPPP_SERVER ? EPPP_DEFAULT_SERVER_IP() : EPPP_DEFAULT_CLIENT_IP(); + uint32_t their_ip = role == EPPP_SERVER ? EPPP_DEFAULT_CLIENT_IP() : EPPP_DEFAULT_SERVER_IP(); + eppp_config_t config = EPPP_DEFAULT_CONFIG(our_ip, their_ip); + // We currently support only UART transport + config.transport = EPPP_TRANSPORT_UART; + config.uart.tx_io = CONFIG_ESP_WIFI_REMOTE_EPPP_UART_TX_PIN; + config.uart.rx_io = CONFIG_ESP_WIFI_REMOTE_EPPP_UART_RX_PIN; + config.uart.port = CONFIG_ESP_WIFI_REMOTE_EPPP_UART_PORT; + config.ppp.netif_description = CONFIG_ESP_WIFI_REMOTE_EPPP_NETIF_DESCRIPTION; + config.ppp.netif_prio = CONFIG_ESP_WIFI_REMOTE_EPPP_NETIF_PRIORITY; + return eppp_open(role, &config, portMAX_DELAY); +} diff --git a/resources/espressif__esp_wifi_remote/eppp/wifi_remote_rpc_client.cpp b/resources/espressif__esp_wifi_remote/eppp/wifi_remote_rpc_client.cpp new file mode 100644 index 0000000..53fd5c9 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/eppp/wifi_remote_rpc_client.cpp @@ -0,0 +1,318 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#include +#include +#include +#include "esp_log.h" +#include "esp_tls.h" +#include "esp_wifi.h" +#include "esp_check.h" +#include "wifi_remote_rpc_impl.hpp" +#include "eppp_link.h" +#include "freertos/FreeRTOS.h" +#include "freertos/event_groups.h" +#include "wifi_remote_rpc_params.h" + +extern "C" esp_netif_t *wifi_remote_eppp_init(eppp_type_t role); + +namespace eppp_rpc { + +namespace client { +const char *TAG = "rpc_client"; + +const unsigned char ca_crt[] = "-----BEGIN CERTIFICATE-----\n" CONFIG_ESP_WIFI_REMOTE_EPPP_SERVER_CA "\n-----END CERTIFICATE-----"; +const unsigned char crt[] = "-----BEGIN CERTIFICATE-----\n" CONFIG_ESP_WIFI_REMOTE_EPPP_CLIENT_CRT "\n-----END CERTIFICATE-----"; +const unsigned char key[] = "-----BEGIN PRIVATE KEY-----\n" CONFIG_ESP_WIFI_REMOTE_EPPP_CLIENT_KEY "\n-----END PRIVATE KEY-----"; +// TODO: Add option to supply keys and certs via a global symbol (file) + +} + +using namespace client; + +class Sync { + friend class RpcInstance; +public: + void lock() + { + xSemaphoreTake(mutex, portMAX_DELAY); + } + void unlock() + { + xSemaphoreGive(mutex); + } + esp_err_t init() + { + mutex = xSemaphoreCreateMutex(); + events = xEventGroupCreate(); + return mutex == nullptr || events == nullptr ? ESP_ERR_NO_MEM : ESP_OK; + } + esp_err_t wait_for(EventBits_t bits, uint32_t timeout = portMAX_DELAY) + { + return (xEventGroupWaitBits(events, bits, pdTRUE, pdTRUE, timeout) & bits) == bits ? ESP_OK : ESP_FAIL; + } + esp_err_t notify(EventBits_t bits) + { + xEventGroupSetBits(events, bits); + return ESP_OK; + } + ~Sync() + { + if (mutex) { + vSemaphoreDelete(mutex); + } + if (events) { + vEventGroupDelete(events); + } + } + + +private: + SemaphoreHandle_t mutex{nullptr}; + EventGroupHandle_t events{nullptr}; + + const int request = 1; + const int resp_header = 2; + const int resp_payload = 4; + const int restart = 8; +}; + +class RpcInstance { + friend class Sync; +public: + + template + esp_err_t send(api_id id, T *t) + { + pending_resp = id; + ESP_RETURN_ON_ERROR(sync.notify(sync.request), TAG, "failed to notify req"); + ESP_RETURN_ON_ERROR(rpc.send(id, t), TAG, "Failed to send request"); + return ESP_OK; + } + + // overload of the templated method (used for functions with no arguments) + esp_err_t send(api_id id) + { + pending_resp = id; + ESP_RETURN_ON_ERROR(sync.notify(sync.request), TAG, "failed to notify req"); + ESP_RETURN_ON_ERROR(rpc.send(id), TAG, "Failed to send request"); + return ESP_OK; + } + + template + T get_resp(api_id id) + { + sync.wait_for(sync.resp_header); + auto ret = rpc.template get_payload(id, pending_header); + sync.notify(sync.resp_payload); + return ret; + } + esp_err_t init() + { + ESP_RETURN_ON_FALSE(netif = wifi_remote_eppp_init(EPPP_CLIENT), ESP_FAIL, TAG, "Failed to connect to EPPP server"); + ESP_RETURN_ON_ERROR(esp_event_handler_register(IP_EVENT, IP_EVENT_PPP_GOT_IP, got_ip, this), TAG, "Failed to register event"); + ESP_RETURN_ON_ERROR(sync.init(), TAG, "Failed to init sync primitives"); + ESP_RETURN_ON_ERROR(rpc.init(), TAG, "Failed to init RPC engine"); + return xTaskCreate(task, "client", 8192, this, 5, nullptr) == pdTRUE ? ESP_OK : ESP_FAIL; + } + RpcEngine rpc{eppp_rpc::role::CLIENT}; + Sync sync; +private: + api_id pending_resp{api_id::UNDEF}; + RpcHeader pending_header{}; + esp_err_t process_ip_event(RpcHeader &header) + { + auto event = rpc.get_payload(api_id::IP_EVENT, header); + // Now bypass network layers with EPPP interface + ESP_RETURN_ON_ERROR(esp_netif_set_dns_info(netif, ESP_NETIF_DNS_MAIN, &event.dns), TAG, "Failed to set DNS info"); + ESP_RETURN_ON_ERROR(esp_netif_set_default_netif(netif), TAG, "Failed to set default netif to EPPP"); + ip_event_got_ip_t evt = { + .esp_netif = netif, + .ip_info = {}, + .ip_changed = true, + }; + esp_netif_get_ip_info(netif, &evt.ip_info); + ESP_RETURN_ON_ERROR(esp_event_post(IP_EVENT, IP_EVENT_STA_GOT_IP, &evt, sizeof(evt), 0), TAG, "Failed to post IP event"); + ESP_LOGI(TAG, "Main DNS:" IPSTR, IP2STR(&event.dns.ip.u_addr.ip4)); + ESP_LOGI(TAG, "EPPP IP:" IPSTR, IP2STR(&event.ppp_ip.ip)); + ESP_LOGI(TAG, "WIFI IP:" IPSTR, IP2STR(&event.wifi_ip.ip)); + ESP_LOGI(TAG, "WIFI GW:" IPSTR, IP2STR(&event.wifi_ip.gw)); + ESP_LOGI(TAG, "WIFI mask:" IPSTR, IP2STR(&event.wifi_ip.netmask)); + return ESP_OK; + } + esp_err_t process_wifi_event(RpcHeader &header) + { + auto event_id = rpc.get_payload(api_id::WIFI_EVENT, header); + ESP_RETURN_ON_ERROR(esp_event_post(WIFI_EVENT, event_id, nullptr, 0, 0), TAG, "Failed to post WiFi event"); + return ESP_OK; + } + esp_err_t perform() + { + auto header = rpc.get_header(); + if (api_id(header.id) == api_id::ERROR) { // network error + return ESP_FAIL; + } + if (api_id(header.id) == api_id::UNDEF) { // network timeout + return ESP_OK; + } + + if (api_id(header.id) == api_id::IP_EVENT) { + return process_ip_event(header); + } + if (api_id(header.id) == api_id::WIFI_EVENT) { + return process_wifi_event(header); + } + if (sync.wait_for(sync.request, 0) == ESP_OK && api_id(header.id) == pending_resp) { + pending_header = header; + pending_resp = api_id::UNDEF; + sync.notify(sync.resp_header); + sync.wait_for(sync.resp_payload); + return ESP_OK; + } + ESP_LOGE(TAG, "Unexpected header %" PRIi32, static_cast(header.id)); + return ESP_FAIL; + + } + static void task(void *ctx) + { + auto instance = static_cast(ctx); + do { + while (instance->perform() == ESP_OK) {} + } while (instance->restart() == ESP_OK); + vTaskDelete(nullptr); + } + esp_err_t restart() + { + rpc.deinit(); + ESP_RETURN_ON_ERROR(sync.wait_for(sync.restart, pdMS_TO_TICKS(10000)), TAG, "Didn't receive EPPP address in time"); + return rpc.init(); + } + static void got_ip(void *ctx, esp_event_base_t base, int32_t id, void *data) + { + auto instance = static_cast(ctx); + instance->sync.notify(instance->sync.restart); + } + esp_netif_t *netif{nullptr}; +}; + + +namespace client { +constinit RpcInstance instance; +} // namespace client + +RpcInstance *RpcEngine::init_client() +{ + char host[4 * 4 + 1] = {}; // IPv4: 4 x (3 numbers + '.') + \0 + esp_ip4_addr_t ip = { .addr = EPPP_DEFAULT_SERVER_IP() }; + if (esp_ip4addr_ntoa(&ip, host, sizeof(host)) == nullptr) { + return nullptr; + } + + esp_tls_cfg_t cfg = {}; + cfg.cacert_buf = client::ca_crt; + cfg.cacert_bytes = sizeof(client::ca_crt); + cfg.clientcert_buf = client::crt; + cfg.clientcert_bytes = sizeof(client::crt); + cfg.clientkey_buf = client::key; + cfg.clientkey_bytes = sizeof(client::key); + cfg.common_name = "espressif.local"; + + ESP_RETURN_ON_FALSE(tls_ = esp_tls_init(), nullptr, TAG, "Failed to create ESP-TLS instance"); + int retries = 0; + while (esp_tls_conn_new_sync(host, strlen(host), rpc_port, &cfg, tls_) <= 0) { + esp_tls_conn_destroy(tls_); + tls_ = nullptr; + ESP_RETURN_ON_FALSE(retries++ < 3, nullptr, TAG, "Failed to open connection to %s", host); + ESP_LOGW(TAG, "Connection to RPC server failed! Will retry in %d second(s)", retries); + vTaskDelay(pdMS_TO_TICKS(1000 * retries)); + ESP_RETURN_ON_FALSE(tls_ = esp_tls_init(), nullptr, TAG, "Failed to create ESP-TLS instance"); + } + return &client::instance; +} +} // namespace eppp_rpc + +// +// esp_wifi_remote API implementation +// +using namespace eppp_rpc; +using namespace client; + +extern "C" esp_err_t esp_wifi_remote_init(const wifi_init_config_t *config) +{ + // Here we initialize this client's RPC + ESP_RETURN_ON_ERROR(instance.init(), TAG, "Failed to initialize eppp-rpc"); + + std::lock_guard lock(instance.sync); + ESP_RETURN_ON_ERROR(instance.send(api_id::INIT, config), TAG, "Failed to send request"); + return instance.get_resp(api_id::INIT); +} + +extern "C" esp_err_t esp_wifi_remote_set_config(wifi_interface_t interface, wifi_config_t *conf) +{ + esp_wifi_remote_config params = { .interface = interface, .conf = {} }; + memcpy(¶ms.conf, conf, sizeof(wifi_config_t)); + std::lock_guard lock(instance.sync); + ESP_RETURN_ON_ERROR(instance.send(api_id::SET_CONFIG, ¶ms), TAG, "Failed to send request"); + return instance.get_resp(api_id::SET_CONFIG); +} + +extern "C" esp_err_t esp_wifi_remote_start(void) +{ + std::lock_guard lock(instance.sync); + ESP_RETURN_ON_ERROR(instance.send(api_id::START), TAG, "Failed to send request"); + return instance.get_resp(api_id::START); +} + +extern "C" esp_err_t esp_wifi_remote_stop(void) +{ + std::lock_guard lock(instance.sync); + ESP_RETURN_ON_ERROR(instance.send(api_id::STOP), TAG, "Failed to send request"); + return instance.get_resp(api_id::STOP); +} + +extern "C" esp_err_t esp_wifi_remote_connect(void) +{ + std::lock_guard lock(instance.sync); + ESP_RETURN_ON_ERROR(instance.send(api_id::CONNECT), TAG, "Failed to send request"); + return instance.get_resp(api_id::CONNECT); +} + +extern "C" esp_err_t esp_wifi_remote_get_mac(wifi_interface_t ifx, uint8_t mac[6]) +{ + std::lock_guard lock(instance.sync); + ESP_RETURN_ON_ERROR(instance.send(api_id::GET_MAC, &ifx), TAG, "Failed to send request"); + auto ret = instance.get_resp(api_id::GET_MAC); + ESP_LOG_BUFFER_HEXDUMP("MAC", ret.mac, 6, ESP_LOG_DEBUG); + memcpy(mac, ret.mac, 6); + return ret.err; +} + +extern "C" esp_err_t esp_wifi_remote_set_mode(wifi_mode_t mode) +{ + std::lock_guard lock(instance.sync); + ESP_RETURN_ON_ERROR(instance.send(api_id::SET_MODE, &mode), TAG, "Failed to send request"); + return instance.get_resp(api_id::SET_MODE); +} + +extern "C" esp_err_t esp_wifi_remote_deinit(void) +{ + std::lock_guard lock(instance.sync); + ESP_RETURN_ON_ERROR(instance.send(api_id::DEINIT), TAG, "Failed to send request"); + return instance.get_resp(api_id::DEINIT); +} + +extern "C" esp_err_t esp_wifi_remote_disconnect(void) +{ + std::lock_guard lock(instance.sync); + ESP_RETURN_ON_ERROR(instance.send(api_id::DISCONNECT), TAG, "Failed to send request"); + return instance.get_resp(api_id::DISCONNECT); +} + +extern "C" esp_err_t esp_wifi_remote_set_storage(wifi_storage_t storage) +{ + std::lock_guard lock(instance.sync); + ESP_RETURN_ON_ERROR(instance.send(api_id::SET_STORAGE, &storage), TAG, "Failed to send request"); + return instance.get_resp(api_id::SET_STORAGE); +} diff --git a/resources/espressif__esp_wifi_remote/eppp/wifi_remote_rpc_impl.hpp b/resources/espressif__esp_wifi_remote/eppp/wifi_remote_rpc_impl.hpp new file mode 100644 index 0000000..7847533 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/eppp/wifi_remote_rpc_impl.hpp @@ -0,0 +1,179 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#pragma once +#include +#include + +namespace eppp_rpc { + +static constexpr int rpc_port = 3333; + +/** + * @brief Currently supported RPC commands/events + */ +enum class api_id : uint32_t { + ERROR, + UNDEF, + INIT, + DEINIT, + SET_MODE, + SET_CONFIG, + START, + STOP, + CONNECT, + DISCONNECT, + GET_MAC, + SET_STORAGE, + WIFI_EVENT, + IP_EVENT, +}; + +enum class role { + SERVER, + CLIENT, +}; + +struct RpcHeader { + api_id id; + uint32_t size; +} __attribute((__packed__)); + +/** + * @brief Structure holding the outgoing or incoming parameter + */ +template +struct RpcData { + RpcHeader head; + T value_{}; + explicit RpcData(api_id id) : head{id, sizeof(T)} {} + + uint8_t *value() + { + return (uint8_t *) &value_; + } + + uint8_t *marshall(T *t, size_t &size) + { + size = head.size + sizeof(RpcHeader); + memcpy(value(), t, sizeof(T)); + return (uint8_t *) this; + } +} __attribute((__packed__)); + +/** + * @brief Singleton holding the static data for either the client or server side + */ +class RpcInstance; + +/** + * @brief Engine that implements a simple RPC mechanism + */ +class RpcEngine { +public: + constexpr explicit RpcEngine(role r) : tls_(nullptr), role_(r) {} + + esp_err_t init() + { + if (tls_ != nullptr) { + return ESP_OK; + } + if (role_ == role::CLIENT) { + instance = init_client(); + } + if (role_ == role::SERVER) { + instance = init_server(); + } + return instance == nullptr ? ESP_FAIL : ESP_OK; + } + + void deinit() + { + if (tls_ == nullptr) { + return; + } + if (role_ == role::CLIENT) { + esp_tls_conn_destroy(tls_); + } else if (role_ == role::SERVER) { + esp_tls_server_session_delete(tls_); + } + tls_ = nullptr; + } + + template + esp_err_t send(api_id id, T *t) + { + RpcData req(id); + size_t size; + auto buf = req.marshall(t, size); + ESP_LOGD("rpc", "Sending API id:%d", (int) id); + ESP_LOG_BUFFER_HEXDUMP("rpc", buf, size, ESP_LOG_VERBOSE); + int len = esp_tls_conn_write(tls_, buf, size); + if (len <= 0) { + ESP_LOGE("rpc", "Failed to write data to the connection"); + return ESP_FAIL; + } + return ESP_OK; + } + + esp_err_t send(api_id id) // overload for (void) + { + RpcHeader head = {.id = id, .size = 0}; + int len = esp_tls_conn_write(tls_, &head, sizeof(head)); + if (len <= 0) { + ESP_LOGE("rpc", "Failed to write data to the connection"); + return ESP_FAIL; + } + return ESP_OK; + } + + int get_socket_fd() + { + int sock; + if (esp_tls_get_conn_sockfd(tls_, &sock) != ESP_OK) { + return -1; + } + return sock; + } + + RpcHeader get_header() + { + RpcHeader header{}; + int len = esp_tls_conn_read(tls_, (char *) &header, sizeof(header)); + if (len <= 0) { + if (len < 0 && errno != EAGAIN) { + ESP_LOGE("rpc", "Failed to read header data from the connection %d %s", errno, strerror(errno)); + return {.id = api_id::ERROR, .size = 0}; + } + return {.id = api_id::UNDEF, .size = 0}; + } + return header; + } + + template + T get_payload(api_id id, RpcHeader &head) + { + RpcData resp(id); + if (head.id != id || head.size != resp.head.size) { + ESP_LOGE("rpc", "unexpected header %d %d or sizes %" PRIu32 " %" PRIu32, (int)head.id, (int)id, head.size, resp.head.size); + return {}; + } + int len = esp_tls_conn_read(tls_, (char *) resp.value(), resp.head.size); + if (len <= 0) { + ESP_LOGE("rpc", "Failed to read data from the connection"); + return {}; + } + return resp.value_; + } + +private: + RpcInstance *init_server(); + RpcInstance *init_client(); + esp_tls_t *tls_; + role role_; + RpcInstance *instance{nullptr}; +}; + +}; diff --git a/resources/espressif__esp_wifi_remote/eppp/wifi_remote_rpc_params.h b/resources/espressif__esp_wifi_remote/eppp/wifi_remote_rpc_params.h new file mode 100644 index 0000000..700eae2 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/eppp/wifi_remote_rpc_params.h @@ -0,0 +1,23 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#pragma once + +struct esp_wifi_remote_config { + wifi_interface_t interface; + wifi_config_t conf; +}; + +struct esp_wifi_remote_mac_t { + esp_err_t err; + uint8_t mac[6]; +}; + +struct esp_wifi_remote_eppp_ip_event { + int32_t id; + esp_netif_ip_info_t wifi_ip; + esp_netif_ip_info_t ppp_ip; + esp_netif_dns_info_t dns; +}; diff --git a/resources/espressif__esp_wifi_remote/eppp/wifi_remote_rpc_server.cpp b/resources/espressif__esp_wifi_remote/eppp/wifi_remote_rpc_server.cpp new file mode 100644 index 0000000..36e7c8b --- /dev/null +++ b/resources/espressif__esp_wifi_remote/eppp/wifi_remote_rpc_server.cpp @@ -0,0 +1,383 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#include +#include +#include +#include +#include "esp_log.h" +#include "esp_check.h" +#include "esp_tls.h" +#include "esp_wifi.h" +#include "wifi_remote_rpc_impl.hpp" +#include "eppp_link.h" +#include "wifi_remote_rpc_params.h" +#include "lwip/apps/snmp.h" +#include "esp_vfs.h" +#include "esp_vfs_eventfd.h" + +extern "C" esp_netif_t *wifi_remote_eppp_init(eppp_type_t role); + +namespace eppp_rpc { + +namespace server { +const char *TAG = "rpc_server"; + +const unsigned char ca_crt[] = "-----BEGIN CERTIFICATE-----\n" CONFIG_ESP_WIFI_REMOTE_EPPP_CLIENT_CA "\n-----END CERTIFICATE-----"; +const unsigned char crt[] = "-----BEGIN CERTIFICATE-----\n" CONFIG_ESP_WIFI_REMOTE_EPPP_SERVER_CRT "\n-----END CERTIFICATE-----"; +const unsigned char key[] = "-----BEGIN PRIVATE KEY-----\n" CONFIG_ESP_WIFI_REMOTE_EPPP_SERVER_KEY "\n-----END PRIVATE KEY-----"; +// TODO: Add option to supply keys and certs via a global symbol (file) + +} + +using namespace server; + +struct Events { + api_id type; + int32_t id; + esp_wifi_remote_eppp_ip_event *ip_data{nullptr}; + bool clean_ip_data{true}; + esp_err_t create_ip_data() + { + ip_data = new (std::nothrow) esp_wifi_remote_eppp_ip_event; + return ip_data ? ESP_OK : ESP_ERR_NO_MEM; + } + ~Events() + { + if (clean_ip_data) { + delete ip_data; + } + } +}; + +class Sync { + friend class RpcInstance; +public: + esp_err_t put(Events &ev) + { + ESP_RETURN_ON_FALSE(xQueueSend(queue, &ev, pdMS_TO_TICKS(queue_timeout)), ESP_FAIL, TAG, "Failed to queue event %" PRIi32, ev.id); + ev.clean_ip_data = false; // IP data were successfully sent to the queue, will free manually after receiving from it + uint64_t event_queued = 1; + write(fd, &event_queued, sizeof(event_queued)); // trigger the wait loop that + return ESP_OK; + } + Events get() + { + Events ev{}; + if (!xQueueReceive(queue, &ev, 0)) { + ev.type = api_id::ERROR; + } + return ev; + } + esp_err_t init() + { + queue = xQueueCreate(max_items, sizeof(Events)); + esp_vfs_eventfd_config_t config = ESP_VFS_EVENTD_CONFIG_DEFAULT(); + esp_vfs_eventfd_register(&config); + fd = eventfd(0, EFD_SUPPORT_ISR); + return queue == nullptr || fd < 0 ? ESP_ERR_NO_MEM : ESP_OK; + } + ~Sync() + { + if (queue) { + vQueueDelete(queue); + } + if (fd >= 0) { + close(fd); + } + } + int fd{-1}; + // Used to trigger task by either an internal event or rpc command + static const int NONE = 0; + static const int ERROR = 1; + static const int EVENT = 2; + static const int RPC = 4; +private: + QueueHandle_t queue{nullptr}; + const int max_items = 15; + const int queue_timeout = 200; +}; + +class RpcInstance { + friend class Sync; +public: + RpcEngine rpc{role::SERVER}; + int sock{-1}; + + esp_err_t init() + { + ESP_RETURN_ON_FALSE(netif = wifi_remote_eppp_init(EPPP_SERVER), ESP_FAIL, TAG, "Failed to init EPPP connection"); + ESP_RETURN_ON_ERROR(start_server(), TAG, "Failed to start RPC server"); + ESP_RETURN_ON_ERROR(rpc.init(), TAG, "Failed to init RPC engine"); + ESP_RETURN_ON_ERROR(esp_netif_napt_enable(netif), TAG, "Failed to enable NAPT"); + ESP_RETURN_ON_ERROR(sync.init(), TAG, "Failed to init event queue"); + ESP_RETURN_ON_ERROR(esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, handler, this), TAG, "Failed to register event"); + ESP_RETURN_ON_ERROR(esp_event_handler_register(IP_EVENT, ESP_EVENT_ANY_ID, handler, this), TAG, "Failed to register event"); + return xTaskCreate(task, "server", 8192, this, 5, nullptr) == pdTRUE ? ESP_OK : ESP_FAIL; + } + Sync sync; +private: + esp_netif_t *netif{nullptr}; + static void task(void *ctx) + { + auto instance = static_cast(ctx); + while (instance->perform() == ESP_OK) {} + esp_restart(); + } + esp_err_t start_server() + { + struct sockaddr_in dest_addr = {}; + int ret; + int opt = 1; + dest_addr.sin_addr.s_addr = htonl(INADDR_ANY); + dest_addr.sin_family = AF_INET; + dest_addr.sin_port = htons(rpc_port); + int listen_sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); + ESP_RETURN_ON_FALSE(listen_sock >= 0, ESP_FAIL, TAG, "Failed to create listening socket"); + setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)); + ret = bind(listen_sock, (struct sockaddr *) &dest_addr, sizeof(dest_addr)); + ESP_RETURN_ON_FALSE(ret == 0, ESP_FAIL, TAG, "Failed to bind the listening socket"); + ret = listen(listen_sock, 1); + ESP_RETURN_ON_FALSE(ret == 0, ESP_FAIL, TAG, "Failed to start listening"); + struct sockaddr_storage source_addr {}; + socklen_t addr_len = sizeof(source_addr); + sock = accept(listen_sock, (struct sockaddr *) &source_addr, &addr_len); + ESP_RETURN_ON_FALSE(sock >= 0, ESP_FAIL, TAG, "Failed to accept connections: errno %d", errno); + ESP_LOGI(TAG, "Socket accepted on: %s", inet_ntoa(((struct sockaddr_in *) &source_addr)->sin_addr)); + return ESP_OK; + } + esp_err_t wifi_event(int32_t id) + { + ESP_LOGI(TAG, "Received WIFI event %" PRIi32, id); + Events ev{api_id::WIFI_EVENT, id, nullptr}; + ESP_RETURN_ON_ERROR(sync.put(ev), TAG, "Failed to queue WiFi event"); + return ESP_OK; + } + esp_err_t ip_event(int32_t id, ip_event_got_ip_t *ip_data) + { + ESP_LOGI(TAG, "Received IP event %" PRIi32, id); + Events ev{api_id::IP_EVENT, id, nullptr}; + if (ip_data->esp_netif) { + ESP_RETURN_ON_ERROR(ev.create_ip_data(), TAG, "Failed to allocate event data"); + ev.ip_data->id = id; + ESP_RETURN_ON_ERROR(esp_netif_get_dns_info(ip_data->esp_netif, ESP_NETIF_DNS_MAIN, &ev.ip_data->dns), TAG, "Failed to get DNS info"); + ESP_LOGI(TAG, "Main DNS:" IPSTR, IP2STR(&ev.ip_data->dns.ip.u_addr.ip4)); + memcpy(&ev.ip_data->wifi_ip, &ip_data->ip_info, sizeof(ev.ip_data->wifi_ip)); + ESP_RETURN_ON_ERROR(esp_netif_get_ip_info(netif, &ev.ip_data->ppp_ip), TAG, "Failed to get IP info"); + ESP_LOGI(TAG, "IP address:" IPSTR, IP2STR(&ip_data->ip_info.ip)); + } + ESP_RETURN_ON_ERROR(sync.put(ev), TAG, "Failed to queue IP event"); + return ESP_OK; + } + static void handler(void *ctx, esp_event_base_t base, int32_t id, void *data) + { + auto instance = static_cast(ctx); + if (base == WIFI_EVENT) { + instance->wifi_event(id); + } else if (base == IP_EVENT) { + auto *ip_data = (ip_event_got_ip_t *)data; + instance->ip_event(id, ip_data); + } + } + int select() + { + struct timeval timeout = { .tv_sec = 1, .tv_usec = 0}; + int rpc_sock = rpc.get_socket_fd(); + + ESP_RETURN_ON_FALSE(rpc_sock != -1, Sync::ERROR, TAG, "failed ot get rpc socket"); + fd_set readset; + fd_set errset; + FD_ZERO(&readset); + FD_ZERO(&errset); + FD_SET(rpc_sock, &readset); + FD_SET(sync.fd, &readset); + FD_SET(rpc_sock, &errset); + int ret = ::select(std::max(rpc_sock, 5) + 1, &readset, nullptr, &errset, &timeout); + if (ret == 0) { + ESP_LOGV(TAG, "poll_read: select - Timeout before any socket was ready!"); + return Sync::NONE; + } + if (ret < 0) { + ESP_LOGE(TAG, "select error: %d", errno); + return Sync::ERROR; + } + if (FD_ISSET(rpc_sock, &errset)) { + int sock_errno = 0; + uint32_t optlen = sizeof(sock_errno); + getsockopt(rpc_sock, SOL_SOCKET, SO_ERROR, &sock_errno, &optlen); + ESP_LOGE(TAG, "select failed, socket errno = %d", sock_errno); + return Sync::ERROR; + } + int result = Sync::NONE; + if (FD_ISSET(rpc_sock, &readset)) { + result |= Sync::RPC; + } + if (FD_ISSET(sync.fd, &readset)) { + result |= Sync::EVENT; + } + return result; + } + esp_err_t marshall_events() + { + api_id type; + do { + Events ev = sync.get(); + type = ev.type; + if (ev.type == api_id::WIFI_EVENT) { + ESP_RETURN_ON_ERROR(rpc.send(api_id::WIFI_EVENT, &ev.id), TAG, "Failed to marshall WiFi event"); + } else if (ev.type == api_id::IP_EVENT && ev.ip_data) { + ESP_RETURN_ON_ERROR(rpc.send(api_id::IP_EVENT, ev.ip_data), TAG, "Failed to marshal IP event"); + } + } while (type != api_id::ERROR); + return ESP_OK; + } + esp_err_t perform() + { + auto res = select(); + if (res == Sync::ERROR) { + return ESP_FAIL; + } + if (res & Sync::EVENT) { + uint64_t data; + read(sync.fd, &data, sizeof(data)); + if (marshall_events() != ESP_OK) { + return ESP_FAIL; + } + } + if (res & Sync::RPC) { + if (handle_commands() != ESP_OK) { + return ESP_FAIL; + } + } + return ESP_OK; + } + + esp_err_t handle_commands() + { + auto header = rpc.get_header(); + ESP_LOGI(TAG, "Received header id %d", (int) header.id); + switch (header.id) { + case api_id::SET_MODE: { + auto req = rpc.get_payload(api_id::SET_MODE, header); + auto ret = esp_wifi_set_mode(req); + if (rpc.send(api_id::SET_MODE, &ret) != ESP_OK) { + return ESP_FAIL; + } + break; + } + case api_id::INIT: { + auto req = rpc.get_payload(api_id::INIT, header); + req.osi_funcs = &g_wifi_osi_funcs; + req.wpa_crypto_funcs = g_wifi_default_wpa_crypto_funcs; + auto ret = esp_wifi_init(&req); + if (rpc.send(api_id::INIT, &ret) != ESP_OK) { + return ESP_FAIL; + } + break; + } + case api_id::SET_CONFIG: { + auto req = rpc.get_payload(api_id::SET_CONFIG, header); + auto ret = esp_wifi_set_config(req.interface, &req.conf); + if (rpc.send(api_id::SET_CONFIG, &ret) != ESP_OK) { + return ESP_FAIL; + } + break; + } + case api_id::START: { + if (header.size != 0) { + return ESP_FAIL; + } + + auto ret = esp_wifi_start(); + if (rpc.send(api_id::START, &ret) != ESP_OK) { + return ESP_FAIL; + } + break; + } + case api_id::CONNECT: { + if (header.size != 0) { + return ESP_FAIL; + } + + auto ret = esp_wifi_connect(); + if (rpc.send(api_id::CONNECT, &ret) != ESP_OK) { + return ESP_FAIL; + } + break; + } + case api_id::DISCONNECT: { + if (header.size != 0) { + return ESP_FAIL; + } + + auto ret = esp_wifi_disconnect(); + if (rpc.send(api_id::DISCONNECT, &ret) != ESP_OK) { + return ESP_FAIL; + } + break; + } + case api_id::DEINIT: { + if (header.size != 0) { + return ESP_FAIL; + } + + auto ret = esp_wifi_deinit(); + if (rpc.send(api_id::DEINIT, &ret) != ESP_OK) { + return ESP_FAIL; + } + break; + } + case api_id::SET_STORAGE: { + auto req = rpc.get_payload(api_id::SET_STORAGE, header); + auto ret = esp_wifi_set_storage(req); + if (rpc.send(api_id::SET_STORAGE, &ret) != ESP_OK) { + return ESP_FAIL; + } + break; + } + case api_id::GET_MAC: { + auto req = rpc.get_payload(api_id::GET_MAC, header); + esp_wifi_remote_mac_t resp = {}; + resp.err = esp_wifi_get_mac(req, resp.mac); + if (rpc.send(api_id::GET_MAC, &resp) != ESP_OK) { + return ESP_FAIL; + } + break; + } + default: + return ESP_FAIL; + } + return ESP_OK; + } +}; + + +namespace server { +constinit RpcInstance instance; +} + +RpcInstance *RpcEngine::init_server() +{ + esp_tls_cfg_server_t cfg = {}; + cfg.cacert_buf = server::ca_crt; + cfg.cacert_bytes = sizeof(server::ca_crt); + cfg.servercert_buf = server::crt; + cfg.servercert_bytes = sizeof(server::crt); + cfg.serverkey_buf = server::key; + cfg.serverkey_bytes = sizeof(server::key); + + ESP_RETURN_ON_FALSE(tls_ = esp_tls_init(), nullptr, TAG, "Failed to create ESP-TLS instance"); + ESP_RETURN_ON_FALSE(esp_tls_server_session_create(&cfg, server::instance.sock, tls_) == ESP_OK, nullptr, TAG, "Failed to create TLS session"); + return &server::instance; +} + +} // namespace eppp_rpc + +using namespace eppp_rpc; + +extern "C" esp_err_t server_init(void) +{ + return server::instance.init(); +} diff --git a/resources/espressif__esp_wifi_remote/esp_wifi_remote.c b/resources/espressif__esp_wifi_remote/esp_wifi_remote.c new file mode 100644 index 0000000..adf9fe3 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/esp_wifi_remote.c @@ -0,0 +1,34 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp_wifi.h" +#include "esp_log.h" +#include "esp_wifi_remote.h" + +#define WEAK __attribute__((weak)) + +WEAK ESP_EVENT_DEFINE_BASE(WIFI_EVENT); + +#if !CONFIG_SOC_WIFI_SUPPORTED +struct wifi_osi_funcs_t { }; +#endif + +WEAK wifi_osi_funcs_t g_wifi_osi_funcs; +WEAK const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs; +WEAK uint64_t g_wifi_feature_caps = +#if CONFIG_ESP_WIFI_ENABLE_WPA3_SAE + CONFIG_FEATURE_WPA3_SAE_BIT | +#endif +#if CONFIG_SPIRAM + CONFIG_FEATURE_CACHE_TX_BUF_BIT | +#endif +#if CONFIG_ESP_WIFI_FTM_INITIATOR_SUPPORT + CONFIG_FEATURE_FTM_INITIATOR_BIT | +#endif +#if CONFIG_ESP_WIFI_FTM_RESPONDER_SUPPORT + CONFIG_FEATURE_FTM_RESPONDER_BIT | +#endif + 0; diff --git a/resources/espressif__esp_wifi_remote/esp_wifi_remote_net.c b/resources/espressif__esp_wifi_remote/esp_wifi_remote_net.c new file mode 100644 index 0000000..6c56b42 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/esp_wifi_remote_net.c @@ -0,0 +1,94 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#include +#include "esp_err.h" +#include "esp_wifi_remote.h" +#include "esp_log.h" + +#define CHANNELS 2 +#define WEAK __attribute__((weak)) + +static esp_remote_channel_tx_fn_t s_tx_cb[CHANNELS]; +static esp_remote_channel_t s_channel[CHANNELS]; +static wifi_rxcb_t s_rx_fn[CHANNELS]; + +WEAK esp_err_t esp_wifi_remote_channel_rx(void *h, void *buffer, void *buff_to_free, size_t len) +{ + assert(h); + if (h == s_channel[0] && s_rx_fn[0]) { + return s_rx_fn[0](buffer, len, buff_to_free); + } + if (h == s_channel[1] && s_rx_fn[1]) { + return s_rx_fn[1](buffer, len, buff_to_free); + } + return ESP_FAIL; +} + +WEAK esp_err_t esp_wifi_remote_channel_set(wifi_interface_t ifx, void *h, esp_remote_channel_tx_fn_t tx_cb) +{ + if (ifx == WIFI_IF_STA) { + s_channel[0] = h; + s_tx_cb[0] = tx_cb; + return ESP_OK; + } + if (ifx == WIFI_IF_AP) { + s_channel[1] = h; + s_tx_cb[1] = tx_cb; + return ESP_OK; + } + return ESP_FAIL; +} + +WEAK esp_err_t esp_wifi_internal_set_sta_ip(void) +{ + // TODO: Pass this information to the slave target + // Note that this function is called from the default event loop, so we shouldn't block here + return ESP_OK; +} + +WEAK esp_err_t esp_wifi_internal_reg_netstack_buf_cb(wifi_netstack_buf_ref_cb_t ref, wifi_netstack_buf_free_cb_t free) +{ + return ESP_OK; +} + +WEAK void esp_wifi_internal_free_rx_buffer(void *buffer) +{ + free(buffer); +} + +WEAK esp_err_t esp_wifi_internal_tx_by_ref(wifi_interface_t ifx, void *buffer, size_t len, void *netstack_buf) +{ + return esp_wifi_internal_tx(ifx, buffer, (uint16_t)len); +} + +WEAK int esp_wifi_internal_tx(wifi_interface_t ifx, void *buffer, uint16_t len) +{ + if (ifx == WIFI_IF_STA && s_tx_cb[0]) { + + /* TODO: If not needed, remove arg3 */ + return s_tx_cb[0](s_channel[0], buffer, len); + } + if (ifx == WIFI_IF_AP && s_tx_cb[1]) { + return s_tx_cb[1](s_channel[1], buffer, len); + } + + return -1; +} + +WEAK esp_err_t esp_wifi_internal_reg_rxcb(wifi_interface_t ifx, wifi_rxcb_t fn) +{ + if (ifx == WIFI_IF_STA) { + ESP_LOGI("esp_wifi_remote", "%s: sta: %p", __func__, fn); + s_rx_fn[0] = fn; + return ESP_OK; + } + if (ifx == WIFI_IF_AP) { + s_rx_fn[1] = fn; + return ESP_OK; + } + + return ESP_FAIL; +} diff --git a/resources/espressif__esp_wifi_remote/examples/mqtt/CMakeLists.txt b/resources/espressif__esp_wifi_remote/examples/mqtt/CMakeLists.txt new file mode 100644 index 0000000..500c42d --- /dev/null +++ b/resources/espressif__esp_wifi_remote/examples/mqtt/CMakeLists.txt @@ -0,0 +1,5 @@ +# This project serves as a demo to enable using esp-mqtt on ESP platform targets as well as on linux +cmake_minimum_required(VERSION 3.16) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(esp_mqtt_demo) diff --git a/resources/espressif__esp_wifi_remote/examples/mqtt/README.md b/resources/espressif__esp_wifi_remote/examples/mqtt/README.md new file mode 100644 index 0000000..0c81f4e --- /dev/null +++ b/resources/espressif__esp_wifi_remote/examples/mqtt/README.md @@ -0,0 +1,31 @@ +# MQTT application running on WiFi station + +This is a simple mqtt demo, that connects to WiFi AP first. This application has a dependency to `esp_wifi_remote`, so that if it's build and executed on a chipset without WiFI capabilities it redirects all wifi calls the remote target. + +## Overview + +When running this example on a target that doesn't natively support WiFi, please make sure that the remote target (slave application) is connected to your chipset via the configured transport interface. + +Connection to the slave device also depends on RPC library used. It is recommended to use [`esp_hosted`](https://github.com/espressif/esp-hosted). Alternatively you can use [`eppp_link`](https://components.espressif.com/components/espressif/eppp_link). + +Please note, that `esp_hosted` as a component is currently WIP, so the `wifi_remote` defaults to `eppp`, for now. + +## HW connection + +We currently support only `UART` transport, so the connection is very simple. You only need to connect Rx, Tx and GND with the remote target. +You need to configure these fields according to your connection: +* CONFIG_ESP_WIFI_REMOTE_EPPP_UART_TX_PIN +* CONFIG_ESP_WIFI_REMOTE_EPPP_UART_RX_PIN + +## SW configuration + +The RPC mechanism between the host and the slave micro uses TLS with mutual authentication, so you would have to configure certificates and keys for both parties. This application -- host target -- is considered RPC client, so it needs client's certificate and key, as well as the CA certificate to validate the server (slave application). +If self-signed certificates are acceptable, you can use [generate_test_certs](../test_certs/generate_test_certs.sh) script to generate both the CA and the keys itself and convert them to the PEM format that's accepted by the EPPP RPC engine. +You will have to configure these options: +* CONFIG_ESP_WIFI_REMOTE_EPPP_SERVER_CA +* CONFIG_ESP_WIFI_REMOTE_EPPP_CLIENT_CRT +* CONFIG_ESP_WIFI_REMOTE_EPPP_CLIENT_KEY + +## Setting up slave device + +You need to set up the connection and configuration in a similar way on the slave part (connection pins + certificates and keys). Please refer to the [slave_application](../server/README.md) README for more information. diff --git a/resources/espressif__esp_wifi_remote/examples/mqtt/main/CMakeLists.txt b/resources/espressif__esp_wifi_remote/examples/mqtt/main/CMakeLists.txt new file mode 100644 index 0000000..d6e9824 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/examples/mqtt/main/CMakeLists.txt @@ -0,0 +1,4 @@ +idf_component_register(SRCS "app_main.c" + INCLUDE_DIRS ".") + +target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/resources/espressif__esp_wifi_remote/examples/mqtt/main/Kconfig.projbuild b/resources/espressif__esp_wifi_remote/examples/mqtt/main/Kconfig.projbuild new file mode 100644 index 0000000..7ad4dc2 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/examples/mqtt/main/Kconfig.projbuild @@ -0,0 +1,21 @@ +menu "Example Configuration" + + config BROKER_URL + string "Broker URL" + default "mqtt://mqtt.eclipseprojects.io" + help + URL of the broker to connect to + + config ESP_WIFI_SSID + string "WiFi SSID" + default "myssid" + help + SSID (network name) for the example to connect to. + + config ESP_WIFI_PASSWORD + string "WiFi Password" + default "mypassword" + help + WiFi password (WPA or WPA2) for the example to use. + +endmenu diff --git a/resources/espressif__esp_wifi_remote/examples/mqtt/main/app_main.c b/resources/espressif__esp_wifi_remote/examples/mqtt/main/app_main.c new file mode 100644 index 0000000..07b60ab --- /dev/null +++ b/resources/espressif__esp_wifi_remote/examples/mqtt/main/app_main.c @@ -0,0 +1,204 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Unlicense OR CC0-1.0 + */ +#include +#include +#include +#include +#include "esp_system.h" +#include "nvs_flash.h" +#include "esp_event.h" +#include "esp_netif.h" +#include "esp_netif.h" +#include "esp_system.h" +#include "freertos/FreeRTOS.h" +#include "freertos/event_groups.h" +#include "esp_system.h" +#include "esp_wifi.h" + +#include "esp_log.h" +#include "mqtt_client.h" + +static const char *TAG = "esp_mqtt_demo"; +static EventGroupHandle_t s_wifi_event_group; +static int s_retry_num = 0; + +#define WIFI_CONNECTED_BIT BIT0 +#define WIFI_FAIL_BIT BIT1 + +#define EXAMPLE_ESP_WIFI_SSID CONFIG_ESP_WIFI_SSID +#define EXAMPLE_ESP_WIFI_PASS CONFIG_ESP_WIFI_PASSWORD +#define EXAMPLE_ESP_MAXIMUM_RETRY 5 + +static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data) +{ + ESP_LOGD(TAG, "Event dispatched from event loop base=%s, event_id=%d", base, event_id); + esp_mqtt_event_handle_t event = (esp_mqtt_event_handle_t)event_data; + esp_mqtt_client_handle_t client = event->client; + int msg_id; + switch ((esp_mqtt_event_id_t)event_id) { + case MQTT_EVENT_CONNECTED: + ESP_LOGI(TAG, "MQTT_EVENT_CONNECTED"); + msg_id = esp_mqtt_client_publish(client, "/topic/qos1", "data_3", 0, 1, 0); + ESP_LOGI(TAG, "sent publish successful, msg_id=%d", msg_id); + + msg_id = esp_mqtt_client_subscribe(client, "/topic/qos0", 0); + ESP_LOGI(TAG, "sent subscribe successful, msg_id=%d", msg_id); + + msg_id = esp_mqtt_client_subscribe(client, "/topic/qos1", 1); + ESP_LOGI(TAG, "sent subscribe successful, msg_id=%d", msg_id); + + msg_id = esp_mqtt_client_unsubscribe(client, "/topic/qos1"); + ESP_LOGI(TAG, "sent unsubscribe successful, msg_id=%d", msg_id); + break; + case MQTT_EVENT_DISCONNECTED: + ESP_LOGI(TAG, "MQTT_EVENT_DISCONNECTED"); + break; + + case MQTT_EVENT_SUBSCRIBED: + ESP_LOGI(TAG, "MQTT_EVENT_SUBSCRIBED, msg_id=%d", event->msg_id); + msg_id = esp_mqtt_client_publish(client, "/topic/qos0", "data", 0, 0, 0); + ESP_LOGI(TAG, "sent publish successful, msg_id=%d", msg_id); + break; + case MQTT_EVENT_UNSUBSCRIBED: + ESP_LOGI(TAG, "MQTT_EVENT_UNSUBSCRIBED, msg_id=%d", event->msg_id); + break; + case MQTT_EVENT_PUBLISHED: + ESP_LOGI(TAG, "MQTT_EVENT_PUBLISHED, msg_id=%d", event->msg_id); + break; + case MQTT_EVENT_DATA: + ESP_LOGI(TAG, "MQTT_EVENT_DATA"); + printf("TOPIC=%.*s\r\n", event->topic_len, event->topic); + printf("DATA=%.*s\r\n", event->data_len, event->data); + break; + case MQTT_EVENT_ERROR: + ESP_LOGI(TAG, "MQTT_EVENT_ERROR"); + break; + default: + ESP_LOGI(TAG, "Other event id:%d", event->event_id); + break; + } +} + +static void mqtt_app_start(void) +{ + esp_mqtt_client_config_t mqtt_cfg = {}; + mqtt_cfg.broker.address.uri = CONFIG_BROKER_URL; + mqtt_cfg.credentials.client_id = "idf_on_linux_client"; + + esp_mqtt_client_handle_t client = esp_mqtt_client_init(&mqtt_cfg); + /* The last argument may be used to pass data to the event handler, in this example mqtt_event_handler */ + esp_mqtt_client_register_event(client, (esp_mqtt_event_id_t)ESP_EVENT_ANY_ID, mqtt_event_handler, NULL); + esp_mqtt_client_start(client); +} + +static void event_handler(void *arg, esp_event_base_t event_base, + int32_t event_id, void *event_data) +{ + ESP_LOGI(TAG, "EVENT type %s id %d", event_base, (int)event_id); + if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) { + esp_wifi_connect(); + } else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) { + if (s_retry_num < EXAMPLE_ESP_MAXIMUM_RETRY) { + esp_wifi_connect(); + s_retry_num++; + ESP_LOGI(TAG, "retry to connect to the AP"); + } else { + xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT); + } + ESP_LOGI(TAG, "connect to the AP fail"); + } else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) { + ip_event_got_ip_t *event = (ip_event_got_ip_t *) event_data; + ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip)); + s_retry_num = 0; + xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT); + } +} + +static void wifi_init_sta() +{ + s_wifi_event_group = xEventGroupCreate(); + + ESP_ERROR_CHECK(esp_netif_init()); + + ESP_ERROR_CHECK(esp_event_loop_create_default()); + esp_netif_create_default_wifi_sta(); + + wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); + ESP_ERROR_CHECK(esp_wifi_init(&cfg)); + + esp_event_handler_instance_t instance_any_id; + esp_event_handler_instance_t instance_got_ip; + ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, + ESP_EVENT_ANY_ID, + &event_handler, + NULL, + &instance_any_id)); + ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT, + IP_EVENT_STA_GOT_IP, + &event_handler, + NULL, + &instance_got_ip)); + + wifi_config_t wifi_config = { + .sta = { + .ssid = EXAMPLE_ESP_WIFI_SSID, + .password = EXAMPLE_ESP_WIFI_PASS, + }, + }; + ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) ); + ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config) ); + ESP_ERROR_CHECK(esp_wifi_start() ); + + ESP_LOGI(TAG, "wifi_init_sta finished."); + + /* Waiting until either the connection is established (WIFI_CONNECTED_BIT) or connection failed for the maximum + * number of re-tries (WIFI_FAIL_BIT). The bits are set by event_handler() (see above) */ + EventBits_t bits = xEventGroupWaitBits(s_wifi_event_group, + WIFI_CONNECTED_BIT | WIFI_FAIL_BIT, + pdFALSE, + pdFALSE, + portMAX_DELAY); + + /* xEventGroupWaitBits() returns the bits before the call returned, hence we can test which event actually + * happened. */ + if (bits & WIFI_CONNECTED_BIT) { + ESP_LOGI(TAG, "connected to ap SSID:%s password:%s", + EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS); + } else if (bits & WIFI_FAIL_BIT) { + ESP_LOGI(TAG, "Failed to connect to SSID:%s, password:%s", + EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS); + } else { + ESP_LOGE(TAG, "UNEXPECTED EVENT"); + } +} + +void app_main(void) +{ + ESP_LOGI(TAG, "[APP] Startup.."); + ESP_LOGI(TAG, "[APP] Free memory: %d bytes", esp_get_free_heap_size()); + ESP_LOGI(TAG, "[APP] IDF version: %s", esp_get_idf_version()); + + esp_log_level_set("*", ESP_LOG_INFO); + esp_log_level_set("mqtt_client", ESP_LOG_VERBOSE); + esp_log_level_set("esp_mqtt_demo", ESP_LOG_VERBOSE); + esp_log_level_set("transport_base", ESP_LOG_VERBOSE); + esp_log_level_set("esp-tls", ESP_LOG_VERBOSE); + esp_log_level_set("transport", ESP_LOG_VERBOSE); + esp_log_level_set("outbox", ESP_LOG_VERBOSE); + + //Initialize NVS + esp_err_t ret = nvs_flash_init(); + if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { + ESP_ERROR_CHECK(nvs_flash_erase()); + ret = nvs_flash_init(); + } + ESP_ERROR_CHECK(ret); + + ESP_LOGI(TAG, "ESP_WIFI_MODE_STA"); + wifi_init_sta(); + + mqtt_app_start(); +} diff --git a/resources/espressif__esp_wifi_remote/examples/mqtt/main/idf_component.yml b/resources/espressif__esp_wifi_remote/examples/mqtt/main/idf_component.yml new file mode 100644 index 0000000..88b71aa --- /dev/null +++ b/resources/espressif__esp_wifi_remote/examples/mqtt/main/idf_component.yml @@ -0,0 +1,4 @@ +dependencies: + esp_wifi_remote: + version: "*" + override_path: ../../.. diff --git a/resources/espressif__esp_wifi_remote/examples/mqtt/sdkconfig.ci.p4 b/resources/espressif__esp_wifi_remote/examples/mqtt/sdkconfig.ci.p4 new file mode 100644 index 0000000..a8e7e5d --- /dev/null +++ b/resources/espressif__esp_wifi_remote/examples/mqtt/sdkconfig.ci.p4 @@ -0,0 +1,11 @@ +CONFIG_IDF_TARGET="esp32p4" +CONFIG_ESP_WIFI_SSID="local_mosquitto" +CONFIG_ESP_WIFI_PASSWORD="local_mosquitto_password" +CONFIG_ESP_WIFI_REMOTE_EPPP_UART_TX_PIN=47 +CONFIG_ESP_WIFI_REMOTE_EPPP_UART_RX_PIN=48 +CONFIG_ESP_WIFI_REMOTE_EPPP_SERVER_CA="MIIDIzCCAgugAwIBAgIUL4dO91g+lJLA9mHo+2wIfgr+VL8wDQYJKoZIhvcNAQELBQAwITELMAkGA1UEBhMCQ1oxEjAQBgNVBAMMCUVzcHJlc3NpZjAeFw0yNDEwMzAwOTM1NDVaFw0yNTEwMzAwOTM1NDVaMCExCzAJBgNVBAYTAkNaMRIwEAYDVQQDDAlFc3ByZXNzaWYwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCWm4sq9DdpDYUxRJD/Xauc8w2y7Zh0XQuRZ5qtkZclkpK3sz2nOQR9HAs0FWU4mUgZJeUwKNa1jzgtm89oAYtMrRypiTNQSkFWFiwJXXN/xGO93I2COQ857iGOvKyQpfxCsuy6THPIsSYYcYV6Lk/DlLix9CGXax+mcFvxcHQxm33//YHscWJEo5RyNHdfOFYhAzINqoHVX5KOQQxjmpHiMmVhT1HH9PqTOg3ukvNEJVphRHjv6n4KB2wHSMGmNVaUQWB9gILAQ6Ixkxxhf/U9DtftTvXNbzlX56kvSSt1I3gcmHHpwrDRrg0aQBbuL0yeDaza1wLMIaP/Saphl7x/AgMBAAGjUzBRMB0GA1UdDgQWBBS/+vNjHlnmn0N8ixDGpWq0WV1TtTAfBgNVHSMEGDAWgBS/+vNjHlnmn0N8ixDGpWq0WV1TtTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQACJQuUz5LHHtfOc9s13lbfaWW5HukFI55/B7xOIVtIMcDpvzpVCQz1TT0N1DoFwEbXGLG8A8nBye+y9A/e2V/B3DEQ5Yq7rq/KxXGBtgyUGJT08kRASWsOoQOMI15xCH5Al2JifbOCaY9glupccctY5ypfucrM2Z9KGoT7lKw7L2cx9yrXY3UO/3bQibKNLSmHR4zvlcXEdWFdMmsBUvbUmVYTPZIK0iMARzXtBNJL1dbT+shp/VM2Um09L0cakyD2jwjFvRjbnUdgJt8j7pf38vEHtcVfbmCrdRjgmWXuwnqS5UTgfYyHCGZvEITr8JVAro7SkLywjL5IeKnqxtv6" +CONFIG_ESP_WIFI_REMOTE_EPPP_CLIENT_CRT="MIICvDCCAaQCFAbrhsFoIjFDqI9LzRog2HUQcz0vMA0GCSqGSIb3DQEBCwUAMCExCzAJBgNVBAYTAkNaMRIwEAYDVQQDDAlFc3ByZXNzaWYwHhcNMjQxMDMwMDkzNTQ1WhcNMjUxMDMwMDkzNTQ1WjAUMRIwEAYDVQQDDAljbGllbnRfY24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGPubh3BQadEIOR3QLXyF7REI6CHC8PcJ55ndHYEAboh8WuzYbqKjgz1Jf5Ya4yUUC+aJk6rYX/oSX2MSyXCbBQ+tBR+mSRt7M7smnHYLUUqbN4f594TI4K0KRDCPPuJmhPo/yn+M51T9p3BUNRq3g3cyUKKQaomX1cUr0uKyPel5WyLmzgB7o8Afw6uOyWU3YO3QgilSC3W+3n/KQ6c2jJFimgLk7LBGKY3e/F8InWQgfCG7kb66JXhFL6DSlCryrh0SbidGUNGAGJC86OTd6/XLb5qr3KIfvdTi7Rqcw7OverZ0V7/g5HzdTYMJRbF0dqYAWVaGFxDCPOmc1HzEjAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAD6yAUXqueOFXybINofP/jhXNuxQCJXIONmgnB+LYfl/VPc9bdi5l5wEnBneZnrDbXaGHCKgxhW8nT9KZRKJF7eWnjmsGHEgVov6DTEERbO3sGGBbP0Gdwjhj58QMMGoBFDdCr/1t58q1eHwukmfhHM3mMynoduFSMuGcpSEM9QcE2h2ePPdNv/CvjcNt/3L3sF4DU4Jf/ncTRiFVkXaNeyNhRdr8UUV0siek035ho1GD8oiYFYi86eAa7AuNA9Rjjs9v64Df32tbeq3hfefm7hMJdDdz31eE/0xVLJmpYVE4DKYejenvsz2dreZt+CKiX4wVWfTNxVdOSjQJqxMEgM=" +CONFIG_ESP_WIFI_REMOTE_EPPP_CLIENT_KEY="MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDGPubh3BQadEIOR3QLXyF7REI6CHC8PcJ55ndHYEAboh8WuzYbqKjgz1Jf5Ya4yUUC+aJk6rYX/oSX2MSyXCbBQ+tBR+mSRt7M7smnHYLUUqbN4f594TI4K0KRDCPPuJmhPo/yn+M51T9p3BUNRq3g3cyUKKQaomX1cUr0uKyPel5WyLmzgB7o8Afw6uOyWU3YO3QgilSC3W+3n/KQ6c2jJFimgLk7LBGKY3e/F8InWQgfCG7kb66JXhFL6DSlCryrh0SbidGUNGAGJC86OTd6/XLb5qr3KIfvdTi7Rqcw7OverZ0V7/g5HzdTYMJRbF0dqYAWVaGFxDCPOmc1HzEjAgMBAAECggEAJdniuWMMz5Q8/H72ECnEucVpo6zy4W4lUKMJSS5+bwhASVXLWfKU8/+Bqd+oHmYHcC77q6sIw4IMDPYNcESZ/bKbG2bAmPZBGf3JsMe4sBNr18l7jstNjF3uIsWfnMyRQLEySM/wUZ1+sxabSmKhVlri8bLkylURhJByEFGmWOpc+rsrVUhhQVhvNQhL6c7W1hfnj2TOrMBGnpvOtYUMlbaQuSbV1Djqgg8NU6DR4g6fZS7JGbWdaeu39RK0MjJdiZuHflF2Sx9nUDwpLSdl1fVZAAxYuSFIvgRQCd3KTt+5eaqov/DHBfKghPn0a6S3OxlboPAt4wps7yHT0L0ccQKBgQD1euhKGdNH0yWXs5iuQ/eJcJWxFEc5cIEx1h/2oTP2++JU0gCMG6fXxDDZL70TXQxQeAnuLz8Aj+/qIKI+t3uOu4yK2s1LA/yjlrA6fMVeK/OaQuuKikFshUd28IFQvrG6oAxs1MJ5fcRhSE9MDW9lfcUF3woaoZlfCz22d2RImwKBgQDOvcyhbbHcrQxoESPz4RlZwUMTfEldXfTQtyl/pJdAJLUrDiRWYx4KNUwvVRrxgjaXnjF1q58NR9NNrTasJ+Vl30Nklhnyt3a4NTKACXxhX1cemWdL7m1B7rBSzMJD6uAqE3q8790swmZYRWgjMOB9xrYKq0JNuaCPEx8FbbzuGQKBgE4QRNhzt/2qRtUkNtSMJqbdV60VXsUEYwFfL5D1mJndZg9FLQlhLhHugP5AMSd8OpNIaRgGjEl4fHn+4LmDDdbJC5uIkypc3TWEkQw4a2dUIMaYq2DGMKH7DEvllaoAynInvWvKiQGrngy1uwnbZ+ZlhYclc4gehbB02a4x74ErAoGAWxApCVXrCRvEIjaiknKtGubQp82P9ytCgYicI9gYsy04C53wDYkdGzv8scCX3JcRetk4Se9tYIkpnsZUFaKBHc0ovy6KgWmkRmFQPCtxeOZo1laVtFFyGJ+NVPtR+l6DnKT15DD3SBbcw7bWtuF5kI0tdCeZTekcusieWmLK3EkCgYEA0RumiuR2jgPnljGrLZu2QAg1gieS6kGKwXJarSOLFG5B4dftdwBKy8QEqbNAL5xKfa6tlNg6Pa9ULfC38qOOSB0BKv+gAvjra7uk4Pr8avhMGDUr2PZFNQJt4crWutNmEJ8yIsqMP8HC2UYD8Hv80jrwAd8mNsWSTEO7UDmd/YU=" +CONFIG_ESP_WIFI_REMOTE_EPPP_CLIENT_CA="MIIDIzCCAgugAwIBAgIUL4dO91g+lJLA9mHo+2wIfgr+VL8wDQYJKoZIhvcNAQELBQAwITELMAkGA1UEBhMCQ1oxEjAQBgNVBAMMCUVzcHJlc3NpZjAeFw0yNDEwMzAwOTM1NDVaFw0yNTEwMzAwOTM1NDVaMCExCzAJBgNVBAYTAkNaMRIwEAYDVQQDDAlFc3ByZXNzaWYwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCWm4sq9DdpDYUxRJD/Xauc8w2y7Zh0XQuRZ5qtkZclkpK3sz2nOQR9HAs0FWU4mUgZJeUwKNa1jzgtm89oAYtMrRypiTNQSkFWFiwJXXN/xGO93I2COQ857iGOvKyQpfxCsuy6THPIsSYYcYV6Lk/DlLix9CGXax+mcFvxcHQxm33//YHscWJEo5RyNHdfOFYhAzINqoHVX5KOQQxjmpHiMmVhT1HH9PqTOg3ukvNEJVphRHjv6n4KB2wHSMGmNVaUQWB9gILAQ6Ixkxxhf/U9DtftTvXNbzlX56kvSSt1I3gcmHHpwrDRrg0aQBbuL0yeDaza1wLMIaP/Saphl7x/AgMBAAGjUzBRMB0GA1UdDgQWBBS/+vNjHlnmn0N8ixDGpWq0WV1TtTAfBgNVHSMEGDAWgBS/+vNjHlnmn0N8ixDGpWq0WV1TtTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQACJQuUz5LHHtfOc9s13lbfaWW5HukFI55/B7xOIVtIMcDpvzpVCQz1TT0N1DoFwEbXGLG8A8nBye+y9A/e2V/B3DEQ5Yq7rq/KxXGBtgyUGJT08kRASWsOoQOMI15xCH5Al2JifbOCaY9glupccctY5ypfucrM2Z9KGoT7lKw7L2cx9yrXY3UO/3bQibKNLSmHR4zvlcXEdWFdMmsBUvbUmVYTPZIK0iMARzXtBNJL1dbT+shp/VM2Um09L0cakyD2jwjFvRjbnUdgJt8j7pf38vEHtcVfbmCrdRjgmWXuwnqS5UTgfYyHCGZvEITr8JVAro7SkLywjL5IeKnqxtv6" +CONFIG_ESP_WIFI_REMOTE_EPPP_SERVER_CRT="MIICwjCCAaoCFAbrhsFoIjFDqI9LzRog2HUQcz0uMA0GCSqGSIb3DQEBCwUAMCExCzAJBgNVBAYTAkNaMRIwEAYDVQQDDAlFc3ByZXNzaWYwHhcNMjQxMDMwMDkzNTQ1WhcNMjUxMDMwMDkzNTQ1WjAaMRgwFgYDVQQDDA9lc3ByZXNzaWYubG9jYWwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDXxawk5bs7vCfWHEFK9IuKqs/sByWVrNWfAYg4ZVaDRD+9yGoPHPfkLPnJ6ec3zB2HtfZy1SlOv7RcASMYygGfBeNFT1enlrcZr34SWit0larCtLKrU5xZBGzbMhwt/Td9c5z3i8yTp6MxoFbFck2VECSiul+ZUqI2t7DCyExwvCr+75IEPkc12mwys3QXn2wJDMLMK/ECRzZxfi1XUsmlR2Ds2XVx7S6+miExO/zj2bjQpOVfodFLSDSyhmurMvYVwI/yecvM80k/FE+1RkvsXIWYuj6lZ8UuxVwK0+l1yzXM8pMOC8dGRnYuF5PnU4Z8w+VQxHWUWBikoopn/+uhAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAFwtlQktabaq0/Yvo57KFxTzFSKJLsPD0+ICVXxydvIPZecUuNLCcodPCeI2TnFzxp2kX5nF0+gUtHFZfl4mgjoOdmXdaCHBnpqxwDKODEPYdQU/PSLOSu0rLmBBvuZawOmIaijgtF4WWrZtJJTtzRN4kYJ28dLmhRu8NBDZYKeUKLNies2R7vrsq8VRitXyDWh20vSmnSyH0cepbJKnfUmv3Q9Ai3JWMHxgLljkn5qcF34XSyhH/Q/O8aRV+AEzG7dHNvqTIP/8u1DQJyjyBUC4WZHohe/uGBkbEfcysnp+XiTL8ZrcTItaKPN98LhXaTL3ReN2n9I/tult0FawELM=" +CONFIG_ESP_WIFI_REMOTE_EPPP_SERVER_KEY="MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDXxawk5bs7vCfWHEFK9IuKqs/sByWVrNWfAYg4ZVaDRD+9yGoPHPfkLPnJ6ec3zB2HtfZy1SlOv7RcASMYygGfBeNFT1enlrcZr34SWit0larCtLKrU5xZBGzbMhwt/Td9c5z3i8yTp6MxoFbFck2VECSiul+ZUqI2t7DCyExwvCr+75IEPkc12mwys3QXn2wJDMLMK/ECRzZxfi1XUsmlR2Ds2XVx7S6+miExO/zj2bjQpOVfodFLSDSyhmurMvYVwI/yecvM80k/FE+1RkvsXIWYuj6lZ8UuxVwK0+l1yzXM8pMOC8dGRnYuF5PnU4Z8w+VQxHWUWBikoopn/+uhAgMBAAECggEBAJY/VC5hNe5Th53FEQYjoONPK/dbxqUhs6LEC1nR3tsK9COv4YJilo7xboJV+KZW4J02bMTrf5cRUILcW9cQGu7jx6zkodHV1evx0qTu2uGUslJgRyWb0/v8Y9yCWTMA5tnZXozVcP/ENJQC5UkZ3cIVep1Bj/4Ql1nosRIBLZE1fiW6YBxKM05Qni/UJJWIxc/7clBYiy8L/atvhErkqKvx/pACh/SgVPd9JMzTBdbE13bB1O3nx/7n3gJmkBkKtlWL6vA294qdlHa3RMokV+lTwRx+b5VzxoKZHv6grHPNMulx3R/gHcWgz1dAo8Ume8LgR6zTqPVEy1uB95hX7I0CgYEA9/u/5IjDQQJ9qTkvJey6FNsvl68JcYRtP2+3WKXPRaUJLPv6M20ZmjpuVk4NpkEBWzJ4fhQ6D9TL8F7+WsjLfa58gMs1juu3uAEk4H5AgPi3vqkdw/Kgo4uU3QCa/6R5dXzpndWqllSBAsx+0s/uwbI6bLodqcVOlIE7vLusoYcCgYEA3r9Zt8cwDt1h6JXdHcNVKEcPt01XB7h3bQtiliSDcfToV9fYuQXUOkBK76Xt6w3L5NqWrQwigRCdDmYBuhql/RgvIGcOKVC/cL+sSetNP8xzSozQsyfBalCk826X7MV065OtqXZZVux48gVBSvfuzs1xTo3e1TpV+pd1nj27c5cCgYEAy70WR1jlsn+tZl8JEYuQxpneXCz/ATjf2QKcDEUOKhYRl9feFGpKYqAnDtlJ9ZHq31Z0EIHlwiP++hnRuBzIsxWsTNSnyCh55L9r4NVZgZzWudqQDfFFcZi4UWqx7d7fu1tJRNfLM39yDy6b8+/KJXGc9r9ip5znlrMmtUUr6/kCgYAlp8V7+vFV4fj2P7d0m5vexjyS6UEoLfgKeB0/cobCEfvhNb0OcjzRaCMC5lMVJGzukEFemamPlgZm87mhA3ZCFf+Jg8JyG5NxdQWkLWIOwfpPhQSW9MaOuXlZKb4HKc49MObvufEab7l2eIr0KHu3fCWGeRdNhqIYTdh1WsxAmwKBgQCE50V7GAyG+tsMwZyimAAykcBL2x0NSKT2LY59sM6+FEtRH9d1dyacIFQ2GVHPNXjeRxtqIawsU/5yJ5Ivh38nDJzQLLM3oDXi5VHtWP6ExfUi9ZFb1CLiALg5dBoyAP/3Xvtq8JpIp6PwFRVPCKE7/GgBmEQ23eIfViFhfPIrfQ==" diff --git a/resources/espressif__esp_wifi_remote/examples/mqtt/sdkconfig.defaults b/resources/espressif__esp_wifi_remote/examples/mqtt/sdkconfig.defaults new file mode 100644 index 0000000..3ad1ba3 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/examples/mqtt/sdkconfig.defaults @@ -0,0 +1,4 @@ +CONFIG_ESP_WIFI_REMOTE_LIBRARY_EPPP=y +CONFIG_LWIP_PPP_SUPPORT=y +CONFIG_LWIP_PPP_SERVER_SUPPORT=y +CONFIG_LWIP_PPP_VJ_HEADER_COMPRESSION=n diff --git a/resources/espressif__esp_wifi_remote/examples/pytest_eppp.py b/resources/espressif__esp_wifi_remote/examples/pytest_eppp.py new file mode 100644 index 0000000..5f24932 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/examples/pytest_eppp.py @@ -0,0 +1,22 @@ +# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: CC0-1.0 +import os.path +from typing import Tuple + +import pytest +from pytest_embedded_idf.dut import IdfDut + + +@pytest.mark.parametrize( + 'count, app_path, target', [ + (2, + f'{os.path.join(os.path.dirname(__file__), "mqtt")}|{os.path.join(os.path.dirname(__file__), "server")}', + 'esp32p4|esp32c6'), + ], indirect=True +) +def test_wifi_remote_eppp(dut: Tuple[IdfDut, IdfDut]) -> None: + client = dut[0] + server = dut[1] + + server.expect('rpc_server: Received IP event', timeout=100) + client.expect('MQTT_EVENT_CONNECTED', timeout=100) diff --git a/resources/espressif__esp_wifi_remote/examples/server/CMakeLists.txt b/resources/espressif__esp_wifi_remote/examples/server/CMakeLists.txt new file mode 100644 index 0000000..144b9e1 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/examples/server/CMakeLists.txt @@ -0,0 +1,6 @@ +# The following five lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.16) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(pppos_slave) diff --git a/resources/espressif__esp_wifi_remote/examples/server/README.md b/resources/espressif__esp_wifi_remote/examples/server/README.md new file mode 100644 index 0000000..f6e63d9 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/examples/server/README.md @@ -0,0 +1,21 @@ +# WiFi remote EPPP RPC server + +This is a standalone application serving as the slave device for `esp_wifi_remote` users (with `eppp` RPC). + +## Overview + +You need to configure and connect a slave device to the `esp_wifi_remote` host and run this application. Please fallow carefully these guidelines on HW connection and configuration of the slave device, based on the host device. + +## HW connection + +We currently support only `UART` transport you just need to connect Rx, Tx and GND and configure these fields accordingly: +* CONFIG_ESP_WIFI_REMOTE_EPPP_UART_TX_PIN +* CONFIG_ESP_WIFI_REMOTE_EPPP_UART_RX_PIN + +## SW configuration + +You will have to install server side certificates and keys, as well as the CA which should verify the client side. +Please configure these options: +* CONFIG_ESP_WIFI_REMOTE_EPPP_CLIENT_CA +* CONFIG_ESP_WIFI_REMOTE_EPPP_SERVER_CRT +* CONFIG_ESP_WIFI_REMOTE_EPPP_SERVER_KEY diff --git a/resources/espressif__esp_wifi_remote/examples/server/main/CMakeLists.txt b/resources/espressif__esp_wifi_remote/examples/server/main/CMakeLists.txt new file mode 100644 index 0000000..2ba0444 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/examples/server/main/CMakeLists.txt @@ -0,0 +1,2 @@ +idf_component_register(SRCS "station_example_main.c" + INCLUDE_DIRS ".") diff --git a/resources/espressif__esp_wifi_remote/examples/server/main/idf_component.yml b/resources/espressif__esp_wifi_remote/examples/server/main/idf_component.yml new file mode 100644 index 0000000..88b71aa --- /dev/null +++ b/resources/espressif__esp_wifi_remote/examples/server/main/idf_component.yml @@ -0,0 +1,4 @@ +dependencies: + esp_wifi_remote: + version: "*" + override_path: ../../.. diff --git a/resources/espressif__esp_wifi_remote/examples/server/main/station_example_main.c b/resources/espressif__esp_wifi_remote/examples/server/main/station_example_main.c new file mode 100644 index 0000000..93516d3 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/examples/server/main/station_example_main.c @@ -0,0 +1,36 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Unlicense OR CC0-1.0 + */ + +#include +#include +#include "freertos/FreeRTOS.h" +#include "freertos/event_groups.h" +#include "esp_system.h" +#include "esp_wifi.h" +#include "esp_event.h" +#include "esp_log.h" +#include "nvs_flash.h" +#include "eppp_link.h" +#include "esp_wifi_remote.h" + +esp_err_t server_init(void); + +void app_main(void) +{ + //Initialize NVS + esp_err_t ret = nvs_flash_init(); + if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { + ESP_ERROR_CHECK(nvs_flash_erase()); + ret = nvs_flash_init(); + } + ESP_ERROR_CHECK(ret); + + ESP_ERROR_CHECK(esp_netif_init()); + ESP_ERROR_CHECK(esp_event_loop_create_default()); + esp_netif_create_default_wifi_sta(); + + server_init(); +} diff --git a/resources/espressif__esp_wifi_remote/examples/server/sdkconfig.ci.c6 b/resources/espressif__esp_wifi_remote/examples/server/sdkconfig.ci.c6 new file mode 100644 index 0000000..71abf1a --- /dev/null +++ b/resources/espressif__esp_wifi_remote/examples/server/sdkconfig.ci.c6 @@ -0,0 +1,10 @@ +CONFIG_IDF_TARGET="esp32c6" +CONFIG_ESP_WIFI_REMOTE_EPPP_UART_TX_PIN=22 +CONFIG_ESP_WIFI_REMOTE_EPPP_UART_RX_PIN=23 +CONFIG_ESP_WIFI_REMOTE_EPPP_SERVER_CA="MIIDIzCCAgugAwIBAgIUL4dO91g+lJLA9mHo+2wIfgr+VL8wDQYJKoZIhvcNAQELBQAwITELMAkGA1UEBhMCQ1oxEjAQBgNVBAMMCUVzcHJlc3NpZjAeFw0yNDEwMzAwOTM1NDVaFw0yNTEwMzAwOTM1NDVaMCExCzAJBgNVBAYTAkNaMRIwEAYDVQQDDAlFc3ByZXNzaWYwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCWm4sq9DdpDYUxRJD/Xauc8w2y7Zh0XQuRZ5qtkZclkpK3sz2nOQR9HAs0FWU4mUgZJeUwKNa1jzgtm89oAYtMrRypiTNQSkFWFiwJXXN/xGO93I2COQ857iGOvKyQpfxCsuy6THPIsSYYcYV6Lk/DlLix9CGXax+mcFvxcHQxm33//YHscWJEo5RyNHdfOFYhAzINqoHVX5KOQQxjmpHiMmVhT1HH9PqTOg3ukvNEJVphRHjv6n4KB2wHSMGmNVaUQWB9gILAQ6Ixkxxhf/U9DtftTvXNbzlX56kvSSt1I3gcmHHpwrDRrg0aQBbuL0yeDaza1wLMIaP/Saphl7x/AgMBAAGjUzBRMB0GA1UdDgQWBBS/+vNjHlnmn0N8ixDGpWq0WV1TtTAfBgNVHSMEGDAWgBS/+vNjHlnmn0N8ixDGpWq0WV1TtTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQACJQuUz5LHHtfOc9s13lbfaWW5HukFI55/B7xOIVtIMcDpvzpVCQz1TT0N1DoFwEbXGLG8A8nBye+y9A/e2V/B3DEQ5Yq7rq/KxXGBtgyUGJT08kRASWsOoQOMI15xCH5Al2JifbOCaY9glupccctY5ypfucrM2Z9KGoT7lKw7L2cx9yrXY3UO/3bQibKNLSmHR4zvlcXEdWFdMmsBUvbUmVYTPZIK0iMARzXtBNJL1dbT+shp/VM2Um09L0cakyD2jwjFvRjbnUdgJt8j7pf38vEHtcVfbmCrdRjgmWXuwnqS5UTgfYyHCGZvEITr8JVAro7SkLywjL5IeKnqxtv6" +CONFIG_ESP_WIFI_REMOTE_EPPP_CLIENT_CRT="MIICvDCCAaQCFAbrhsFoIjFDqI9LzRog2HUQcz0vMA0GCSqGSIb3DQEBCwUAMCExCzAJBgNVBAYTAkNaMRIwEAYDVQQDDAlFc3ByZXNzaWYwHhcNMjQxMDMwMDkzNTQ1WhcNMjUxMDMwMDkzNTQ1WjAUMRIwEAYDVQQDDAljbGllbnRfY24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGPubh3BQadEIOR3QLXyF7REI6CHC8PcJ55ndHYEAboh8WuzYbqKjgz1Jf5Ya4yUUC+aJk6rYX/oSX2MSyXCbBQ+tBR+mSRt7M7smnHYLUUqbN4f594TI4K0KRDCPPuJmhPo/yn+M51T9p3BUNRq3g3cyUKKQaomX1cUr0uKyPel5WyLmzgB7o8Afw6uOyWU3YO3QgilSC3W+3n/KQ6c2jJFimgLk7LBGKY3e/F8InWQgfCG7kb66JXhFL6DSlCryrh0SbidGUNGAGJC86OTd6/XLb5qr3KIfvdTi7Rqcw7OverZ0V7/g5HzdTYMJRbF0dqYAWVaGFxDCPOmc1HzEjAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAD6yAUXqueOFXybINofP/jhXNuxQCJXIONmgnB+LYfl/VPc9bdi5l5wEnBneZnrDbXaGHCKgxhW8nT9KZRKJF7eWnjmsGHEgVov6DTEERbO3sGGBbP0Gdwjhj58QMMGoBFDdCr/1t58q1eHwukmfhHM3mMynoduFSMuGcpSEM9QcE2h2ePPdNv/CvjcNt/3L3sF4DU4Jf/ncTRiFVkXaNeyNhRdr8UUV0siek035ho1GD8oiYFYi86eAa7AuNA9Rjjs9v64Df32tbeq3hfefm7hMJdDdz31eE/0xVLJmpYVE4DKYejenvsz2dreZt+CKiX4wVWfTNxVdOSjQJqxMEgM=" +CONFIG_ESP_WIFI_REMOTE_EPPP_CLIENT_KEY="MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDGPubh3BQadEIOR3QLXyF7REI6CHC8PcJ55ndHYEAboh8WuzYbqKjgz1Jf5Ya4yUUC+aJk6rYX/oSX2MSyXCbBQ+tBR+mSRt7M7smnHYLUUqbN4f594TI4K0KRDCPPuJmhPo/yn+M51T9p3BUNRq3g3cyUKKQaomX1cUr0uKyPel5WyLmzgB7o8Afw6uOyWU3YO3QgilSC3W+3n/KQ6c2jJFimgLk7LBGKY3e/F8InWQgfCG7kb66JXhFL6DSlCryrh0SbidGUNGAGJC86OTd6/XLb5qr3KIfvdTi7Rqcw7OverZ0V7/g5HzdTYMJRbF0dqYAWVaGFxDCPOmc1HzEjAgMBAAECggEAJdniuWMMz5Q8/H72ECnEucVpo6zy4W4lUKMJSS5+bwhASVXLWfKU8/+Bqd+oHmYHcC77q6sIw4IMDPYNcESZ/bKbG2bAmPZBGf3JsMe4sBNr18l7jstNjF3uIsWfnMyRQLEySM/wUZ1+sxabSmKhVlri8bLkylURhJByEFGmWOpc+rsrVUhhQVhvNQhL6c7W1hfnj2TOrMBGnpvOtYUMlbaQuSbV1Djqgg8NU6DR4g6fZS7JGbWdaeu39RK0MjJdiZuHflF2Sx9nUDwpLSdl1fVZAAxYuSFIvgRQCd3KTt+5eaqov/DHBfKghPn0a6S3OxlboPAt4wps7yHT0L0ccQKBgQD1euhKGdNH0yWXs5iuQ/eJcJWxFEc5cIEx1h/2oTP2++JU0gCMG6fXxDDZL70TXQxQeAnuLz8Aj+/qIKI+t3uOu4yK2s1LA/yjlrA6fMVeK/OaQuuKikFshUd28IFQvrG6oAxs1MJ5fcRhSE9MDW9lfcUF3woaoZlfCz22d2RImwKBgQDOvcyhbbHcrQxoESPz4RlZwUMTfEldXfTQtyl/pJdAJLUrDiRWYx4KNUwvVRrxgjaXnjF1q58NR9NNrTasJ+Vl30Nklhnyt3a4NTKACXxhX1cemWdL7m1B7rBSzMJD6uAqE3q8790swmZYRWgjMOB9xrYKq0JNuaCPEx8FbbzuGQKBgE4QRNhzt/2qRtUkNtSMJqbdV60VXsUEYwFfL5D1mJndZg9FLQlhLhHugP5AMSd8OpNIaRgGjEl4fHn+4LmDDdbJC5uIkypc3TWEkQw4a2dUIMaYq2DGMKH7DEvllaoAynInvWvKiQGrngy1uwnbZ+ZlhYclc4gehbB02a4x74ErAoGAWxApCVXrCRvEIjaiknKtGubQp82P9ytCgYicI9gYsy04C53wDYkdGzv8scCX3JcRetk4Se9tYIkpnsZUFaKBHc0ovy6KgWmkRmFQPCtxeOZo1laVtFFyGJ+NVPtR+l6DnKT15DD3SBbcw7bWtuF5kI0tdCeZTekcusieWmLK3EkCgYEA0RumiuR2jgPnljGrLZu2QAg1gieS6kGKwXJarSOLFG5B4dftdwBKy8QEqbNAL5xKfa6tlNg6Pa9ULfC38qOOSB0BKv+gAvjra7uk4Pr8avhMGDUr2PZFNQJt4crWutNmEJ8yIsqMP8HC2UYD8Hv80jrwAd8mNsWSTEO7UDmd/YU=" +CONFIG_ESP_WIFI_REMOTE_EPPP_CLIENT_CA="MIIDIzCCAgugAwIBAgIUL4dO91g+lJLA9mHo+2wIfgr+VL8wDQYJKoZIhvcNAQELBQAwITELMAkGA1UEBhMCQ1oxEjAQBgNVBAMMCUVzcHJlc3NpZjAeFw0yNDEwMzAwOTM1NDVaFw0yNTEwMzAwOTM1NDVaMCExCzAJBgNVBAYTAkNaMRIwEAYDVQQDDAlFc3ByZXNzaWYwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCWm4sq9DdpDYUxRJD/Xauc8w2y7Zh0XQuRZ5qtkZclkpK3sz2nOQR9HAs0FWU4mUgZJeUwKNa1jzgtm89oAYtMrRypiTNQSkFWFiwJXXN/xGO93I2COQ857iGOvKyQpfxCsuy6THPIsSYYcYV6Lk/DlLix9CGXax+mcFvxcHQxm33//YHscWJEo5RyNHdfOFYhAzINqoHVX5KOQQxjmpHiMmVhT1HH9PqTOg3ukvNEJVphRHjv6n4KB2wHSMGmNVaUQWB9gILAQ6Ixkxxhf/U9DtftTvXNbzlX56kvSSt1I3gcmHHpwrDRrg0aQBbuL0yeDaza1wLMIaP/Saphl7x/AgMBAAGjUzBRMB0GA1UdDgQWBBS/+vNjHlnmn0N8ixDGpWq0WV1TtTAfBgNVHSMEGDAWgBS/+vNjHlnmn0N8ixDGpWq0WV1TtTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQACJQuUz5LHHtfOc9s13lbfaWW5HukFI55/B7xOIVtIMcDpvzpVCQz1TT0N1DoFwEbXGLG8A8nBye+y9A/e2V/B3DEQ5Yq7rq/KxXGBtgyUGJT08kRASWsOoQOMI15xCH5Al2JifbOCaY9glupccctY5ypfucrM2Z9KGoT7lKw7L2cx9yrXY3UO/3bQibKNLSmHR4zvlcXEdWFdMmsBUvbUmVYTPZIK0iMARzXtBNJL1dbT+shp/VM2Um09L0cakyD2jwjFvRjbnUdgJt8j7pf38vEHtcVfbmCrdRjgmWXuwnqS5UTgfYyHCGZvEITr8JVAro7SkLywjL5IeKnqxtv6" +CONFIG_ESP_WIFI_REMOTE_EPPP_SERVER_CRT="MIICwjCCAaoCFAbrhsFoIjFDqI9LzRog2HUQcz0uMA0GCSqGSIb3DQEBCwUAMCExCzAJBgNVBAYTAkNaMRIwEAYDVQQDDAlFc3ByZXNzaWYwHhcNMjQxMDMwMDkzNTQ1WhcNMjUxMDMwMDkzNTQ1WjAaMRgwFgYDVQQDDA9lc3ByZXNzaWYubG9jYWwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDXxawk5bs7vCfWHEFK9IuKqs/sByWVrNWfAYg4ZVaDRD+9yGoPHPfkLPnJ6ec3zB2HtfZy1SlOv7RcASMYygGfBeNFT1enlrcZr34SWit0larCtLKrU5xZBGzbMhwt/Td9c5z3i8yTp6MxoFbFck2VECSiul+ZUqI2t7DCyExwvCr+75IEPkc12mwys3QXn2wJDMLMK/ECRzZxfi1XUsmlR2Ds2XVx7S6+miExO/zj2bjQpOVfodFLSDSyhmurMvYVwI/yecvM80k/FE+1RkvsXIWYuj6lZ8UuxVwK0+l1yzXM8pMOC8dGRnYuF5PnU4Z8w+VQxHWUWBikoopn/+uhAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAFwtlQktabaq0/Yvo57KFxTzFSKJLsPD0+ICVXxydvIPZecUuNLCcodPCeI2TnFzxp2kX5nF0+gUtHFZfl4mgjoOdmXdaCHBnpqxwDKODEPYdQU/PSLOSu0rLmBBvuZawOmIaijgtF4WWrZtJJTtzRN4kYJ28dLmhRu8NBDZYKeUKLNies2R7vrsq8VRitXyDWh20vSmnSyH0cepbJKnfUmv3Q9Ai3JWMHxgLljkn5qcF34XSyhH/Q/O8aRV+AEzG7dHNvqTIP/8u1DQJyjyBUC4WZHohe/uGBkbEfcysnp+XiTL8ZrcTItaKPN98LhXaTL3ReN2n9I/tult0FawELM=" +CONFIG_ESP_WIFI_REMOTE_EPPP_SERVER_KEY="MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDXxawk5bs7vCfWHEFK9IuKqs/sByWVrNWfAYg4ZVaDRD+9yGoPHPfkLPnJ6ec3zB2HtfZy1SlOv7RcASMYygGfBeNFT1enlrcZr34SWit0larCtLKrU5xZBGzbMhwt/Td9c5z3i8yTp6MxoFbFck2VECSiul+ZUqI2t7DCyExwvCr+75IEPkc12mwys3QXn2wJDMLMK/ECRzZxfi1XUsmlR2Ds2XVx7S6+miExO/zj2bjQpOVfodFLSDSyhmurMvYVwI/yecvM80k/FE+1RkvsXIWYuj6lZ8UuxVwK0+l1yzXM8pMOC8dGRnYuF5PnU4Z8w+VQxHWUWBikoopn/+uhAgMBAAECggEBAJY/VC5hNe5Th53FEQYjoONPK/dbxqUhs6LEC1nR3tsK9COv4YJilo7xboJV+KZW4J02bMTrf5cRUILcW9cQGu7jx6zkodHV1evx0qTu2uGUslJgRyWb0/v8Y9yCWTMA5tnZXozVcP/ENJQC5UkZ3cIVep1Bj/4Ql1nosRIBLZE1fiW6YBxKM05Qni/UJJWIxc/7clBYiy8L/atvhErkqKvx/pACh/SgVPd9JMzTBdbE13bB1O3nx/7n3gJmkBkKtlWL6vA294qdlHa3RMokV+lTwRx+b5VzxoKZHv6grHPNMulx3R/gHcWgz1dAo8Ume8LgR6zTqPVEy1uB95hX7I0CgYEA9/u/5IjDQQJ9qTkvJey6FNsvl68JcYRtP2+3WKXPRaUJLPv6M20ZmjpuVk4NpkEBWzJ4fhQ6D9TL8F7+WsjLfa58gMs1juu3uAEk4H5AgPi3vqkdw/Kgo4uU3QCa/6R5dXzpndWqllSBAsx+0s/uwbI6bLodqcVOlIE7vLusoYcCgYEA3r9Zt8cwDt1h6JXdHcNVKEcPt01XB7h3bQtiliSDcfToV9fYuQXUOkBK76Xt6w3L5NqWrQwigRCdDmYBuhql/RgvIGcOKVC/cL+sSetNP8xzSozQsyfBalCk826X7MV065OtqXZZVux48gVBSvfuzs1xTo3e1TpV+pd1nj27c5cCgYEAy70WR1jlsn+tZl8JEYuQxpneXCz/ATjf2QKcDEUOKhYRl9feFGpKYqAnDtlJ9ZHq31Z0EIHlwiP++hnRuBzIsxWsTNSnyCh55L9r4NVZgZzWudqQDfFFcZi4UWqx7d7fu1tJRNfLM39yDy6b8+/KJXGc9r9ip5znlrMmtUUr6/kCgYAlp8V7+vFV4fj2P7d0m5vexjyS6UEoLfgKeB0/cobCEfvhNb0OcjzRaCMC5lMVJGzukEFemamPlgZm87mhA3ZCFf+Jg8JyG5NxdQWkLWIOwfpPhQSW9MaOuXlZKb4HKc49MObvufEab7l2eIr0KHu3fCWGeRdNhqIYTdh1WsxAmwKBgQCE50V7GAyG+tsMwZyimAAykcBL2x0NSKT2LY59sM6+FEtRH9d1dyacIFQ2GVHPNXjeRxtqIawsU/5yJ5Ivh38nDJzQLLM3oDXi5VHtWP6ExfUi9ZFb1CLiALg5dBoyAP/3Xvtq8JpIp6PwFRVPCKE7/GgBmEQ23eIfViFhfPIrfQ==" +CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y diff --git a/resources/espressif__esp_wifi_remote/examples/server/sdkconfig.defaults b/resources/espressif__esp_wifi_remote/examples/server/sdkconfig.defaults new file mode 100644 index 0000000..61654a5 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/examples/server/sdkconfig.defaults @@ -0,0 +1,7 @@ +CONFIG_ESP_WIFI_REMOTE_LIBRARY_EPPP=y +CONFIG_LWIP_IP_FORWARD=y +CONFIG_LWIP_IPV4_NAPT=y +CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=4096 +CONFIG_LWIP_PPP_SUPPORT=y +CONFIG_LWIP_PPP_SERVER_SUPPORT=y +CONFIG_LWIP_PPP_VJ_HEADER_COMPRESSION=n diff --git a/resources/espressif__esp_wifi_remote/examples/test_certs/generate_test_certs.sh b/resources/espressif__esp_wifi_remote/examples/test_certs/generate_test_certs.sh new file mode 100644 index 0000000..330b321 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/examples/test_certs/generate_test_certs.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +function gen_pkey { # Params: [KEY_FILE] + openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 | openssl pkcs8 -topk8 -outform PEM -nocrypt -out $1 +} + +function sign_with_ca { # Params: [KEY_FILE] [CN] [CRT_FILE] + openssl req -out request.csr -key $1 -subj "/CN=$2" -new -sha256 + openssl x509 -req -in request.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out $3 -days 365 -sha256 +} + +function export_config { # Params: [FILE/CONFIG_NAME] + content=`cat $1 | sed '/---/d' | tr -d '\n'` + echo "CONFIG_ESP_WIFI_REMOTE_EPPP_$1=\"${content}\"" +} + +if [ -z "$1" ]; then + echo "Usage $0 [CLIENT_CN]" + exit 1; +fi + +SERVER_CN=$1 +CLIENT_CN="${2-client_cn}" + +echo "Server's CN: $SERVER_CN" +echo "Client's CN: $CLIENT_CN" + +## First create our own CA +gen_pkey ca.key +openssl req -new -x509 -subj "/C=CZ/CN=Espressif" -days 365 -key ca.key -out ca.crt +# will use the same CA for both server and client side +cp ca.crt SERVER_CA +cp ca.crt CLIENT_CA + +# Server side +gen_pkey SERVER_KEY +sign_with_ca SERVER_KEY $SERVER_CN SERVER_CRT + +# Client side +gen_pkey CLIENT_KEY +sign_with_ca CLIENT_KEY $CLIENT_CN CLIENT_CRT + +## Generate config options +echo -e "\n# Client side: need own cert and key and ca-cert for server validation" +for f in SERVER_CA CLIENT_CRT CLIENT_KEY; do + export_config $f +done + +echo -e "\n# Server side: need own cert and key and ca-cert for client validation" +for f in CLIENT_CA SERVER_CRT SERVER_KEY; do + export_config $f +done diff --git a/resources/espressif__esp_wifi_remote/idf_component.yml b/resources/espressif__esp_wifi_remote/idf_component.yml new file mode 100644 index 0000000..dae4941 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_component.yml @@ -0,0 +1,16 @@ +dependencies: + espressif/eppp_link: + version: '>=0.1' + espressif/esp_hosted: + rules: + - if: target in [esp32h2, esp32p4] + version: '>=0.0.6' + idf: + version: '>=5.3' +description: Utility wrapper for esp_wifi functionality on remote targets +repository: git://github.com/espressif/esp-wifi-remote.git +repository_info: + commit_sha: 98af1f6b7e24ee6fee7434ee91b46e201c2dbaf2 + path: components/esp_wifi_remote +url: https://github.com/espressif/esp-wifi-remote +version: 0.9.2 diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/Kconfig.slave_select.in b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/Kconfig.slave_select.in new file mode 100644 index 0000000..1e11562 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/Kconfig.slave_select.in @@ -0,0 +1,17 @@ +# This file is auto-generated + choice SLAVE_IDF_TARGET + prompt "choose slave target" + 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" + endchoice diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/Kconfig.soc_wifi_caps.in b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/Kconfig.soc_wifi_caps.in new file mode 100644 index 0000000..61e6fc3 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/Kconfig.soc_wifi_caps.in @@ -0,0 +1,265 @@ +# 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_FREERTOS_UNICORE # ignore: multiple-definition + bool + default y + + config SLAVE_IDF_TARGET_ARCH_RISCV # ignore: multiple-definition + bool + default y + +endif # ESP32C6 diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/Kconfig.wifi.in b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/Kconfig.wifi.in new file mode 100644 index 0000000..f69db62 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/Kconfig.wifi.in @@ -0,0 +1,1132 @@ +# 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 + default 16 if SPIRAM_TRY_ALLOCATE_WIFI_LWIP + 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_USE_MALLOC +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 + range 16 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 + default 16 if SPIRAM_TRY_ALLOCATE_WIFI_LWIP + 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 SPIRAM + 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 number of WiFi management short buffer. + +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). + Only APIs which are helpful for network assisted roaming + are supported for now. + Enable this option with BTM and RRM 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. + 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_SCAN_CACHE + bool "Keep scan results in cache" + depends on WIFI_RMT_11KV_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_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 + select WIFI_RMT_SCAN_CACHE + 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_HE_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_HE_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_HE_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_HE_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 + 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 SPIRAM + 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_SCAN_CACHE + config ESP_WIFI_SCAN_CACHE # ignore: multiple-definition + bool + depends on WIFI_RMT_11KV_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_HE_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_HE_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_HE_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_HE_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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/esp_wifi_remote_weak.c b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/esp_wifi_remote_weak.c new file mode 100644 index 0000000..1d63acb --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/esp_wifi_remote_weak.c @@ -0,0 +1,392 @@ +/* + * 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_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); +} diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/esp_wifi_with_remote.c b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/esp_wifi_with_remote.c new file mode 100644 index 0000000..280da5c --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/esp_wifi_with_remote.c @@ -0,0 +1,388 @@ +/* + * 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_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); +} diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/esp_wifi_default_config.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/esp_wifi_default_config.h new file mode 100644 index 0000000..f3bdb13 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/esp_wifi_default_config.h @@ -0,0 +1,769 @@ +/* + * 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_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_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_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_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_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_ESP_WIFI_REMOTE_LIBRARY_HOSTED 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_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_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_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_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_ESP32C5 + +#if CONFIG_SLAVE_IDF_TARGET_ESP32C61 +#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_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_ESP32C61 diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/esp_wifi_remote_api.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/esp_wifi_remote_api.h new file mode 100644 index 0000000..f3ef2b2 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/esp_wifi_remote_api.h @@ -0,0 +1,83 @@ +/* + * 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_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); diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_mesh.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_mesh.h new file mode 100644 index 0000000..18e55c2 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_mesh.h @@ -0,0 +1,1691 @@ +/* + * 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) /**< XMIT */ +#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 the root will 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_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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_mesh_internal.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_mesh_internal.h new file mode 100644 index 0000000..4c6a998 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_now.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_now.h new file mode 100644 index 0000000..cf32e0b --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_now.h @@ -0,0 +1,382 @@ +/* + * SPDX-FileCopyrightText: 2019-2023 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_DATA_LEN 250 /*!< Maximum length of ESPNOW data which is sent very time */ + +/** + * @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 struct esp_now_rate_config { + wifi_phy_mode_t phymode; /**< ESPNOW phymode of specified interface */ + wifi_phy_rate_t rate; /**< ESPNOW rate of specified interface*/ + bool ersu; /**< ESPNOW using ersu send frame*/ + bool dcm; /**< ESPNOW using dcm rate to send frame*/ +} 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 + * + * @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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi.h new file mode 100644 index 0000000..5697a73 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi.h @@ -0,0 +1,1650 @@ +/* + * 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 + +#if CONFIG_SPIRAM +#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 CONFIG_SPIRAM +#define WIFI_ENABLE_SPIRAM (1<<1) +#else +#define WIFI_ENABLE_SPIRAM 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_SPIRAM | \ + 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_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 Get AP list found in last scan. + * + * @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 is 2.4G, the default protocol is (WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_11AX). + * if CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT and band is 5G, the default protocol is (WIFI_PROTOCOL_11A|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_11AC|WIFI_PROTOCOL_11AX). + * + * @attention 2.4G: Support 802.11b or 802.11bg or 802.11bgn or 802.11bgnax or LR mode + * 5G: Support 802.11a or 802.11an or 802.11anac or 802.11anacax + * + * @param ifx interfaces + * @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 + * - 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 + * + * @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 + * - 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. API return false if try to configure an interface that is not enabled + * @attention 2. WIFI_BW_HT40 is supported only when the interface support 11N + * + * @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 + * - 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. API return false if try to get a interface that is not enable + * + * @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_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(). + * + * @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 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); + +#if SOC_WIFI_HE_SUPPORT_5G +/** + * @brief Set wifi band. + * + * @param[in] band wifi band 2.4G / 5G / 2.4G + 5G + * + * @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_band(wifi_band_t band); + +/** + * @brief Get wifi band. + * + * @param[in] band store 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); +#endif /* SOC_WIFI_HE_SUPPORT_5G */ + +#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 + +#ifdef __cplusplus +} +#endif + +#endif /* __ESP_WIFI_H__ */ diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_ap_get_sta_list.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_ap_get_sta_list.h new file mode 100644 index 0000000..812c4ea --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/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 +#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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_crypto_types.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_crypto_types.h new file mode 100644 index 0000000..c8601e7 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_crypto_types.h @@ -0,0 +1,440 @@ +/* + * 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_aes_wrap_t aes_wrap; /**< The AES wrap callback function used by esp_wifi */ + esp_aes_unwrap_t aes_unwrap; /**< The AES unwrap callback function used by esp_wifi */ + esp_hmac_sha256_vector_t hmac_sha256_vector; /**< The SHA256 callback function used by esp_wifi */ + esp_sha256_prf_t sha256_prf; /**< The SHA256 PRF callback function used by esp_wifi */ + esp_hmac_md5_t hmac_md5; /**< HMAC-MD5 callback function over data buffer (RFC 2104) */ + esp_hmac_md5_vector_t hamc_md5_vector; /**< HMAC-MD5 callback function over data vector (RFC 2104) */ + esp_hmac_sha1_t hmac_sha1; /**< HMAC-SHA1 callback function over data buffer (RFC 2104) */ + esp_hmac_sha1_vector_t hmac_sha1_vector; /**< HMAC-SHA1 callback function over data vector (RFC 2104) */ + esp_sha1_prf_t sha1_prf; /**< SHA1-based Pseudo-Random Function (PRF) (IEEE 802.11i, 8.5.1.1) callback function */ + esp_sha1_vector_t sha1_vector; /**< SHA-1 hash callback function for data vector */ + esp_pbkdf2_sha1_t pbkdf2_sha1; /**< SHA1-based key derivation function (PBKDF2) callback function for IEEE 802.11i */ + esp_rc4_skip_t rc4_skip; /**< XOR RC4 stream callback function to given data with skip-stream-start */ + esp_md5_vector_t md5_vector; /**< MD5 hash callback function for data vector */ + esp_aes_encrypt_t aes_encrypt; /**< Encrypt one AES block callback function */ + esp_aes_encrypt_init_t aes_encrypt_init; /**< Initialize AES callback function for encryption */ + esp_aes_encrypt_deinit_t aes_encrypt_deinit; /**< Deinitialize AES encryption callback function */ + esp_aes_decrypt_t aes_decrypt; /**< Decrypt one AES block callback function */ + esp_aes_decrypt_init_t aes_decrypt_init; /**< Initialize AES callback function for decryption */ + esp_aes_decrypt_deinit_t aes_decrypt_deinit; /**< Deinitialize AES decryption callback function */ + 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 */ + esp_crc32_le_t crc32; /**< CRC32 value callback function in little endian */ +} 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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_default.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_default.h new file mode 100644 index 0000000..d30d512 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_he.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_he.h new file mode 100644 index 0000000..57bf819 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_he.h @@ -0,0 +1,221 @@ +/* + * 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_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); + +#ifdef __cplusplus +} +#endif diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_he_types.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_he_types.h new file mode 100644 index 0000000..5c0055a --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_he_types.h @@ -0,0 +1,434 @@ +/* + * 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_IDF_TARGET_ESP32C5 +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_IDF_TARGET_ESP32C5 +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 */ + unsigned 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: 4; /**< the primary channel */ + unsigned second: 4; /**< the second channel if in HT40 */ + unsigned : 12; /**< 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 */ +} 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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_netif.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_netif.h new file mode 100644 index 0000000..7dfa724 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_types.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_types.h new file mode 100644 index 0000000..ef9f09c --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_types_generic.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_types_generic.h new file mode 100644 index 0000000..ad88e0e --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_types_generic.h @@ -0,0 +1,1081 @@ +/* + * SPDX-FileCopyrightText: 2015-2024 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 + +typedef enum { + WIFI_MODE_NULL = 0, /**< null mode */ + WIFI_MODE_STA, /**< WiFi station mode */ + WIFI_MODE_AP, /**< WiFi soft-AP mode */ + WIFI_MODE_APSTA, /**< WiFi station + soft-AP mode */ + WIFI_MODE_NAN, /**< WiFi NAN mode */ + WIFI_MODE_MAX +} wifi_mode_t; + +typedef enum { + WIFI_IF_STA = ESP_IF_WIFI_STA, + WIFI_IF_AP = ESP_IF_WIFI_AP, +#if CONFIG_SLAVE_SOC_WIFI_NAN_SUPPORT || !CONFIG_SLAVE_SOC_WIFI_ENABLED + WIFI_IF_NAN = ESP_IF_WIFI_NAN, +#endif + WIFI_IF_MAX +} wifi_interface_t; + +#define WIFI_OFFCHAN_TX_REQ 1 +#define WIFI_OFFCHAN_TX_CANCEL 0 + +#define WIFI_ROC_REQ 1 +#define WIFI_ROC_CANCEL 0 + +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 WiFi country-based regional restrictions. */ +typedef struct { + char cc[3]; /**< country code string */ + uint8_t schan; /**< start channel */ + uint8_t nchan; /**< total channel number */ + int8_t max_tx_power; /**< This field is used for getting WiFi maximum transmitting power, call esp_wifi_set_max_tx_power to set the maximum transmitting power. */ + wifi_country_policy_t policy; /**< country policy */ +} wifi_country_t; + +/* Strength of authmodes */ +/* OPEN < WEP < WPA_PSK < OWE < WPA2_PSK = WPA_WPA2_PSK < WAPI_PSK < WPA3_PSK = WPA2_WPA3_PSK = DPP */ +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 : WiFi EAP security */ + WIFI_AUTH_WPA2_ENTERPRISE = WIFI_AUTH_ENTERPRISE, /**< authenticate mode : WiFi 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_MAX +} wifi_auth_mode_t; + +typedef enum { + WIFI_REASON_UNSPECIFIED = 1, + WIFI_REASON_AUTH_EXPIRE = 2, + WIFI_REASON_AUTH_LEAVE = 3, + WIFI_REASON_ASSOC_EXPIRE = 4, + WIFI_REASON_ASSOC_TOOMANY = 5, + WIFI_REASON_NOT_AUTHED = 6, + WIFI_REASON_NOT_ASSOCED = 7, + WIFI_REASON_ASSOC_LEAVE = 8, + WIFI_REASON_ASSOC_NOT_AUTHED = 9, + WIFI_REASON_DISASSOC_PWRCAP_BAD = 10, + WIFI_REASON_DISASSOC_SUPCHAN_BAD = 11, + WIFI_REASON_BSS_TRANSITION_DISASSOC = 12, + WIFI_REASON_IE_INVALID = 13, + WIFI_REASON_MIC_FAILURE = 14, + WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT = 15, + WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT = 16, + WIFI_REASON_IE_IN_4WAY_DIFFERS = 17, + WIFI_REASON_GROUP_CIPHER_INVALID = 18, + WIFI_REASON_PAIRWISE_CIPHER_INVALID = 19, + WIFI_REASON_AKMP_INVALID = 20, + WIFI_REASON_UNSUPP_RSN_IE_VERSION = 21, + WIFI_REASON_INVALID_RSN_IE_CAP = 22, + WIFI_REASON_802_1X_AUTH_FAILED = 23, + WIFI_REASON_CIPHER_SUITE_REJECTED = 24, + WIFI_REASON_TDLS_PEER_UNREACHABLE = 25, + WIFI_REASON_TDLS_UNSPECIFIED = 26, + WIFI_REASON_SSP_REQUESTED_DISASSOC = 27, + WIFI_REASON_NO_SSP_ROAMING_AGREEMENT = 28, + WIFI_REASON_BAD_CIPHER_OR_AKM = 29, + WIFI_REASON_NOT_AUTHORIZED_THIS_LOCATION = 30, + WIFI_REASON_SERVICE_CHANGE_PERCLUDES_TS = 31, + WIFI_REASON_UNSPECIFIED_QOS = 32, + WIFI_REASON_NOT_ENOUGH_BANDWIDTH = 33, + WIFI_REASON_MISSING_ACKS = 34, + WIFI_REASON_EXCEEDED_TXOP = 35, + WIFI_REASON_STA_LEAVING = 36, + WIFI_REASON_END_BA = 37, + WIFI_REASON_UNKNOWN_BA = 38, + WIFI_REASON_TIMEOUT = 39, + WIFI_REASON_PEER_INITIATED = 46, + WIFI_REASON_AP_INITIATED = 47, + WIFI_REASON_INVALID_FT_ACTION_FRAME_COUNT = 48, + WIFI_REASON_INVALID_PMKID = 49, + WIFI_REASON_INVALID_MDE = 50, + WIFI_REASON_INVALID_FTE = 51, + WIFI_REASON_TRANSMISSION_LINK_ESTABLISH_FAILED = 67, + WIFI_REASON_ALTERATIVE_CHANNEL_OCCUPIED = 68, + + WIFI_REASON_BEACON_TIMEOUT = 200, + WIFI_REASON_NO_AP_FOUND = 201, + WIFI_REASON_AUTH_FAIL = 202, + WIFI_REASON_ASSOC_FAIL = 203, + WIFI_REASON_HANDSHAKE_TIMEOUT = 204, + WIFI_REASON_CONNECTION_FAIL = 205, + WIFI_REASON_AP_TSF_RESET = 206, + WIFI_REASON_ROAMING = 207, + WIFI_REASON_ASSOC_COMEBACK_TIME_TOO_LONG = 208, + WIFI_REASON_SA_QUERY_TIMEOUT = 209, + WIFI_REASON_NO_AP_FOUND_W_COMPATIBLE_SECURITY = 210, + WIFI_REASON_NO_AP_FOUND_IN_AUTHMODE_THRESHOLD = 211, + WIFI_REASON_NO_AP_FOUND_IN_RSSI_THRESHOLD = 212, +} wifi_err_reason_t; + +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 +#define WIFI_ACTIVE_SCAN_MAX_DEFAULT_TIME 120 +#define WIFI_PASSIVE_SCAN_DEFAULT_TIME 360 +#define WIFI_SCAN_HOME_CHANNEL_DWELL_DEFAULT_TIME 30 + +#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\ +} + +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 1500ms 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 1500ms may + cause station to disconnect from AP and are not recommended. */ +} wifi_scan_time_t; + +typedef struct { + uint16_t ghz_2_channels; /**< Represents 2.4 GHz channels */ + uint32_t ghz_5_channels; /**< Represents 5 GHz channels */ +} 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 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. For 2.4ghz channels set ghz_2_channels from BIT(1) to BIT(14) from LSB to MSB order to indicate channels to be scanned. Currently scanning in 5ghz channels is not supported. Please note that the 'channel' parameter above needs to be set to 0 to allow scanning by bitmap. */ +} 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; + +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 WiFi antenna + * + */ +typedef enum { + WIFI_ANT_ANT0, /**< WiFi antenna 0 */ + WIFI_ANT_ANT1, /**< WiFi antenna 1 */ + WIFI_ANT_MAX, /**< Invalid WiFi antenna */ +} wifi_ant_t; + +/** @brief Description of a WiFi AP HE Info */ +typedef struct { + uint8_t bss_color: 6; /**< an unsigned integer whose value is the BSS Color of the BSS corresponding to the AP */ + uint8_t partial_bss_color: 1; /**< indicate if an AID assignment rule based on the BSS color */ + uint8_t bss_color_disabled: 1; /**< indicate if the use of BSS color is disabled */ + uint8_t bssid_index; /**< in M-BSSID set, identifies the nontransmitted BSSID */ +} wifi_he_ap_info_t; + +/** @brief Description of a WiFi 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; /**< authmode 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 */ + uint8_t bandwidth; /**< For either 20 MHz or 40 MHz operation, the Channel Width field is set to 0. + For AP 80 MHz this value is set to 1. For AP 160MHz sets this value is set to 2. + For AP 80+80MHz this value is set to 3*/ + 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+80MHz, 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+80MHz, and is used to transmit the center + channel frequency of the second segment. */ +} wifi_ap_record_t; + +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; + +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 WiFi fast scan */ +typedef struct { + int8_t rssi; /**< The minimum rssi to accept in the fast scan mode */ + wifi_auth_mode_t authmode; /**< The weakest authmode 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 authmode threshold as WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK to connect to WEP/WPA networks */ +} wifi_scan_threshold_t; + +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; + +#define WIFI_PROTOCOL_11B 0x1 +#define WIFI_PROTOCOL_11G 0x2 +#define WIFI_PROTOCOL_11N 0x4 +#define WIFI_PROTOCOL_LR 0x8 +#define WIFI_PROTOCOL_11A 0x10 +#define WIFI_PROTOCOL_11AC 0x20 +#define WIFI_PROTOCOL_11AX 0x40 + +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; + +/** 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; + +/** 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; + +/** 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. Default value: 2 */ + 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 */ +} wifi_ap_config_t; + +#define SAE_H2E_IDENTIFIER_LEN 32 +/** @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 of target AP. Set to 1~13 to scan starting from the specified channel before connecting to AP. If the channel of AP is unknown, set it to 0.*/ + 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; + +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, + WIFI_VND_IE_TYPE_PROBE_REQ, + WIFI_VND_IE_TYPE_PROBE_RESP, + WIFI_VND_IE_TYPE_ASSOC_REQ, + WIFI_VND_IE_TYPE_ASSOC_RESP, +} 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, + WIFI_VND_IE_ID_1, +} wifi_vendor_ie_id_t; + +#define WIFI_VENDOR_IE_ELEMENT_ID 0xDD + +/** + * @brief Operation Phymode + */ +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 WiFi events */ +#define WIFI_EVENT_MASK_NONE (0) /**< mask none of the WiFi 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 WiFi 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 WiFi 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 WiFi antenna mode + * + */ +typedef enum { + WIFI_ANT_MODE_ANT0, /**< Enable WiFi antenna 0 only */ + WIFI_ANT_MODE_ANT1, /**< Enable WiFi antenna 1 only */ + WIFI_ANT_MODE_AUTO, /**< Enable WiFi antenna 0 and 1, automatically select an antenna */ + WIFI_ANT_MODE_MAX, /**< Invalid WiFi enabled antenna */ +} wifi_ant_mode_t; + +/** + * @brief WiFi antenna configuration + * + */ +typedef struct { + wifi_ant_mode_t rx_ant_mode; /**< WiFi 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; /**< WiFi 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; /**< WiFi 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 +#define ESP_WIFI_NAN_DATAPATH_MAX_PEERS 2 + +#define ESP_WIFI_NDP_ROLE_INITIATOR 1 +#define ESP_WIFI_NDP_ROLE_RESPONDER 2 + +#define ESP_WIFI_MAX_SVC_NAME_LEN 256 +#define ESP_WIFI_MAX_FILTER_LEN 256 +#define ESP_WIFI_MAX_SVC_INFO_LEN 64 +#define ESP_WIFI_MAX_NEIGHBOR_REP_LEN 64 +/** + * @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]; /**< Service info shared in Publish frame */ + 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 reserved: 6; /**< Reserved */ +} 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]; /**< Service info shared in Subscribe frame */ + uint8_t single_match_event: 1; /**< Give single Match event or every time */ + uint8_t reserved: 7; /**< Reserved */ +} 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];/**< Service info(or message) to be shared */ +} 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 WiFi PHY rate encodings + * + */ +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 */ + /**< rate table and guard interval information for each MCS rate*/ + /* + ----------------------------------------------------------------------------------------------------------- + MCS RATE | HT20 | HT40 | HE20 | + WIFI_PHY_RATE_MCS0_LGI | 6.5 Mbps (800ns) | 13.5 Mbps (800ns) | 8.1 Mbps (1600ns) | + WIFI_PHY_RATE_MCS1_LGI | 13 Mbps (800ns) | 27 Mbps (800ns) | 16.3 Mbps (1600ns) | + WIFI_PHY_RATE_MCS2_LGI | 19.5 Mbps (800ns) | 40.5 Mbps (800ns) | 24.4 Mbps (1600ns) | + WIFI_PHY_RATE_MCS3_LGI | 26 Mbps (800ns) | 54 Mbps (800ns) | 32.5 Mbps (1600ns) | + WIFI_PHY_RATE_MCS4_LGI | 39 Mbps (800ns) | 81 Mbps (800ns) | 48.8 Mbps (1600ns) | + WIFI_PHY_RATE_MCS5_LGI | 52 Mbps (800ns) | 108 Mbps (800ns) | 65 Mbps (1600ns) | + WIFI_PHY_RATE_MCS6_LGI | 58.5 Mbps (800ns) | 121.5 Mbps (800ns) | 73.1 Mbps (1600ns) | + WIFI_PHY_RATE_MCS7_LGI | 65 Mbps (800ns) | 135 Mbps (800ns) | 81.3 Mbps (1600ns) | + WIFI_PHY_RATE_MCS8_LGI | ----- | ----- | 97.5 Mbps (1600ns) | + WIFI_PHY_RATE_MCS9_LGI | ----- | ----- | 108.3 Mbps (1600ns) | + ----------------------------------------------------------------------------------------------------------- + */ + 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 + /* + ----------------------------------------------------------------------------------------------------------- + MCS RATE | HT20 | HT40 | HE20 | + WIFI_PHY_RATE_MCS0_SGI | 7.2 Mbps (400ns) | 15 Mbps (400ns) | 8.6 Mbps (800ns) | + WIFI_PHY_RATE_MCS1_SGI | 14.4 Mbps (400ns) | 30 Mbps (400ns) | 17.2 Mbps (800ns) | + WIFI_PHY_RATE_MCS2_SGI | 21.7 Mbps (400ns) | 45 Mbps (400ns) | 25.8 Mbps (800ns) | + WIFI_PHY_RATE_MCS3_SGI | 28.9 Mbps (400ns) | 60 Mbps (400ns) | 34.4 Mbps (800ns) | + WIFI_PHY_RATE_MCS4_SGI | 43.3 Mbps (400ns) | 90 Mbps (400ns) | 51.6 Mbps (800ns) | + WIFI_PHY_RATE_MCS5_SGI | 57.8 Mbps (400ns) | 120 Mbps (400ns) | 68.8 Mbps (800ns) | + WIFI_PHY_RATE_MCS6_SGI | 65 Mbps (400ns) | 135 Mbps (400ns) | 77.4 Mbps (800ns) | + WIFI_PHY_RATE_MCS7_SGI | 72.2 Mbps (400ns) | 150 Mbps (400ns) | 86 Mbps (800ns) | + WIFI_PHY_RATE_MCS8_SGI | ----- | ----- | 103.2 Mbps (800ns) | + WIFI_PHY_RATE_MCS9_SGI | ----- | ----- | 114.7 Mbps (800ns) | + ----------------------------------------------------------------------------------------------------------- + */ + 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, /**< 250 Kbps */ + WIFI_PHY_RATE_LORA_500K = 0x2A, /**< 500 Kbps */ + WIFI_PHY_RATE_MAX, +} wifi_phy_rate_t; + +/** WiFi event declarations */ +typedef enum { + WIFI_EVENT_WIFI_READY = 0, /**< WiFi 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 */ + + 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, /**< WiFi home channel change,doesn't occur when scanning */ + + WIFI_EVENT_STA_NEIGHBOR_REP, /**< Received Neighbor Report response */ + + WIFI_EVENT_MAX, /**< Invalid WiFi event ID */ +} wifi_event_t; + +/** @cond **/ +/** @brief WiFi event base declaration */ +ESP_EVENT_DECLARE_BASE(WIFI_EVENT); +/** @endcond **/ + +/** 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; + +/** 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 AP*/ + uint16_t aid; /**< authentication id assigned by the connected AP */ +} wifi_event_sta_connected_t; + +/** 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; /**< reason of disconnection */ + int8_t rssi; /**< rssi of disconnection */ +} wifi_event_sta_disconnected_t; + +/** Argument structure for WIFI_EVENT_STA_AUTHMODE_CHANGE event */ +typedef struct { + wifi_auth_mode_t old_mode; /**< the old auth mode of AP */ + wifi_auth_mode_t new_mode; /**< the new auth mode of AP */ +} wifi_event_sta_authmode_change_t; + +/** 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; + +/** 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 +} wifi_event_sta_wps_fail_reason_t; + +#define MAX_SSID_LEN 32 +#define MAX_PASSPHRASE_LEN 64 +#define MAX_WPS_AP_CRED 3 + +/** Argument structure for WIFI_EVENT_STA_WPS_ER_SUCCESS event */ +typedef struct { + uint8_t ap_cred_cnt; /**< Number of AP credentials received */ + struct { + uint8_t ssid[MAX_SSID_LEN]; /**< SSID of AP */ + uint8_t passphrase[MAX_PASSPHRASE_LEN]; /**< Passphrase for the AP */ + } ap_cred[MAX_WPS_AP_CRED]; /**< All AP credentials received from WPS handshake */ +} wifi_event_sta_wps_er_success_t; + +/** Argument structure for WIFI_EVENT_AP_STACONNECTED event */ +typedef struct { + uint8_t mac[6]; /**< MAC address of the station connected to Soft-AP */ + uint8_t aid; /**< the aid that soft-AP gives to the station connected to */ + bool is_mesh_child; /**< flag to identify mesh child */ +} wifi_event_ap_staconnected_t; + +/** Argument structure for WIFI_EVENT_AP_STADISCONNECTED event */ +typedef struct { + uint8_t mac[6]; /**< MAC address of the station disconnects to soft-AP */ + uint8_t aid; /**< the aid that soft-AP gave to the station disconnects to */ + bool is_mesh_child; /**< flag to identify mesh child */ + uint16_t reason; /**< reason of disconnection */ +} wifi_event_ap_stadisconnected_t; + +/** 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; + +/** 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; + +/** 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; + +/** Argument structure for */ +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; + +/** 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) +#define WIFI_STATIS_RXTX (1<<1) +#define WIFI_STATIS_HW (1<<2) +#define WIFI_STATIS_DIAG (1<<3) +#define WIFI_STATIS_PS (1<<4) +#define WIFI_STATIS_ALL (-1) + +/** Argument structure for WIFI_EVENT_ACTION_TX_STATUS event */ +typedef struct { + wifi_interface_t ifx; /**< WiFi 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; + +/** Argument structure for WIFI_EVENT_ROC_DONE event */ +typedef struct { + uint32_t context; /**< Context to identify the request */ +} wifi_event_roc_done_t; + +/** 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; + +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, +} wps_fail_reason_t; + +/** 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; + +/** 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; + +/** 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 */ +} wifi_event_nan_svc_match_t; + +/** 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 */ +} wifi_event_nan_replied_t; + +/** 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];/**< Peer Service Info */ +} wifi_event_nan_receive_t; + +/** 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];/**< Service Specific Info */ +} wifi_event_ndp_indication_t; + +/** 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];/**< Service Specific Info */ +} wifi_event_ndp_confirm_t; + +/** 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; + +/** 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*/ + uint16_t report_len; /**< Length of the report*/ +} wifi_event_neighbor_report_t; + +/** Argument structure for wifi band */ +typedef enum { + WIFI_BAND_2G = 1, /* Band is 2.4G */ + WIFI_BAND_5G = 2, /* Band is 5G */ + WIFI_BAND_2G_5G = 3, /* Band is 2,4G + 5G */ +} wifi_band_t; + +#ifdef __cplusplus +} +#endif + +#endif /* __ESP_WIFI_TYPES_H__ */ diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_types_native.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/include/injected/esp_wifi_types_native.h new file mode 100644 index 0000000..4ae9c80 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/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 +#define ESP_WIFI_MAX_CONN_NUM (10) /**< max number of stations which can connect to ESP32C3 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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/wifi_apps/roaming_app/src/Kconfig.roaming b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.1/wifi_apps/roaming_app/src/Kconfig.roaming new file mode 100644 index 0000000..e69de29 diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/Kconfig.slave_select.in b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/Kconfig.slave_select.in new file mode 100644 index 0000000..1e11562 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/Kconfig.slave_select.in @@ -0,0 +1,17 @@ +# This file is auto-generated + choice SLAVE_IDF_TARGET + prompt "choose slave target" + 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" + endchoice diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/Kconfig.soc_wifi_caps.in b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/Kconfig.soc_wifi_caps.in new file mode 100644 index 0000000..61e6fc3 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/Kconfig.soc_wifi_caps.in @@ -0,0 +1,265 @@ +# 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_FREERTOS_UNICORE # ignore: multiple-definition + bool + default y + + config SLAVE_IDF_TARGET_ARCH_RISCV # ignore: multiple-definition + bool + default y + +endif # ESP32C6 diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/Kconfig.wifi.in b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/Kconfig.wifi.in new file mode 100644 index 0000000..2e93456 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/Kconfig.wifi.in @@ -0,0 +1,1135 @@ +# 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 + default 16 if SPIRAM_TRY_ALLOCATE_WIFI_LWIP + 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_USE_MALLOC +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 + range 16 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 + default 16 if SPIRAM_TRY_ALLOCATE_WIFI_LWIP + 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 SPIRAM + 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). + Only APIs which are helpful for network assisted roaming + are supported for now. + Enable this option with BTM and RRM 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. + 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_SCAN_CACHE + bool "Keep scan results in cache" + depends on WIFI_RMT_11KV_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_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 + select WIFI_RMT_SCAN_CACHE + 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_HE_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_HE_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_HE_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_HE_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 + 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 SPIRAM + 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_SCAN_CACHE + config ESP_WIFI_SCAN_CACHE # ignore: multiple-definition + bool + depends on WIFI_RMT_11KV_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_HE_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_HE_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_HE_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_HE_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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/esp_wifi_remote_weak.c b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/esp_wifi_remote_weak.c new file mode 100644 index 0000000..1d63acb --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/esp_wifi_remote_weak.c @@ -0,0 +1,392 @@ +/* + * 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_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); +} diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/esp_wifi_with_remote.c b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/esp_wifi_with_remote.c new file mode 100644 index 0000000..280da5c --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/esp_wifi_with_remote.c @@ -0,0 +1,388 @@ +/* + * 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_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); +} diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/esp_wifi_default_config.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/esp_wifi_default_config.h new file mode 100644 index 0000000..f3bdb13 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/esp_wifi_default_config.h @@ -0,0 +1,769 @@ +/* + * 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_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_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_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_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_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_ESP_WIFI_REMOTE_LIBRARY_HOSTED 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_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_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_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_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_ESP32C5 + +#if CONFIG_SLAVE_IDF_TARGET_ESP32C61 +#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_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_ESP32C61 diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/esp_wifi_remote_api.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/esp_wifi_remote_api.h new file mode 100644 index 0000000..f3ef2b2 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/esp_wifi_remote_api.h @@ -0,0 +1,83 @@ +/* + * 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_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); diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_mesh.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_mesh.h new file mode 100644 index 0000000..7a7e85c --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_mesh.h @@ -0,0 +1,1692 @@ +/* + * 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) /**< XMIT */ +#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_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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_mesh_internal.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_mesh_internal.h new file mode 100644 index 0000000..4c6a998 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_now.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_now.h new file mode 100644 index 0000000..60b5cd9 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_now.h @@ -0,0 +1,387 @@ +/* + * 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 */ + +/** + * @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 struct esp_now_rate_config { + wifi_phy_mode_t phymode; /**< ESPNOW phymode of specified interface */ + wifi_phy_rate_t rate; /**< ESPNOW rate of specified interface */ + bool ersu; /**< ESPNOW 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; /**< ESPNOW using dcm rate to send frame */ +} 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 one version: v1.0. + * + * The v1.0 devices can receive 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 discard the packet entirely. + * + * @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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi.h new file mode 100644 index 0000000..5697a73 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi.h @@ -0,0 +1,1650 @@ +/* + * 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 + +#if CONFIG_SPIRAM +#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 CONFIG_SPIRAM +#define WIFI_ENABLE_SPIRAM (1<<1) +#else +#define WIFI_ENABLE_SPIRAM 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_SPIRAM | \ + 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_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 Get AP list found in last scan. + * + * @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 is 2.4G, the default protocol is (WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_11AX). + * if CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT and band is 5G, the default protocol is (WIFI_PROTOCOL_11A|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_11AC|WIFI_PROTOCOL_11AX). + * + * @attention 2.4G: Support 802.11b or 802.11bg or 802.11bgn or 802.11bgnax or LR mode + * 5G: Support 802.11a or 802.11an or 802.11anac or 802.11anacax + * + * @param ifx interfaces + * @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 + * - 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 + * + * @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 + * - 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. API return false if try to configure an interface that is not enabled + * @attention 2. WIFI_BW_HT40 is supported only when the interface support 11N + * + * @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 + * - 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. API return false if try to get a interface that is not enable + * + * @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_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(). + * + * @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 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); + +#if SOC_WIFI_HE_SUPPORT_5G +/** + * @brief Set wifi band. + * + * @param[in] band wifi band 2.4G / 5G / 2.4G + 5G + * + * @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_band(wifi_band_t band); + +/** + * @brief Get wifi band. + * + * @param[in] band store 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); +#endif /* SOC_WIFI_HE_SUPPORT_5G */ + +#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 + +#ifdef __cplusplus +} +#endif + +#endif /* __ESP_WIFI_H__ */ diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_ap_get_sta_list.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_ap_get_sta_list.h new file mode 100644 index 0000000..812c4ea --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.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 +#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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_crypto_types.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_crypto_types.h new file mode 100644 index 0000000..c8601e7 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_crypto_types.h @@ -0,0 +1,440 @@ +/* + * 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_aes_wrap_t aes_wrap; /**< The AES wrap callback function used by esp_wifi */ + esp_aes_unwrap_t aes_unwrap; /**< The AES unwrap callback function used by esp_wifi */ + esp_hmac_sha256_vector_t hmac_sha256_vector; /**< The SHA256 callback function used by esp_wifi */ + esp_sha256_prf_t sha256_prf; /**< The SHA256 PRF callback function used by esp_wifi */ + esp_hmac_md5_t hmac_md5; /**< HMAC-MD5 callback function over data buffer (RFC 2104) */ + esp_hmac_md5_vector_t hamc_md5_vector; /**< HMAC-MD5 callback function over data vector (RFC 2104) */ + esp_hmac_sha1_t hmac_sha1; /**< HMAC-SHA1 callback function over data buffer (RFC 2104) */ + esp_hmac_sha1_vector_t hmac_sha1_vector; /**< HMAC-SHA1 callback function over data vector (RFC 2104) */ + esp_sha1_prf_t sha1_prf; /**< SHA1-based Pseudo-Random Function (PRF) (IEEE 802.11i, 8.5.1.1) callback function */ + esp_sha1_vector_t sha1_vector; /**< SHA-1 hash callback function for data vector */ + esp_pbkdf2_sha1_t pbkdf2_sha1; /**< SHA1-based key derivation function (PBKDF2) callback function for IEEE 802.11i */ + esp_rc4_skip_t rc4_skip; /**< XOR RC4 stream callback function to given data with skip-stream-start */ + esp_md5_vector_t md5_vector; /**< MD5 hash callback function for data vector */ + esp_aes_encrypt_t aes_encrypt; /**< Encrypt one AES block callback function */ + esp_aes_encrypt_init_t aes_encrypt_init; /**< Initialize AES callback function for encryption */ + esp_aes_encrypt_deinit_t aes_encrypt_deinit; /**< Deinitialize AES encryption callback function */ + esp_aes_decrypt_t aes_decrypt; /**< Decrypt one AES block callback function */ + esp_aes_decrypt_init_t aes_decrypt_init; /**< Initialize AES callback function for decryption */ + esp_aes_decrypt_deinit_t aes_decrypt_deinit; /**< Deinitialize AES decryption callback function */ + 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 */ + esp_crc32_le_t crc32; /**< CRC32 value callback function in little endian */ +} 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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_default.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_default.h new file mode 100644 index 0000000..d30d512 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_he.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_he.h new file mode 100644 index 0000000..57bf819 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_he.h @@ -0,0 +1,221 @@ +/* + * 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_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); + +#ifdef __cplusplus +} +#endif diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_he_types.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_he_types.h new file mode 100644 index 0000000..f79f723 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.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_IDF_TARGET_ESP32C5 +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_IDF_TARGET_ESP32C5 +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 */ + unsigned 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: 4; /**< the primary channel */ + unsigned second: 4; /**< the second channel if in HT40 */ + unsigned : 12; /**< 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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_netif.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_netif.h new file mode 100644 index 0000000..7dfa724 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_types.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_types.h new file mode 100644 index 0000000..ef9f09c --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_types_generic.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_types_generic.h new file mode 100644 index 0000000..142ea23 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_types_generic.h @@ -0,0 +1,1216 @@ +/* + * SPDX-FileCopyrightText: 2015-2024 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 */ +} 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_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, /**< Association expired */ + WIFI_REASON_ASSOC_TOOMANY = 5, /**< Too many associated stations */ + WIFI_REASON_NOT_AUTHED = 6, /**< Not authenticated */ + WIFI_REASON_NOT_ASSOCED = 7, /**< Not associated */ + 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 */ + uint32_t ghz_5_channels; /**< Represents 5 GHz channels */ +} 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. For 2.4ghz channels set ghz_2_channels from BIT(1) to BIT(14) from LSB to MSB order to indicate channels to be scanned. Currently scanning in 5ghz channels is not supported. Please note that the 'channel' parameter above needs to be set to 0 to allow scanning by bitmap. */ +} 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 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 */ + uint8_t bandwidth; /**< For AP 20 MHz this value is set to 1. For AP 40 MHz this value is set to 2. + For AP 80 MHz this value is set to 3. For AP 160MHz this value is set to 4. + For AP 80+80MHz this value is set to 5*/ + 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 */ + 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 */ +} 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; + +#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 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 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. Default value: 2 */ + 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 */ +} 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 of target AP. Set to 1~13 to scan starting from the specified channel before connecting to AP. If the channel of AP is unknown, set it to 0.*/ + 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_NEIGHBOR_REP_LEN 64 /**< Maximum length of NAN Neighbor Report */ + +/** + * @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]; /**< Service info shared in Publish frame */ + 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 reserved: 6; /**< Reserved */ +} 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]; /**< Service info shared in Subscribe frame */ + uint8_t single_match_event: 1; /**< Give single Match event or every time */ + uint8_t reserved: 7; /**< Reserved */ +} 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];/**< Service info(or message) to be shared */ +} 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_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 AP*/ + 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 statistic */ +#define WIFI_STATIS_RXTX (1<<1) /**< RX/TX statistic */ +#define WIFI_STATIS_HW (1<<2) /**< Hardware statistic */ +#define WIFI_STATIS_DIAG (1<<3) /**< Diagnostic statistic */ +#define WIFI_STATIS_PS (1<<4) /**< Power save statistic */ +#define WIFI_STATIS_ALL (-1) /**< All statistic */ + +/** + * @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 */ +} 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 */ +} 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];/**< Peer Service Info */ +} 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];/**< Service Specific Info */ +} 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];/**< Service Specific Info */ +} 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*/ + uint16_t report_len; /**< Length of the report*/ +} wifi_event_neighbor_report_t; + +/** Argument structure for wifi band */ +typedef enum { + WIFI_BAND_2G = 1, /* Band is 2.4G */ + WIFI_BAND_5G = 2, /* Band is 5G */ + WIFI_BAND_2G_5G = 3, /* Band is 2,4G + 5G */ +} wifi_band_t; + +#ifdef __cplusplus +} +#endif + +#endif /* __ESP_WIFI_TYPES_H__ */ diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_types_native.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/include/injected/esp_wifi_types_native.h new file mode 100644 index 0000000..4ae9c80 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.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 +#define ESP_WIFI_MAX_CONN_NUM (10) /**< max number of stations which can connect to ESP32C3 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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/wifi_apps/roaming_app/src/Kconfig.roaming b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.2/wifi_apps/roaming_app/src/Kconfig.roaming new file mode 100644 index 0000000..e69de29 diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/Kconfig.slave_select.in b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/Kconfig.slave_select.in new file mode 100644 index 0000000..1e11562 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/Kconfig.slave_select.in @@ -0,0 +1,17 @@ +# This file is auto-generated + choice SLAVE_IDF_TARGET + prompt "choose slave target" + 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" + endchoice diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/Kconfig.soc_wifi_caps.in b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/Kconfig.soc_wifi_caps.in new file mode 100644 index 0000000..61e6fc3 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/Kconfig.soc_wifi_caps.in @@ -0,0 +1,265 @@ +# 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_FREERTOS_UNICORE # ignore: multiple-definition + bool + default y + + config SLAVE_IDF_TARGET_ARCH_RISCV # ignore: multiple-definition + bool + default y + +endif # ESP32C6 diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/Kconfig.wifi.in b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/Kconfig.wifi.in new file mode 100644 index 0000000..296a066 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/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_HE_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_HE_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_HE_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_HE_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_HE_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_HE_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_HE_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_HE_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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/esp_wifi_remote_weak.c b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/esp_wifi_remote_weak.c new file mode 100644 index 0000000..a518d09 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/esp_wifi_remote_weak.c @@ -0,0 +1,397 @@ +/* + * 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); +} diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/esp_wifi_with_remote.c b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/esp_wifi_with_remote.c new file mode 100644 index 0000000..a66ac02 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/esp_wifi_with_remote.c @@ -0,0 +1,393 @@ +/* + * 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); +} diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/esp_wifi_default_config.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/esp_wifi_default_config.h new file mode 100644 index 0000000..f3bdb13 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/esp_wifi_default_config.h @@ -0,0 +1,769 @@ +/* + * 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_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_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_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_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_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_ESP_WIFI_REMOTE_LIBRARY_HOSTED 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_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_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_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_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_ESP32C5 + +#if CONFIG_SLAVE_IDF_TARGET_ESP32C61 +#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_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_ESP32C61 diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/esp_wifi_remote_api.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/esp_wifi_remote_api.h new file mode 100644 index 0000000..71e471d --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/esp_wifi_remote_api.h @@ -0,0 +1,84 @@ +/* + * 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); diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_mesh.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_mesh.h new file mode 100644 index 0000000..7a7e85c --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_mesh.h @@ -0,0 +1,1692 @@ +/* + * 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) /**< XMIT */ +#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_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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_mesh_internal.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_mesh_internal.h new file mode 100644 index 0000000..4c6a998 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_now.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_now.h new file mode 100644 index 0000000..e026137 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_now.h @@ -0,0 +1,380 @@ +/* + * SPDX-FileCopyrightText: 2019-2025 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 */ + +/** + * @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 one version: v1.0. + * + * The v1.0 devices can receive 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 discard the packet entirely. + * + * @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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi.h new file mode 100644 index 0000000..e255827 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi.h @@ -0,0 +1,1666 @@ +/* + * SPDX-FileCopyrightText: 2015-2025 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_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 is 2.4G, the default protocol is (WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_11AX). + * if CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT and band is 5G, the default protocol is (WIFI_PROTOCOL_11A|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_11AC|WIFI_PROTOCOL_11AX). + * + * @attention 2.4G: Support 802.11b or 802.11bg or 802.11bgn or 802.11bgnax or LR mode + * 5G: Support 802.11a or 802.11an or 802.11anac or 802.11anacax + * + * @param ifx interfaces + * @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 + * - 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 + * + * @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 + * - 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. API return false if try to configure an interface that is not enabled + * @attention 2. WIFI_BW_HT40 is supported only when the interface support 11N + * + * @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 + * - 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. API return false if try to get a interface that is not enable + * + * @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_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); + +#if SOC_WIFI_HE_SUPPORT_5G +/** + * @brief Set wifi band. + * + * @param[in] band wifi band 2.4G / 5G / 2.4G + 5G + * + * @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_band(wifi_band_t band); + +/** + * @brief Get wifi band. + * + * @param[in] band store 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); +#endif /* SOC_WIFI_HE_SUPPORT_5G */ + +#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 + +#ifdef __cplusplus +} +#endif + +#endif /* __ESP_WIFI_H__ */ diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_ap_get_sta_list.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_ap_get_sta_list.h new file mode 100644 index 0000000..fc53918 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_crypto_types.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_crypto_types.h new file mode 100644 index 0000000..c8601e7 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_crypto_types.h @@ -0,0 +1,440 @@ +/* + * 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_aes_wrap_t aes_wrap; /**< The AES wrap callback function used by esp_wifi */ + esp_aes_unwrap_t aes_unwrap; /**< The AES unwrap callback function used by esp_wifi */ + esp_hmac_sha256_vector_t hmac_sha256_vector; /**< The SHA256 callback function used by esp_wifi */ + esp_sha256_prf_t sha256_prf; /**< The SHA256 PRF callback function used by esp_wifi */ + esp_hmac_md5_t hmac_md5; /**< HMAC-MD5 callback function over data buffer (RFC 2104) */ + esp_hmac_md5_vector_t hamc_md5_vector; /**< HMAC-MD5 callback function over data vector (RFC 2104) */ + esp_hmac_sha1_t hmac_sha1; /**< HMAC-SHA1 callback function over data buffer (RFC 2104) */ + esp_hmac_sha1_vector_t hmac_sha1_vector; /**< HMAC-SHA1 callback function over data vector (RFC 2104) */ + esp_sha1_prf_t sha1_prf; /**< SHA1-based Pseudo-Random Function (PRF) (IEEE 802.11i, 8.5.1.1) callback function */ + esp_sha1_vector_t sha1_vector; /**< SHA-1 hash callback function for data vector */ + esp_pbkdf2_sha1_t pbkdf2_sha1; /**< SHA1-based key derivation function (PBKDF2) callback function for IEEE 802.11i */ + esp_rc4_skip_t rc4_skip; /**< XOR RC4 stream callback function to given data with skip-stream-start */ + esp_md5_vector_t md5_vector; /**< MD5 hash callback function for data vector */ + esp_aes_encrypt_t aes_encrypt; /**< Encrypt one AES block callback function */ + esp_aes_encrypt_init_t aes_encrypt_init; /**< Initialize AES callback function for encryption */ + esp_aes_encrypt_deinit_t aes_encrypt_deinit; /**< Deinitialize AES encryption callback function */ + esp_aes_decrypt_t aes_decrypt; /**< Decrypt one AES block callback function */ + esp_aes_decrypt_init_t aes_decrypt_init; /**< Initialize AES callback function for decryption */ + esp_aes_decrypt_deinit_t aes_decrypt_deinit; /**< Deinitialize AES decryption callback function */ + 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 */ + esp_crc32_le_t crc32; /**< CRC32 value callback function in little endian */ +} 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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_default.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_default.h new file mode 100644 index 0000000..d30d512 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_he.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_he.h new file mode 100644 index 0000000..57bf819 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_he.h @@ -0,0 +1,221 @@ +/* + * 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_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); + +#ifdef __cplusplus +} +#endif diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_he_types.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_he_types.h new file mode 100644 index 0000000..f79f723 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/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_IDF_TARGET_ESP32C5 +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_IDF_TARGET_ESP32C5 +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 */ + unsigned 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: 4; /**< the primary channel */ + unsigned second: 4; /**< the second channel if in HT40 */ + unsigned : 12; /**< 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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_netif.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_netif.h new file mode 100644 index 0000000..7dfa724 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_types.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_types.h new file mode 100644 index 0000000..ef9f09c --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_types_generic.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_types_generic.h new file mode 100644 index 0000000..90f323f --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_types_generic.h @@ -0,0 +1,1238 @@ +/* + * 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 */ +} 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_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_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, /**< Association expired. Deprecated, will be removed in next IDF major release */ + WIFI_REASON_DISASSOC_DUE_TO_INACTIVITY = 4, + WIFI_REASON_ASSOC_TOOMANY = 5, /**< Too many associated stations */ + WIFI_REASON_NOT_AUTHED = 6, /**< Not authenticated. Deprecated, will be removed in next IDF major release */ + WIFI_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6, + WIFI_REASON_NOT_ASSOCED = 7, /**< Not associated. Deprecated, will be removed in next IDF major release */ + WIFI_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7, + 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 */ + uint32_t ghz_5_channels; /**< Represents 5 GHz channels */ +} 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. For 2.4ghz channels set ghz_2_channels from BIT(1) to BIT(14) from LSB to MSB order to indicate channels to be scanned. Currently scanning in 5ghz channels is not supported. Please note that the 'channel' parameter above needs to be set to 0 to allow scanning by bitmap. */ +} 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 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 */ + uint8_t bandwidth; /**< For AP 20 MHz this value is set to 1. For AP 40 MHz this value is set to 2. + For AP 80 MHz this value is set to 3. For AP 160MHz this value is set to 4. + For AP 80+80MHz this value is set to 5*/ + 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 */ + 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 */ +} 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; + +#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 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 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 of target AP. Set to 1~13 to scan starting from the specified channel before connecting to AP. If the channel of AP is unknown, set it to 0.*/ + 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_NEIGHBOR_REP_LEN 64 /**< Maximum length of NAN Neighbor Report */ + +/** + * @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]; /**< Service info shared in Publish frame */ + 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 reserved: 6; /**< Reserved */ +} 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]; /**< Service info shared in Subscribe frame */ + uint8_t single_match_event: 1; /**< Give single Match event or every time */ + uint8_t reserved: 7; /**< Reserved */ +} 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];/**< Service info(or message) to be shared */ +} 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 AP*/ + 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 statistic */ +#define WIFI_STATIS_RXTX (1<<1) /**< RX/TX statistic */ +#define WIFI_STATIS_HW (1<<2) /**< Hardware statistic */ +#define WIFI_STATIS_DIAG (1<<3) /**< Diagnostic statistic */ +#define WIFI_STATIS_PS (1<<4) /**< Power save statistic */ +#define WIFI_STATIS_ALL (-1) /**< All statistic */ + +/** + * @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 */ +} 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 */ +} 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];/**< Peer Service Info */ +} 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];/**< Service Specific Info */ +} 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];/**< Service Specific Info */ +} 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 band */ +typedef enum { + WIFI_BAND_2G = 1, /* Band is 2.4G */ + WIFI_BAND_5G = 2, /* Band is 5G */ + WIFI_BAND_2G_5G = 3, /* Band is 2,4G + 5G */ +} wifi_band_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/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_types_native.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/include/injected/esp_wifi_types_native.h new file mode 100644 index 0000000..4ae9c80 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.3.3/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 +#define ESP_WIFI_MAX_CONN_NUM (10) /**< max number of stations which can connect to ESP32C3 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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/Kconfig.slave_select.in b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/Kconfig.slave_select.in new file mode 100644 index 0000000..5e31536 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/Kconfig.slave_select.in @@ -0,0 +1,21 @@ +# This file is auto-generated + choice SLAVE_IDF_TARGET + prompt "choose slave target" + 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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/Kconfig.soc_wifi_caps.in b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/Kconfig.soc_wifi_caps.in new file mode 100644 index 0000000..34ed3d9 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/Kconfig.wifi.in b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/Kconfig.wifi.in new file mode 100644 index 0000000..ba67a78 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/esp_wifi_remote_weak.c b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/esp_wifi_remote_weak.c new file mode 100644 index 0000000..f71697b --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/esp_wifi_with_remote.c b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/esp_wifi_with_remote.c new file mode 100644 index 0000000..60fe08b --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/esp_wifi_default_config.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/esp_wifi_default_config.h new file mode 100644 index 0000000..e75df8a --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/esp_wifi_default_config.h @@ -0,0 +1,791 @@ +/* + * 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_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_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_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_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_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_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_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_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_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_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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/esp_wifi_remote_api.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/esp_wifi_remote_api.h new file mode 100644 index 0000000..b61b1c2 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_mesh.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_mesh.h new file mode 100644 index 0000000..7a7e85c --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_mesh.h @@ -0,0 +1,1692 @@ +/* + * 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) /**< XMIT */ +#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_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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_mesh_internal.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_mesh_internal.h new file mode 100644 index 0000000..4c6a998 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_now.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_now.h new file mode 100644 index 0000000..1fcffa4 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/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 1490 /**< 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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi.h new file mode 100644 index 0000000..cd87f54 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi.h @@ -0,0 +1,1795 @@ +/* + * 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_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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_ap_get_sta_list.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_ap_get_sta_list.h new file mode 100644 index 0000000..fc53918 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_crypto_types.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_crypto_types.h new file mode 100644 index 0000000..a85b443 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_default.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_default.h new file mode 100644 index 0000000..d30d512 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_he.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_he.h new file mode 100644 index 0000000..619c7b3 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_he_types.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_he_types.h new file mode 100644 index 0000000..bd7197d --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/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 */ + unsigned 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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_netif.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_netif.h new file mode 100644 index 0000000..7dfa724 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_types.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_types.h new file mode 100644 index 0000000..ef9f09c --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_types_generic.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_types_generic.h new file mode 100644 index 0000000..86e201a --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_types_generic.h @@ -0,0 +1,1340 @@ +/* + * SPDX-FileCopyrightText: 2015-2024 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 */ + 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 of 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. If the channel of AP is unknown, set it to 0.*/ + 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_NEIGHBOR_REP_LEN 64 /**< Maximum length of NAN Neighbor Report */ + +/** + * @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]; /**< Service info shared in Publish frame */ + 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 reserved: 6; /**< Reserved */ +} 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]; /**< Service info shared in Subscribe frame */ + uint8_t single_match_event: 1; /**< Give single Match event or every time */ + uint8_t reserved: 7; /**< Reserved */ +} 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];/**< Service info(or message) to be shared */ +} 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 */ +} 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 */ +} 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];/**< Peer Service Info */ +} 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];/**< Service Specific Info */ +} 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];/**< Service Specific Info */ +} 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/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_types_native.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/include/injected/esp_wifi_types_native.h new file mode 100644 index 0000000..0963572 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4.1/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/Kconfig.slave_select.in b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/Kconfig.slave_select.in new file mode 100644 index 0000000..5e31536 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/Kconfig.slave_select.in @@ -0,0 +1,21 @@ +# This file is auto-generated + choice SLAVE_IDF_TARGET + prompt "choose slave target" + 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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/Kconfig.soc_wifi_caps.in b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/Kconfig.soc_wifi_caps.in new file mode 100644 index 0000000..77a5b7e --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/Kconfig.soc_wifi_caps.in @@ -0,0 +1,377 @@ +# 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_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_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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/Kconfig.wifi.in b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/Kconfig.wifi.in new file mode 100644 index 0000000..a2cc0a3 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/Kconfig.wifi.in @@ -0,0 +1,1135 @@ +# 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). + Only APIs which are helpful for network assisted roaming + are supported for now. + Enable this option with BTM and RRM 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. + 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_SCAN_CACHE + bool "Keep scan results in cache" + depends on WIFI_RMT_11KV_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_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 + select WIFI_RMT_SCAN_CACHE + 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_SCAN_CACHE + config ESP_WIFI_SCAN_CACHE # ignore: multiple-definition + bool + depends on WIFI_RMT_11KV_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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/esp_wifi_remote_weak.c b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/esp_wifi_remote_weak.c new file mode 100644 index 0000000..ae8488a --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/esp_wifi_remote_weak.c @@ -0,0 +1,432 @@ +/* + * 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_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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/esp_wifi_with_remote.c b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/esp_wifi_with_remote.c new file mode 100644 index 0000000..7524672 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/esp_wifi_with_remote.c @@ -0,0 +1,428 @@ +/* + * 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_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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/esp_wifi_default_config.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/esp_wifi_default_config.h new file mode 100644 index 0000000..e75df8a --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/esp_wifi_default_config.h @@ -0,0 +1,791 @@ +/* + * 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_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_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_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_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_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_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_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_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_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_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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/esp_wifi_remote_api.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/esp_wifi_remote_api.h new file mode 100644 index 0000000..f87a37c --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/esp_wifi_remote_api.h @@ -0,0 +1,91 @@ +/* + * 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_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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_mesh.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_mesh.h new file mode 100644 index 0000000..7a7e85c --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_mesh.h @@ -0,0 +1,1692 @@ +/* + * 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) /**< XMIT */ +#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_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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_mesh_internal.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_mesh_internal.h new file mode 100644 index 0000000..4c6a998 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_now.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_now.h new file mode 100644 index 0000000..af7695e --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_now.h @@ -0,0 +1,390 @@ +/* + * 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 1490 /**< 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 struct esp_now_rate_config { + wifi_phy_mode_t phymode; /**< ESPNOW phymode of specified interface */ + wifi_phy_rate_t rate; /**< ESPNOW rate of specified interface */ + bool ersu; /**< ESPNOW 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; /**< ESPNOW using dcm rate to send frame */ +} 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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi.h new file mode 100644 index 0000000..6f48126 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi.h @@ -0,0 +1,1778 @@ +/* + * 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_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 Get AP list found in last scan. + * + * @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(). + * + * @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 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_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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_ap_get_sta_list.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_ap_get_sta_list.h new file mode 100644 index 0000000..fc53918 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_crypto_types.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_crypto_types.h new file mode 100644 index 0000000..a85b443 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_default.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_default.h new file mode 100644 index 0000000..d30d512 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_he.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_he.h new file mode 100644 index 0000000..619c7b3 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_he_types.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_he_types.h new file mode 100644 index 0000000..91a68cf --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/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 */ + unsigned 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: 4; /**< the primary channel */ + unsigned second: 4; /**< the second channel if in HT40 */ + unsigned : 12; /**< 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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_netif.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_netif.h new file mode 100644 index 0000000..7dfa724 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_types.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_types.h new file mode 100644 index 0000000..ef9f09c --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_types_generic.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_types_generic.h new file mode 100644 index 0000000..9a7970f --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_types_generic.h @@ -0,0 +1,1320 @@ +/* + * SPDX-FileCopyrightText: 2015-2024 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 */ + 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. Range: 1 ~ 30. 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 */ +} 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 of 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. If the channel of AP is unknown, set it to 0.*/ + 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_NEIGHBOR_REP_LEN 64 /**< Maximum length of NAN Neighbor Report */ + +/** + * @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]; /**< Service info shared in Publish frame */ + 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 reserved: 6; /**< Reserved */ +} 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]; /**< Service info shared in Subscribe frame */ + uint8_t single_match_event: 1; /**< Give single Match event or every time */ + uint8_t reserved: 7; /**< Reserved */ +} 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];/**< Service info(or message) to be shared */ +} 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_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 AP*/ + 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 */ +} 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 */ +} 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];/**< Peer Service Info */ +} 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];/**< Service Specific Info */ +} 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];/**< Service Specific Info */ +} 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*/ + uint16_t report_len; /**< Length of the report*/ +} wifi_event_neighbor_report_t; + +#ifdef __cplusplus +} +#endif + +#endif /* __ESP_WIFI_TYPES_H__ */ diff --git a/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_types_native.h b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/include/injected/esp_wifi_types_native.h new file mode 100644 index 0000000..0963572 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/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/resources/espressif__esp_wifi_remote/idf_tag_v5.4/wifi_apps/roaming_app/src/Kconfig.roaming b/resources/espressif__esp_wifi_remote/idf_tag_v5.4/wifi_apps/roaming_app/src/Kconfig.roaming new file mode 100644 index 0000000..e69de29 diff --git a/resources/espressif__esp_wifi_remote/idf_v5.3/Kconfig.slave_select.in b/resources/espressif__esp_wifi_remote/idf_v5.3/Kconfig.slave_select.in new file mode 100644 index 0000000..1e11562 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/Kconfig.slave_select.in @@ -0,0 +1,17 @@ +# This file is auto-generated + choice SLAVE_IDF_TARGET + prompt "choose slave target" + 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" + endchoice diff --git a/resources/espressif__esp_wifi_remote/idf_v5.3/Kconfig.soc_wifi_caps.in b/resources/espressif__esp_wifi_remote/idf_v5.3/Kconfig.soc_wifi_caps.in new file mode 100644 index 0000000..61e6fc3 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/Kconfig.soc_wifi_caps.in @@ -0,0 +1,265 @@ +# 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_FREERTOS_UNICORE # ignore: multiple-definition + bool + default y + + config SLAVE_IDF_TARGET_ARCH_RISCV # ignore: multiple-definition + bool + default y + +endif # ESP32C6 diff --git a/resources/espressif__esp_wifi_remote/idf_v5.3/Kconfig.wifi.in b/resources/espressif__esp_wifi_remote/idf_v5.3/Kconfig.wifi.in new file mode 100644 index 0000000..296a066 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/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_HE_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_HE_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_HE_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_HE_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_HE_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_HE_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_HE_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_HE_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/resources/espressif__esp_wifi_remote/idf_v5.3/esp_wifi_remote_weak.c b/resources/espressif__esp_wifi_remote/idf_v5.3/esp_wifi_remote_weak.c new file mode 100644 index 0000000..a518d09 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/esp_wifi_remote_weak.c @@ -0,0 +1,397 @@ +/* + * 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); +} diff --git a/resources/espressif__esp_wifi_remote/idf_v5.3/esp_wifi_with_remote.c b/resources/espressif__esp_wifi_remote/idf_v5.3/esp_wifi_with_remote.c new file mode 100644 index 0000000..a66ac02 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/esp_wifi_with_remote.c @@ -0,0 +1,393 @@ +/* + * 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); +} diff --git a/resources/espressif__esp_wifi_remote/idf_v5.3/include/esp_wifi_default_config.h b/resources/espressif__esp_wifi_remote/idf_v5.3/include/esp_wifi_default_config.h new file mode 100644 index 0000000..f3bdb13 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/include/esp_wifi_default_config.h @@ -0,0 +1,769 @@ +/* + * 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_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_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_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_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_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_ESP_WIFI_REMOTE_LIBRARY_HOSTED 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_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_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_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_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_ESP32C5 + +#if CONFIG_SLAVE_IDF_TARGET_ESP32C61 +#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_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_ESP32C61 diff --git a/resources/espressif__esp_wifi_remote/idf_v5.3/include/esp_wifi_remote_api.h b/resources/espressif__esp_wifi_remote/idf_v5.3/include/esp_wifi_remote_api.h new file mode 100644 index 0000000..71e471d --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/include/esp_wifi_remote_api.h @@ -0,0 +1,84 @@ +/* + * 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); diff --git a/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_mesh.h b/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_mesh.h new file mode 100644 index 0000000..9bd8cbf --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/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/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_mesh_internal.h b/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_mesh_internal.h new file mode 100644 index 0000000..4c6a998 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/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/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_now.h b/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_now.h new file mode 100644 index 0000000..e026137 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_now.h @@ -0,0 +1,380 @@ +/* + * SPDX-FileCopyrightText: 2019-2025 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 */ + +/** + * @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 one version: v1.0. + * + * The v1.0 devices can receive 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 discard the packet entirely. + * + * @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/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi.h b/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi.h new file mode 100644 index 0000000..e255827 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi.h @@ -0,0 +1,1666 @@ +/* + * SPDX-FileCopyrightText: 2015-2025 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_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 is 2.4G, the default protocol is (WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_11AX). + * if CONFIG_SLAVE_SOC_WIFI_HE_SUPPORT and band is 5G, the default protocol is (WIFI_PROTOCOL_11A|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_11AC|WIFI_PROTOCOL_11AX). + * + * @attention 2.4G: Support 802.11b or 802.11bg or 802.11bgn or 802.11bgnax or LR mode + * 5G: Support 802.11a or 802.11an or 802.11anac or 802.11anacax + * + * @param ifx interfaces + * @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 + * - 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 + * + * @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 + * - 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. API return false if try to configure an interface that is not enabled + * @attention 2. WIFI_BW_HT40 is supported only when the interface support 11N + * + * @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 + * - 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. API return false if try to get a interface that is not enable + * + * @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_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); + +#if SOC_WIFI_HE_SUPPORT_5G +/** + * @brief Set wifi band. + * + * @param[in] band wifi band 2.4G / 5G / 2.4G + 5G + * + * @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_band(wifi_band_t band); + +/** + * @brief Get wifi band. + * + * @param[in] band store 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); +#endif /* SOC_WIFI_HE_SUPPORT_5G */ + +#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 + +#ifdef __cplusplus +} +#endif + +#endif /* __ESP_WIFI_H__ */ diff --git a/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_ap_get_sta_list.h b/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_ap_get_sta_list.h new file mode 100644 index 0000000..fc53918 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/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/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_crypto_types.h b/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_crypto_types.h new file mode 100644 index 0000000..c8601e7 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_crypto_types.h @@ -0,0 +1,440 @@ +/* + * 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_aes_wrap_t aes_wrap; /**< The AES wrap callback function used by esp_wifi */ + esp_aes_unwrap_t aes_unwrap; /**< The AES unwrap callback function used by esp_wifi */ + esp_hmac_sha256_vector_t hmac_sha256_vector; /**< The SHA256 callback function used by esp_wifi */ + esp_sha256_prf_t sha256_prf; /**< The SHA256 PRF callback function used by esp_wifi */ + esp_hmac_md5_t hmac_md5; /**< HMAC-MD5 callback function over data buffer (RFC 2104) */ + esp_hmac_md5_vector_t hamc_md5_vector; /**< HMAC-MD5 callback function over data vector (RFC 2104) */ + esp_hmac_sha1_t hmac_sha1; /**< HMAC-SHA1 callback function over data buffer (RFC 2104) */ + esp_hmac_sha1_vector_t hmac_sha1_vector; /**< HMAC-SHA1 callback function over data vector (RFC 2104) */ + esp_sha1_prf_t sha1_prf; /**< SHA1-based Pseudo-Random Function (PRF) (IEEE 802.11i, 8.5.1.1) callback function */ + esp_sha1_vector_t sha1_vector; /**< SHA-1 hash callback function for data vector */ + esp_pbkdf2_sha1_t pbkdf2_sha1; /**< SHA1-based key derivation function (PBKDF2) callback function for IEEE 802.11i */ + esp_rc4_skip_t rc4_skip; /**< XOR RC4 stream callback function to given data with skip-stream-start */ + esp_md5_vector_t md5_vector; /**< MD5 hash callback function for data vector */ + esp_aes_encrypt_t aes_encrypt; /**< Encrypt one AES block callback function */ + esp_aes_encrypt_init_t aes_encrypt_init; /**< Initialize AES callback function for encryption */ + esp_aes_encrypt_deinit_t aes_encrypt_deinit; /**< Deinitialize AES encryption callback function */ + esp_aes_decrypt_t aes_decrypt; /**< Decrypt one AES block callback function */ + esp_aes_decrypt_init_t aes_decrypt_init; /**< Initialize AES callback function for decryption */ + esp_aes_decrypt_deinit_t aes_decrypt_deinit; /**< Deinitialize AES decryption callback function */ + 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 */ + esp_crc32_le_t crc32; /**< CRC32 value callback function in little endian */ +} 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/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_default.h b/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_default.h new file mode 100644 index 0000000..d30d512 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/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/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_he.h b/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_he.h new file mode 100644 index 0000000..57bf819 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_he.h @@ -0,0 +1,221 @@ +/* + * 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_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); + +#ifdef __cplusplus +} +#endif diff --git a/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_he_types.h b/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_he_types.h new file mode 100644 index 0000000..3fc6614 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/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_IDF_TARGET_ESP32C5 +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_IDF_TARGET_ESP32C5 +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: 4; /**< the primary channel */ + unsigned second: 4; /**< the second channel if in HT40 */ + unsigned : 12; /**< 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/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_netif.h b/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_netif.h new file mode 100644 index 0000000..7dfa724 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/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/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_types.h b/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_types.h new file mode 100644 index 0000000..ef9f09c --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/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/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_types_generic.h b/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_types_generic.h new file mode 100644 index 0000000..51bb113 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_types_generic.h @@ -0,0 +1,1238 @@ +/* + * 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 */ +} 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_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_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, /**< Association expired. Deprecated, will be removed in next IDF major release */ + WIFI_REASON_DISASSOC_DUE_TO_INACTIVITY = 4, + WIFI_REASON_ASSOC_TOOMANY = 5, /**< Too many associated stations */ + WIFI_REASON_NOT_AUTHED = 6, /**< Not authenticated. Deprecated, will be removed in next IDF major release */ + WIFI_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6, + WIFI_REASON_NOT_ASSOCED = 7, /**< Not associated. Deprecated, will be removed in next IDF major release */ + WIFI_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7, + 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 */ + uint32_t ghz_5_channels; /**< Represents 5 GHz channels */ +} 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. For 2.4ghz channels set ghz_2_channels from BIT(1) to BIT(14) from LSB to MSB order to indicate channels to be scanned. Currently scanning in 5ghz channels is not supported. Please note that the 'channel' parameter above needs to be set to 0 to allow scanning by bitmap. */ +} 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 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 */ + uint8_t bandwidth; /**< For AP 20 MHz this value is set to 1. For AP 40 MHz this value is set to 2. + For AP 80 MHz this value is set to 3. For AP 160MHz this value is set to 4. + For AP 80+80MHz this value is set to 5*/ + 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 */ +} 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; + +#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 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 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. Set to 1~13 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_NEIGHBOR_REP_LEN 64 /**< Maximum length of NAN Neighbor Report */ + +/** + * @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]; /**< Service info shared in Publish frame */ + 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 reserved: 6; /**< Reserved */ +} 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]; /**< Service info shared in Subscribe frame */ + uint8_t single_match_event: 1; /**< Give single Match event or every time */ + uint8_t reserved: 7; /**< Reserved */ +} 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];/**< Service info(or message) to be shared */ +} 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 statistic */ +#define WIFI_STATIS_RXTX (1<<1) /**< RX/TX statistic */ +#define WIFI_STATIS_HW (1<<2) /**< Hardware statistic */ +#define WIFI_STATIS_DIAG (1<<3) /**< Diagnostic statistic */ +#define WIFI_STATIS_PS (1<<4) /**< Power save statistic */ +#define WIFI_STATIS_ALL (-1) /**< All statistic */ + +/** + * @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 */ +} 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 */ +} 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];/**< Peer Service Info */ +} 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];/**< Service Specific Info */ +} 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];/**< Service Specific Info */ +} 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 band */ +typedef enum { + WIFI_BAND_2G = 1, /* Band is 2.4G */ + WIFI_BAND_5G = 2, /* Band is 5G */ + WIFI_BAND_2G_5G = 3, /* Band is 2,4G + 5G */ +} wifi_band_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/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_types_native.h b/resources/espressif__esp_wifi_remote/idf_v5.3/include/injected/esp_wifi_types_native.h new file mode 100644 index 0000000..4ae9c80 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.3/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 +#define ESP_WIFI_MAX_CONN_NUM (10) /**< max number of stations which can connect to ESP32C3 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/resources/espressif__esp_wifi_remote/idf_v5.3/wifi_apps/roaming_app/src/Kconfig.roaming b/resources/espressif__esp_wifi_remote/idf_v5.3/wifi_apps/roaming_app/src/Kconfig.roaming new file mode 100644 index 0000000..e69de29 diff --git a/resources/espressif__esp_wifi_remote/idf_v5.4/Kconfig.slave_select.in b/resources/espressif__esp_wifi_remote/idf_v5.4/Kconfig.slave_select.in new file mode 100644 index 0000000..5e31536 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/Kconfig.slave_select.in @@ -0,0 +1,21 @@ +# This file is auto-generated + choice SLAVE_IDF_TARGET + prompt "choose slave target" + 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/resources/espressif__esp_wifi_remote/idf_v5.4/Kconfig.soc_wifi_caps.in b/resources/espressif__esp_wifi_remote/idf_v5.4/Kconfig.soc_wifi_caps.in new file mode 100644 index 0000000..34ed3d9 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/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/resources/espressif__esp_wifi_remote/idf_v5.4/Kconfig.wifi.in b/resources/espressif__esp_wifi_remote/idf_v5.4/Kconfig.wifi.in new file mode 100644 index 0000000..ba67a78 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/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/resources/espressif__esp_wifi_remote/idf_v5.4/esp_wifi_remote_weak.c b/resources/espressif__esp_wifi_remote/idf_v5.4/esp_wifi_remote_weak.c new file mode 100644 index 0000000..f71697b --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/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/resources/espressif__esp_wifi_remote/idf_v5.4/esp_wifi_with_remote.c b/resources/espressif__esp_wifi_remote/idf_v5.4/esp_wifi_with_remote.c new file mode 100644 index 0000000..60fe08b --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/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/resources/espressif__esp_wifi_remote/idf_v5.4/include/esp_wifi_default_config.h b/resources/espressif__esp_wifi_remote/idf_v5.4/include/esp_wifi_default_config.h new file mode 100644 index 0000000..e75df8a --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/include/esp_wifi_default_config.h @@ -0,0 +1,791 @@ +/* + * 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_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_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_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_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_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_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_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_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_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_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/resources/espressif__esp_wifi_remote/idf_v5.4/include/esp_wifi_remote_api.h b/resources/espressif__esp_wifi_remote/idf_v5.4/include/esp_wifi_remote_api.h new file mode 100644 index 0000000..b61b1c2 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/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/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_mesh.h b/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_mesh.h new file mode 100644 index 0000000..9bd8cbf --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/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/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_mesh_internal.h b/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_mesh_internal.h new file mode 100644 index 0000000..4c6a998 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/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/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_now.h b/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_now.h new file mode 100644 index 0000000..ddc1f9e --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/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/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi.h b/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi.h new file mode 100644 index 0000000..cd87f54 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi.h @@ -0,0 +1,1795 @@ +/* + * 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_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/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi_ap_get_sta_list.h b/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi_ap_get_sta_list.h new file mode 100644 index 0000000..fc53918 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/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/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi_crypto_types.h b/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi_crypto_types.h new file mode 100644 index 0000000..a85b443 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/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/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi_default.h b/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi_default.h new file mode 100644 index 0000000..d30d512 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/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/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi_he.h b/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi_he.h new file mode 100644 index 0000000..619c7b3 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/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/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi_he_types.h b/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi_he_types.h new file mode 100644 index 0000000..c9a7690 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/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/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi_netif.h b/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi_netif.h new file mode 100644 index 0000000..7dfa724 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/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/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi_types.h b/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi_types.h new file mode 100644 index 0000000..ef9f09c --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/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/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi_types_generic.h b/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi_types_generic.h new file mode 100644 index 0000000..94b3065 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/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/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi_types_native.h b/resources/espressif__esp_wifi_remote/idf_v5.4/include/injected/esp_wifi_types_native.h new file mode 100644 index 0000000..0963572 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.4/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/resources/espressif__esp_wifi_remote/idf_v5.4/wifi_apps/roaming_app/src/Kconfig.roaming b/resources/espressif__esp_wifi_remote/idf_v5.4/wifi_apps/roaming_app/src/Kconfig.roaming new file mode 100644 index 0000000..e69de29 diff --git a/resources/espressif__esp_wifi_remote/idf_v5.5/Kconfig.slave_select.in b/resources/espressif__esp_wifi_remote/idf_v5.5/Kconfig.slave_select.in new file mode 100644 index 0000000..5e31536 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/Kconfig.slave_select.in @@ -0,0 +1,21 @@ +# This file is auto-generated + choice SLAVE_IDF_TARGET + prompt "choose slave target" + 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/resources/espressif__esp_wifi_remote/idf_v5.5/Kconfig.soc_wifi_caps.in b/resources/espressif__esp_wifi_remote/idf_v5.5/Kconfig.soc_wifi_caps.in new file mode 100644 index 0000000..68a920b --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/Kconfig.soc_wifi_caps.in @@ -0,0 +1,389 @@ +# 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 + + config SLAVE_IDF_ENV_BRINGUP # 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/resources/espressif__esp_wifi_remote/idf_v5.5/Kconfig.wifi.in b/resources/espressif__esp_wifi_remote/idf_v5.5/Kconfig.wifi.in new file mode 100644 index 0000000..b3471d7 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/Kconfig.wifi.in @@ -0,0 +1,1298 @@ +# 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 && WIFI_RMT_ENABLE_SAE_H2E) + help + Select this option to enable SAE-PK + +config WIFI_RMT_ENABLE_SAE_H2E + bool "Enable SAE-H2E" + default y + depends on WIFI_RMT_ENABLE_WPA3_SAE + help + Select this option to enable SAE-H2E + +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 PM_SLEEP_FUNC_IN_IRAM + select ESP_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_BSS_MAX_IDLE_SUPPORT + bool "Enable bss max idle support" + default y if (SLAVE_SOC_WIFI_HE_SUPPORT || WIFI_RMT_WNM_SUPPORT) + help + Enables bss max idle support for Station and SoftAP. BSS max idle period enables an SoftAP to indicate + a time period during which the AP does not disassociate a STA due to nonreceipt of frames from the STA. + For station, max idle period is default 10 (1000TUs) and can be set through + WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME. For softap, bss max idle parameters will be set through + bss_max_idle_cfg in wifi_ap_config_t. + +config WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME + int "Maximum keep alive time" + range 10 60 + default 10 + help + Only for station. 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. If WIFI_RMT_BSS_MAX_IDLE_SUPPORT is set, + it will be sent as bss max idle period in association request. 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, the WiFi Rx state behaviour + will be determined by WIFI_RMT_SLP_BEACON_LOST_OVER_THRESHOLD_POLICY + 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. + +choice WIFI_RMT_SLP_BEACON_LOST_OVER_THRESHOLD_POLICY + prompt "Beacon strategy when beacon loss exceeds threshold" + depends on WIFI_RMT_SLP_BEACON_LOST_OPT + default WIFI_RMT_SLP_BEACON_LOST_OVER_THRESHOLD_AUTO + help + Select the strategy to apply when the number of lost beacons exceeds the threshold. + + - "Receive beacon": Keep RF on until a beacon is successfully received. + + - "Drop beacon": Turn off RF and skip beacon reception during this period. + + - "Auto": Beacon will been dropped only if WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE enabled + and expected rx beacon probability stays below the standard. + + config WIFI_RMT_SLP_BEACON_LOST_OVER_THRESHOLD_RECEIVE + bool "Receive beacon" + config WIFI_RMT_SLP_BEACON_LOST_OVER_THRESHOLD_DROP + bool "Drop beacon" + config WIFI_RMT_SLP_BEACON_LOST_OVER_THRESHOLD_AUTO + bool "Auto" +endchoice + +config WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE + bool "Sample beacon to calculate beacon offset" + default n + depends on WIFI_RMT_SLP_BEACON_LOST_OPT && !WIFI_RMT_ENHANCED_LIGHT_SLEEP + help + Select to enable feature sampling beacons to calculate beacon offset. + +menu "Beacon Sample Configuration Options" + visible if WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE + config WIFI_RMT_SLP_SAMPLE_BEACON_COUNT + int "Sample beacons at wifi connected to adjust beacon parameters" + range 100 1200 + default 300 + depends on WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE + help + Numble of sampled beacons at wifi connected to adjust beacon parameters. + + config WIFI_RMT_SLP_SAMPLE_BEACON_DIFFERENCE_PERCENT + int "Difference percentage triggers unstable event" + range 0 100 + default 20 + depends on WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE + help + Difference triggers event WIFI_EVENT_STA_BEACON_OFFSET_UNSTABLE + when the actual rx beacon probability continuously falls below + the expected probability by this value. + unit: percentage + + config WIFI_RMT_SLP_SAMPLE_BEACON_STANDARD_PERCENT + int "Standard percentage triggers beacon drop" + range 0 100 + default 55 + depends on WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE + help + Standard triggers beacon drop when the expected rx beacon probability + falls below this value under WIFI_RMT_SLP_BEACON_LOST_DROP_BEACON_AUTO mode. + unit: percentage + + config WIFI_RMT_SLP_SAMPLE_BEACON_RESAMPLE_PERIOD + int "Resample period" + range 0 255 + default 3 + depends on WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE + help + Resample period if beacon drop is active under WIFI_RMT_SLP_BEACON_LOST_DROP_BEACON_AUTO mode. + It means never resample if setting this value to 0. + unit: hours +endmenu # "Beacon Sample Configuration Options" + +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 && WIFI_RMT_ENABLE_SAE_H2E) + default WIFI_RMT_ENABLE_SAE_PK +endif + +if WIFI_RMT_ENABLE_SAE_H2E + config ESP_WIFI_ENABLE_SAE_H2E # ignore: multiple-definition + bool + depends on WIFI_RMT_ENABLE_WPA3_SAE + default WIFI_RMT_ENABLE_SAE_H2E +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 + +if WIFI_RMT_BSS_MAX_IDLE_SUPPORT + config ESP_WIFI_BSS_MAX_IDLE_SUPPORT # ignore: multiple-definition + bool + default WIFI_RMT_BSS_MAX_IDLE_SUPPORT +endif + + 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 + +if WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE + config ESP_WIFI_SLP_SAMPLE_BEACON_FEATURE # ignore: multiple-definition + bool + depends on WIFI_RMT_SLP_BEACON_LOST_OPT && !WIFI_RMT_ENHANCED_LIGHT_SLEEP + default WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE +endif + + config ESP_WIFI_SLP_SAMPLE_BEACON_COUNT # ignore: multiple-definition + int + depends on WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE + default WIFI_RMT_SLP_SAMPLE_BEACON_COUNT + + config ESP_WIFI_SLP_SAMPLE_BEACON_DIFFERENCE_PERCENT # ignore: multiple-definition + int + depends on WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE + default WIFI_RMT_SLP_SAMPLE_BEACON_DIFFERENCE_PERCENT + + config ESP_WIFI_SLP_SAMPLE_BEACON_STANDARD_PERCENT # ignore: multiple-definition + int + depends on WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE + default WIFI_RMT_SLP_SAMPLE_BEACON_STANDARD_PERCENT + + config ESP_WIFI_SLP_SAMPLE_BEACON_RESAMPLE_PERIOD # ignore: multiple-definition + int + depends on WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE + default WIFI_RMT_SLP_SAMPLE_BEACON_RESAMPLE_PERIOD + + 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/resources/espressif__esp_wifi_remote/idf_v5.5/esp_wifi_remote_weak.c b/resources/espressif__esp_wifi_remote/idf_v5.5/esp_wifi_remote_weak.c new file mode 100644 index 0000000..8f2a5a5 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/esp_wifi_remote_weak.c @@ -0,0 +1,452 @@ +/* + * 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_register_80211_tx_cb(esp_wifi_80211_tx_done_cb_t cb) +{ + 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); +} + +WEAK esp_err_t esp_wifi_remote_action_tx_req(wifi_action_tx_req_t *req) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} + +WEAK esp_err_t esp_wifi_remote_remain_on_channel(wifi_roc_req_t *req) +{ + LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED); +} diff --git a/resources/espressif__esp_wifi_remote/idf_v5.5/esp_wifi_with_remote.c b/resources/espressif__esp_wifi_remote/idf_v5.5/esp_wifi_with_remote.c new file mode 100644 index 0000000..ed0f9ee --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/esp_wifi_with_remote.c @@ -0,0 +1,448 @@ +/* + * 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_register_80211_tx_cb(esp_wifi_80211_tx_done_cb_t cb) +{ + return esp_wifi_remote_register_80211_tx_cb(cb); +} + +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); +} + +esp_err_t esp_wifi_action_tx_req(wifi_action_tx_req_t *req) +{ + return esp_wifi_remote_action_tx_req(req); +} + +esp_err_t esp_wifi_remain_on_channel(wifi_roc_req_t *req) +{ + return esp_wifi_remote_remain_on_channel(req); +} diff --git a/resources/espressif__esp_wifi_remote/idf_v5.5/include/esp_wifi_default_config.h b/resources/espressif__esp_wifi_remote/idf_v5.5/include/esp_wifi_default_config.h new file mode 100644 index 0000000..dee2343 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/include/esp_wifi_default_config.h @@ -0,0 +1,970 @@ +/* + * 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_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_ENABLE_SAE_H2E 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_ENABLE_SAE_H2E 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_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_ENABLE_SAE_H2E 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_ENABLE_SAE_H2E 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_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_ENABLE_SAE_H2E 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_ENABLE_SAE_H2E 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_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_ENABLE_SAE_H2E 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_ENABLE_SAE_H2E 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_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_ENABLE_SAE_H2E 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_ENABLE_SAE_H2E 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_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_ENABLE_SAE_H2E 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_BSS_MAX_IDLE_SUPPORT 1 +#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_ENABLE_SAE_H2E 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_BSS_MAX_IDLE_SUPPORT 1 +#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_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_ENABLE_SAE_H2E 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_ENABLE_SAE_H2E 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_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_ENABLE_SAE_H2E 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_ENABLE_SAE_H2E 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_SLAVE_IDF_ENV_BRINGUP 1 +#define CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED 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_ENABLE_SAE_H2E 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_BSS_MAX_IDLE_SUPPORT 1 +#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_ENABLE_SAE_H2E 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_BSS_MAX_IDLE_SUPPORT 1 +#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_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_ENABLE_SAE_H2E 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_BSS_MAX_IDLE_SUPPORT 1 +#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_ENABLE_SAE_H2E 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_BSS_MAX_IDLE_SUPPORT 1 +#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 + +#if CONFIG_SLAVE_IDF_TARGET_ESP32H21 +#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_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_ENABLE_SAE_H2E 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_ENABLE_SAE_H2E 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_ESP32H21 + +#if CONFIG_SLAVE_IDF_TARGET_ESP32H4 +#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_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_ENABLE_SAE_H2E 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_ENABLE_SAE_H2E 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_ESP32H4 diff --git a/resources/espressif__esp_wifi_remote/idf_v5.5/include/esp_wifi_remote_api.h b/resources/espressif__esp_wifi_remote/idf_v5.5/include/esp_wifi_remote_api.h new file mode 100644 index 0000000..538e783 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/include/esp_wifi_remote_api.h @@ -0,0 +1,95 @@ +/* + * 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_register_80211_tx_cb(esp_wifi_80211_tx_done_cb_t cb); +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); +esp_err_t esp_wifi_remote_action_tx_req(wifi_action_tx_req_t *req); +esp_err_t esp_wifi_remote_remain_on_channel(wifi_roc_req_t *req); diff --git a/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_mesh.h b/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_mesh.h new file mode 100644 index 0000000..9bd8cbf --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/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/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_mesh_internal.h b/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_mesh_internal.h new file mode 100644 index 0000000..4c6a998 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/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/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_now.h b/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_now.h new file mode 100644 index 0000000..3b94187 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_now.h @@ -0,0 +1,409 @@ +/* + * SPDX-FileCopyrightText: 2019-2025 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 = WIFI_SEND_SUCCESS, /**< Send ESPNOW data successfully */ + ESP_NOW_SEND_FAIL = WIFI_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 receive 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 sending packet information + */ +typedef wifi_tx_info_t esp_now_send_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 esp_now_send_info_t Sending information for ESPNOW data + * @param status status of sending ESPNOW data (succeed or fail). This is will be removed later, since the tx_info->tx_status also works. + */ +typedef void (*esp_now_send_cb_t)(const esp_now_send_info_t *tx_info, 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); + +/** + * @brief Set the OUI (Organization Identifier) in the vendor-specific element for ESPNOW. + * + * @param oui The oui should occupy 3 bytes. If the oui is NULL, then use the default value (0x18fe34). + * + * @return + * - ESP_OK : succeed + */ +esp_err_t esp_now_set_user_oui(uint8_t *oui); + +/** + * @brief Get the OUI (Organization Identifier) in the vendor-specific element for ESPNOW. + * + * @param oui user configured OUI. + * + * @return + * - ESP_OK : succeed + * - ESP_ERR_ESPNOW_ARG : invalid argument + */ +esp_err_t esp_now_get_user_oui(uint8_t *oui); + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ESP_NOW_H__ */ diff --git a/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi.h b/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi.h new file mode 100644 index 0000000..2e90b01 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi.h @@ -0,0 +1,1864 @@ +/* + * SPDX-FileCopyrightText: 2015-2025 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 + +#if CONFIG_WIFI_RMT_BSS_MAX_IDLE_SUPPORT +#define WIFI_ENABLE_BSS_MAX_IDLE (1<<8) +#else +#define WIFI_ENABLE_BSS_MAX_IDLE 0 +#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) +#define CONFIG_FEATURE_BSS_MAX_IDLE_BIT (1<<8) + +/* 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 | \ + WIFI_ENABLE_BSS_MAX_IDLE) + +#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_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 scanned 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. + * @attention 6. When operating in 5 GHz band, the second channel is automatically determined by the primary channel according to the 802.11 standard. + * Any manually configured second channel will be ignored. + * + * @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 Callback function of 80211 tx data + * + * @param tx_info TX information of 80211 tx. The information can only be used in the callback context. + */ +typedef void (*esp_wifi_80211_tx_done_cb_t)(const esp_80211_tx_info_t *tx_info); + +/** + * @brief Register the TX callback function of 80211 tx data. + * + * @attention This callback will be executed in WiFi task, so avoid doing any time consuming activity in the callback. + * Doing heavy work here can affect the WiFi performance. + * + * @param cb callback function. If the cb is NULL, then unregister the tx cb. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + */ +esp_err_t esp_wifi_register_80211_tx_cb(esp_wifi_80211_tx_done_cb_t cb); + +/** + * @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); + +/** + * @brief Send action frame on target channel + * + * @param req action tx request structure containing relevant fields + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_NO_MEM: failed to allocate memory + * - ESP_FAIL: failed to send frame + */ +esp_err_t esp_wifi_action_tx_req(wifi_action_tx_req_t *req); + +/** + * @brief Remain on the target channel for required duration + * + * @param req roc request structure containing relevant fields + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_NO_MEM: failed to allocate memory + * - ESP_FAIL: failed to perform roc operation + */ +esp_err_t esp_wifi_remain_on_channel(wifi_roc_req_t * req); + +#if CONFIG_WIFI_RMT_SLP_SAMPLE_BEACON_FEATURE +/** + * @brief Sample numbers of beacons to calculate beacon parameters + * + * @attention This API should be called after station connected to 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_t esp_wifi_beacon_offset_sample_beacon(void); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __ESP_WIFI_H__ */ diff --git a/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_ap_get_sta_list.h b/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_ap_get_sta_list.h new file mode 100644 index 0000000..fc53918 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/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/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_crypto_types.h b/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_crypto_types.h new file mode 100644 index 0000000..a85b443 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/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/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_default.h b/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_default.h new file mode 100644 index 0000000..d30d512 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/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/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_he.h b/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_he.h new file mode 100644 index 0000000..619c7b3 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/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/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_he_types.h b/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_he_types.h new file mode 100644 index 0000000..e91716a --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_he_types.h @@ -0,0 +1,436 @@ +/* + * SPDX-FileCopyrightText: 2022-2025 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 */ + RX_BB_FORMAT_VHT_MU = 11, /**< the reception frame is a VHT MU 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/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_netif.h b/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_netif.h new file mode 100644 index 0000000..7dfa724 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/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/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_types.h b/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_types.h new file mode 100644 index 0000000..ef9f09c --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/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/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_types_generic.h b/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_types_generic.h new file mode 100644 index 0000000..0bfe6c6 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_types_generic.h @@ -0,0 +1,1525 @@ +/* + * 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 + +#define WIFI_AP_DEFAULT_MAX_IDLE_PERIOD 292 /**< Default timeout for SoftAP BSS Max Idle. Unit: 1000TUs >**/ + +/** + * @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; + +typedef enum { + WIFI_OFFCHAN_TX_CANCEL, /**< Cancel off-channel transmission */ + WIFI_OFFCHAN_TX_REQ, /**< Request off-channel transmission */ +} wifi_action_tx_t; + +typedef enum { + WIFI_ROC_CANCEL, /**< Cancel remain on channel */ + WIFI_ROC_REQ, /**< Request remain on channel */ +} wifi_roc_t; +/** + * @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 Configuration structure for BSS max idle + */ +typedef struct { + uint16_t period; /**< Sets BSS Max idle period (1 Unit = 1000TUs OR 1.024 Seconds). If there are no frames for this period from a STA, SoftAP will disassociate due to inactivity. Setting it to 0 disables the feature */ + bool protected_keep_alive; /**< Requires clients to use protected keep alive frames for BSS Max Idle period */ +} wifi_bss_max_idle_config_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 */ + uint8_t sae_ext; /**< Enable SAE EXT feature. SOC_GCMP_SUPPORT is required for this feature. */ + wifi_bss_max_idle_config_t bss_max_idle_cfg; /**< Configuration for bss max idle, effective if CONFIG_WIFI_BSS_MAX_IDLE_SUPPORT is enabled */ +} 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 reserved1: 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-MCS8 and HE-MCS9. 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 vht_su_beamformee_disabled: 1; /**< Whether to disable support for operation as an VHT SU beamformee. */ + uint32_t vht_mu_beamformee_disabled: 1; /**< Whether to disable support for operation as an VHT MU beamformee. */ + uint32_t vht_mcs8_enabled: 1; /**< Whether to support VHT-MCS8. The default value is 0. */ + uint32_t reserved2: 19; /**< 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 */ + wifi_action_tx_t type; /**< ACTION TX operation type */ + uint8_t channel; /**< Channel on which to perform ACTION TX Operation */ + uint32_t wait_time_ms; /**< Duration to wait for on target channel */ + bool no_ack; /**< Indicates no ack required */ + wifi_action_rx_cb_t rx_cb; /**< Rx Callback to receive action frames */ + uint8_t op_id; /**< Unique Identifier for operation provided by wifi driver */ + uint32_t data_len; /**< Length of the appended Data */ + uint8_t data[0]; /**< Appended Data payload */ +} wifi_action_tx_req_t; + +/** Status codes for WIFI_EVENT_ROC_DONE evt */ +typedef enum { + WIFI_ROC_DONE = 0, /**< ROC operation was completed successfully */ + WIFI_ROC_FAIL, /**< ROC operation was cancelled */ +} wifi_roc_done_status_t; + +/** + * @brief The callback function executed when ROC operation has ended + * + * @param context rxcb registered for the corresponding ROC operation + * @param op_id ID of the corresponding ROC operation + * @param status status code of the ROC operation denoted + * + */ +typedef void (* wifi_action_roc_done_cb_t)(uint32_t context, uint8_t op_id, + wifi_roc_done_status_t status); + +/** + * @brief Remain on Channel request + * + * + */ +typedef struct { + wifi_interface_t ifx; /**< WiFi interface to send request to */ + wifi_roc_t type; /**< ROC operation type */ + uint8_t channel; /**< Channel on which to perform ROC Operation */ + wifi_second_chan_t sec_channel; /**< Secondary channel */ + uint32_t wait_time_ms; /**< Duration to wait for on target channel */ + wifi_action_rx_cb_t rx_cb; /**< Rx Callback to receive any response */ + uint8_t op_id; /**< ID of this specific ROC operation provided by wifi driver */ + wifi_action_roc_done_cb_t done_cb; /**< Callback to function that will be called upon ROC done. If assigned, WIFI_EVENT_ROC_DONE event will not be posted */ +} wifi_roc_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_STA_BEACON_OFFSET_UNSTABLE, /**< Station sampled beacon offset unstable */ + 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 */ + +/** Status codes for WIFI_EVENT_ACTION_TX_STATUS evt */ +/** There will be back to back events in success case TX_DONE and TX_DURATION_COMPLETED */ +typedef enum { + WIFI_ACTION_TX_DONE = 0, /**< ACTION_TX operation was completed successfully */ + WIFI_ACTION_TX_FAILED, /**< ACTION_TX operation failed during tx */ + WIFI_ACTION_TX_DURATION_COMPLETED, /**< ACTION_TX operation completed it's wait duration */ + WIFI_ACTION_TX_OP_CANCELLED, /**< ACTION_TX operation was cancelled by application or higher priority operation */ +} wifi_action_tx_status_type_t; + +/** Argument structure for WIFI_EVENT_ACTION_TX_STATUS event */ +typedef struct { + wifi_interface_t ifx; /**< WiFi interface to send request to */ + uint32_t context; /**< Context to identify the request */ + wifi_action_tx_status_type_t status; /**< Status of the operation */ + uint8_t op_id; /**< ID of the corresponding operation that was provided during action tx request */ + uint8_t channel; /**< Channel provided in tx request */ +} wifi_event_action_tx_status_t; + +/** + * @brief Argument structure for WIFI_EVENT_ROC_DONE event + */ +typedef struct { + uint32_t context; /**< Context to identify the initiator of the request */ + wifi_roc_done_status_t status; /**< ROC status */ + uint8_t op_id; /**< ID of the corresponding ROC operation */ + uint8_t channel; /**< Channel provided in tx 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; + +#define WIFI_MAX_SUPPORT_COUNTRY_NUM 175 /**< max number of supported countries */ +#ifdef CONFIG_SLAVE_SOC_WIFI_SUPPORT_5G +#define WIFI_MAX_REGULATORY_RULE_NUM 7 /**< max number of regulatory rules */ +#else +#define WIFI_MAX_REGULATORY_RULE_NUM 2 /**< max number of regulatory rules */ +#endif + +/** Argument structure for regulatory rule */ +typedef struct { + uint8_t start_channel; /**< start channel of regulatory rule */ + uint8_t end_channel; /**< end channel of regulatory rule */ + uint16_t max_bandwidth : 3; /**< max bandwidth(MHz) of regulatory rule, 1:20M, 2:40M, 3:80M, 4:160M */ + uint16_t max_eirp : 6; /**< indicates the maximum Equivalent Isotropically Radiated Power (EIRP), typically measured in dBm */ + uint16_t is_dfs : 1; /**< flag to identify dfs channel */ + uint16_t reserved : 6; /**< reserved */ +} wifi_reg_rule_t; + +/** Argument structure for regdomain */ +typedef struct { + uint8_t n_reg_rules; /**< number of regulatory rules */ + wifi_reg_rule_t reg_rules[WIFI_MAX_REGULATORY_RULE_NUM]; /**< array of regulatory rules*/ +} wifi_regulatory_t; + +/** Argument structure for regdomain */ +typedef struct { + char cn[2]; /**< country code string */ + uint8_t regulatory_type; /**< regulatory type of country */ +} wifi_regdomain_t; + +/** + * @brief Status of wifi sending data + */ +typedef enum { + WIFI_SEND_SUCCESS = 0, /**< Sending Wi-Fi data successfully */ + WIFI_SEND_FAIL, /**< Sending Wi-Fi data fail */ +} wifi_tx_status_t; + +/** + * @brief Information of wifi sending data + */ +typedef struct { + uint8_t *des_addr; /**< The address of the receive device */ + uint8_t *src_addr; /**< The address of the sending device */ + wifi_interface_t ifidx; /**< Interface of sending 80211 tx data */ + uint8_t *data; /**< The data for 80211 tx, start from the MAC header */ + uint8_t data_len; /**< The frame body length for 80211 tx, excluding the MAC header */ + wifi_phy_rate_t rate; /**< Data rate */ + wifi_tx_status_t tx_status; /**< Status of sending 80211 tx data */ +} wifi_tx_info_t; + +typedef wifi_tx_info_t esp_80211_tx_info_t; + +/** Argument structure for WIFI_EVENT_STA_BEACON_OFFSET_UNSTABLE event */ +typedef struct { + float beacon_success_rate; /**< Received beacon success rate */ +} wifi_event_sta_beacon_offset_unstable_t; + +#ifdef __cplusplus +} +#endif + +#endif /* __ESP_WIFI_TYPES_H__ */ diff --git a/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_types_native.h b/resources/espressif__esp_wifi_remote/idf_v5.5/include/injected/esp_wifi_types_native.h new file mode 100644 index 0000000..0963572 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/idf_v5.5/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/resources/espressif__esp_wifi_remote/idf_v5.5/wifi_apps/roaming_app/src/Kconfig.roaming b/resources/espressif__esp_wifi_remote/idf_v5.5/wifi_apps/roaming_app/src/Kconfig.roaming new file mode 100644 index 0000000..e69de29 diff --git a/resources/espressif__esp_wifi_remote/include/esp_wifi_remote.h b/resources/espressif__esp_wifi_remote/include/esp_wifi_remote.h new file mode 100644 index 0000000..f6f2c93 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/include/esp_wifi_remote.h @@ -0,0 +1,49 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#pragma once +#include "esp_wifi.h" +#include "esp_wifi_remote_api.h" + +/** + * @brief Remote channel Rx function pointer + */ +typedef esp_err_t (*esp_remote_channel_rx_fn_t)(void *h, void *buffer, void *buff_to_free, size_t len); + +/** + * @brief Remote channel Tx function pointer + */ +typedef esp_err_t (*esp_remote_channel_tx_fn_t)(void *h, void *buffer, size_t len); + +/** + * @brief Remote channel handle + */ +typedef struct esp_remote_channel *esp_remote_channel_t; + +/** + * @brief Remote channel configuration + */ +typedef struct esp_remote_channel_config *esp_remote_channel_config_t; + + +// handling channels +/** + * @brief Receive packet to the esp_wifi network layers + * @param h Channel handle + * @param buffer Packet buffer ptr + * @param buff_to_free Packet ptr to free + * @param len Packet len + * @return ESP_OK on success + */ +esp_err_t esp_wifi_remote_channel_rx(void *h, void *buffer, void *buff_to_free, size_t len); + +/** + * @brief Sets Tx callback for the remote channel + * @param ifx Wifi interface + * @param h Channel handle + * @param tx_cb Callback type + * @return ESP_OK on success + */ +esp_err_t esp_wifi_remote_channel_set(wifi_interface_t ifx, void *h, esp_remote_channel_tx_fn_t tx_cb); diff --git a/resources/espressif__esp_wifi_remote/include/esp_wifi_remote_with_hosted.h b/resources/espressif__esp_wifi_remote/include/esp_wifi_remote_with_hosted.h new file mode 100644 index 0000000..6797138 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/include/esp_wifi_remote_with_hosted.h @@ -0,0 +1,386 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#include "esp_hosted_wifi_api.h" + +static inline esp_err_t esp_wifi_remote_init(const wifi_init_config_t *config) +{ + return esp_hosted_wifi_init(config); +} + +static inline esp_err_t esp_wifi_remote_deinit(void) +{ + return esp_hosted_wifi_deinit(); +} + +static inline esp_err_t esp_wifi_remote_set_mode(wifi_mode_t mode) +{ + return esp_hosted_wifi_set_mode(mode); +} + +static inline esp_err_t esp_wifi_remote_get_mode(wifi_mode_t *mode) +{ + return esp_hosted_wifi_get_mode(mode); +} + +static inline esp_err_t esp_wifi_remote_start(void) +{ + return esp_hosted_wifi_start(); +} + +static inline esp_err_t esp_wifi_remote_stop(void) +{ + return esp_hosted_wifi_stop(); +} + +static inline esp_err_t esp_wifi_remote_restore(void) +{ + return esp_hosted_wifi_restore(); +} + +static inline esp_err_t esp_wifi_remote_connect(void) +{ + return esp_hosted_wifi_connect(); +} + +static inline esp_err_t esp_wifi_remote_disconnect(void) +{ + return esp_hosted_wifi_disconnect(); +} + +static inline esp_err_t esp_wifi_remote_clear_fast_connect(void) +{ + return esp_hosted_wifi_clear_fast_connect(); +} + +static inline esp_err_t esp_wifi_remote_deauth_sta(uint16_t aid) +{ + return esp_hosted_wifi_deauth_sta(aid); +} + +static inline esp_err_t esp_wifi_remote_scan_start(const wifi_scan_config_t *config, _Bool block) +{ + return esp_hosted_wifi_scan_start(config, block); +} + +static inline esp_err_t esp_wifi_remote_scan_stop(void) +{ + return esp_hosted_wifi_scan_stop(); +} + +static inline esp_err_t esp_wifi_remote_scan_get_ap_num(uint16_t *number) +{ + return esp_hosted_wifi_scan_get_ap_num(number); +} + +static inline esp_err_t esp_wifi_remote_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records) +{ + return esp_hosted_wifi_scan_get_ap_records(number, ap_records); +} + +static inline esp_err_t esp_wifi_remote_scan_get_ap_record(wifi_ap_record_t *ap_record) +{ + return esp_hosted_wifi_scan_get_ap_record(ap_record); +} + +static inline esp_err_t esp_wifi_remote_clear_ap_list(void) +{ + return esp_hosted_wifi_clear_ap_list(); +} + +static inline esp_err_t esp_wifi_remote_sta_get_ap_info(wifi_ap_record_t *ap_info) +{ + return esp_hosted_wifi_sta_get_ap_info(ap_info); +} + +static inline esp_err_t esp_wifi_remote_set_ps(wifi_ps_type_t type) +{ + return esp_hosted_wifi_set_ps(type); +} + +static inline esp_err_t esp_wifi_remote_get_ps(wifi_ps_type_t *type) +{ + return esp_hosted_wifi_get_ps(type); +} + +static inline esp_err_t esp_wifi_remote_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap) +{ + return esp_hosted_wifi_set_protocol(ifx, protocol_bitmap); +} + +static inline esp_err_t esp_wifi_remote_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap) +{ + return esp_hosted_wifi_get_protocol(ifx, protocol_bitmap); +} + +static inline esp_err_t esp_wifi_remote_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw) +{ + return esp_hosted_wifi_set_bandwidth(ifx, bw); +} + +static inline esp_err_t esp_wifi_remote_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw) +{ + return esp_hosted_wifi_get_bandwidth(ifx, bw); +} + +static inline esp_err_t esp_wifi_remote_set_channel(uint8_t primary, wifi_second_chan_t second) +{ + return esp_hosted_wifi_set_channel(primary, second); +} + +static inline esp_err_t esp_wifi_remote_get_channel(uint8_t *primary, wifi_second_chan_t *second) +{ + return esp_hosted_wifi_get_channel(primary, second); +} + +static inline esp_err_t esp_wifi_remote_set_country(const wifi_country_t *country) +{ + return esp_hosted_wifi_set_country(country); +} + +static inline esp_err_t esp_wifi_remote_get_country(wifi_country_t *country) +{ + return esp_hosted_wifi_get_country(country); +} + +static inline esp_err_t esp_wifi_remote_set_mac(wifi_interface_t ifx, const uint8_t mac[6]) +{ + return esp_hosted_wifi_set_mac(ifx, mac); +} + +static inline esp_err_t esp_wifi_remote_get_mac(wifi_interface_t ifx, uint8_t mac[6]) +{ + return esp_hosted_wifi_get_mac(ifx, mac); +} + +static inline esp_err_t esp_wifi_remote_set_promiscuous_rx_cb(wifi_promiscuous_cb_t cb) +{ + return esp_hosted_wifi_set_promiscuous_rx_cb(cb); +} + +static inline esp_err_t esp_wifi_remote_set_promiscuous(_Bool en) +{ + return esp_hosted_wifi_set_promiscuous(en); +} + +static inline esp_err_t esp_wifi_remote_get_promiscuous(_Bool *en) +{ + return esp_hosted_wifi_get_promiscuous(en); +} + +static inline esp_err_t esp_wifi_remote_set_promiscuous_filter(const wifi_promiscuous_filter_t *filter) +{ + return esp_hosted_wifi_set_promiscuous_filter(filter); +} + +static inline esp_err_t esp_wifi_remote_get_promiscuous_filter(wifi_promiscuous_filter_t *filter) +{ + return esp_hosted_wifi_get_promiscuous_filter(filter); +} + +static inline esp_err_t esp_wifi_remote_set_promiscuous_ctrl_filter(const wifi_promiscuous_filter_t *filter) +{ + return esp_hosted_wifi_set_promiscuous_ctrl_filter(filter); +} + +static inline esp_err_t esp_wifi_remote_get_promiscuous_ctrl_filter(wifi_promiscuous_filter_t *filter) +{ + return esp_hosted_wifi_get_promiscuous_ctrl_filter(filter); +} + +static inline esp_err_t esp_wifi_remote_set_config(wifi_interface_t interface, wifi_config_t *conf) +{ + return esp_hosted_wifi_set_config(interface, conf); +} + +static inline esp_err_t esp_wifi_remote_get_config(wifi_interface_t interface, wifi_config_t *conf) +{ + return esp_hosted_wifi_get_config(interface, conf); +} + +static inline esp_err_t esp_wifi_remote_ap_get_sta_list(wifi_sta_list_t *sta) +{ + return esp_hosted_wifi_ap_get_sta_list(sta); +} + +static inline esp_err_t esp_wifi_remote_ap_get_sta_aid(const uint8_t mac[6], uint16_t *aid) +{ + return esp_hosted_wifi_ap_get_sta_aid(mac, aid); +} + +static inline esp_err_t esp_wifi_remote_set_storage(wifi_storage_t storage) +{ + return esp_hosted_wifi_set_storage(storage); +} + +static inline 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) +{ + return esp_hosted_wifi_set_vendor_ie(enable, type, idx, vnd_ie); +} + +static inline esp_err_t esp_wifi_remote_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx) +{ + return esp_hosted_wifi_set_vendor_ie_cb(cb, ctx); +} + +static inline esp_err_t esp_wifi_remote_set_max_tx_power(int8_t power) +{ + return esp_hosted_wifi_set_max_tx_power(power); +} + +static inline esp_err_t esp_wifi_remote_get_max_tx_power(int8_t *power) +{ + return esp_hosted_wifi_get_max_tx_power(power); +} + +static inline esp_err_t esp_wifi_remote_set_event_mask(uint32_t mask) +{ + return esp_hosted_wifi_set_event_mask(mask); +} + +static inline esp_err_t esp_wifi_remote_get_event_mask(uint32_t *mask) +{ + return esp_hosted_wifi_get_event_mask(mask); +} + +static inline esp_err_t esp_wifi_remote_80211_tx(wifi_interface_t ifx, const void *buffer, int len, _Bool en_sys_seq) +{ + return esp_hosted_wifi_80211_tx(ifx, buffer, len, en_sys_seq); +} + +static inline esp_err_t esp_wifi_remote_set_csi_rx_cb(wifi_csi_cb_t cb, void *ctx) +{ + return esp_hosted_wifi_set_csi_rx_cb(cb, ctx); +} + +static inline esp_err_t esp_wifi_remote_set_csi_config(const wifi_csi_config_t *config) +{ + return esp_hosted_wifi_set_csi_config(config); +} + +static inline esp_err_t esp_wifi_remote_set_csi(_Bool en) +{ + return esp_hosted_wifi_set_csi(en); +} + +static inline esp_err_t esp_wifi_remote_set_ant_gpio(const wifi_ant_gpio_config_t *config) +{ + return esp_hosted_wifi_set_ant_gpio(config); +} + +static inline esp_err_t esp_wifi_remote_get_ant_gpio(wifi_ant_gpio_config_t *config) +{ + return esp_hosted_wifi_get_ant_gpio(config); +} + +static inline esp_err_t esp_wifi_remote_set_ant(const wifi_ant_config_t *config) +{ + return esp_hosted_wifi_set_ant(config); +} + +static inline esp_err_t esp_wifi_remote_get_ant(wifi_ant_config_t *config) +{ + return esp_hosted_wifi_get_ant(config); +} + +static inline int64_t esp_wifi_remote_get_tsf_time(wifi_interface_t interface) +{ + return esp_hosted_wifi_get_tsf_time(interface); +} + +static inline esp_err_t esp_wifi_remote_set_inactive_time(wifi_interface_t ifx, uint16_t sec) +{ + return esp_hosted_wifi_set_inactive_time(ifx, sec); +} + +static inline esp_err_t esp_wifi_remote_get_inactive_time(wifi_interface_t ifx, uint16_t *sec) +{ + return esp_hosted_wifi_get_inactive_time(ifx, sec); +} + +static inline esp_err_t esp_wifi_remote_statis_dump(uint32_t modules) +{ + return esp_hosted_wifi_statis_dump(modules); +} + +static inline esp_err_t esp_wifi_remote_set_rssi_threshold(int32_t rssi) +{ + return esp_hosted_wifi_set_rssi_threshold(rssi); +} + +static inline esp_err_t esp_wifi_remote_ftm_initiate_session(wifi_ftm_initiator_cfg_t *cfg) +{ + return esp_hosted_wifi_ftm_initiate_session(cfg); +} + +static inline esp_err_t esp_wifi_remote_ftm_end_session(void) +{ + return esp_hosted_wifi_ftm_end_session(); +} + +static inline esp_err_t esp_wifi_remote_ftm_resp_set_offset(int16_t offset_cm) +{ + return esp_hosted_wifi_ftm_resp_set_offset(offset_cm); +} + +static inline esp_err_t esp_wifi_remote_config_11b_rate(wifi_interface_t ifx, _Bool disable) +{ + return esp_hosted_wifi_config_11b_rate(ifx, disable); +} + +static inline esp_err_t esp_wifi_remote_connectionless_module_set_wake_interval(uint16_t wake_interval) +{ + return esp_hosted_wifi_connectionless_module_set_wake_interval(wake_interval); +} + +static inline esp_err_t esp_wifi_remote_force_wakeup_acquire(void) +{ + return esp_hosted_wifi_force_wakeup_acquire(); +} + +static inline esp_err_t esp_wifi_remote_force_wakeup_release(void) +{ + return esp_hosted_wifi_force_wakeup_release(); +} + +static inline esp_err_t esp_wifi_remote_set_country_code(const char *country, _Bool ieee80211d_enabled) +{ + return esp_hosted_wifi_set_country_code(country, ieee80211d_enabled); +} + +static inline esp_err_t esp_wifi_remote_get_country_code(char *country) +{ + return esp_hosted_wifi_get_country_code(country); +} + +static inline esp_err_t esp_wifi_remote_config_80211_tx_rate(wifi_interface_t ifx, wifi_phy_rate_t rate) +{ + return esp_hosted_wifi_config_80211_tx_rate(ifx, rate); +} + +static inline esp_err_t esp_wifi_remote_disable_pmf_config(wifi_interface_t ifx) +{ + return esp_hosted_wifi_disable_pmf_config(ifx); +} + +static inline esp_err_t esp_wifi_remote_sta_get_aid(uint16_t *aid) +{ + return esp_hosted_wifi_sta_get_aid(aid); +} + +static inline esp_err_t esp_wifi_remote_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode) +{ + return esp_hosted_wifi_sta_get_negotiated_phymode(phymode); +} + +static inline esp_err_t esp_wifi_remote_set_dynamic_cs(_Bool enabled) +{ + return esp_hosted_wifi_set_dynamic_cs(enabled); +} + +static inline esp_err_t esp_wifi_remote_sta_get_rssi(int *rssi) +{ + return esp_hosted_wifi_sta_get_rssi(rssi); +} diff --git a/resources/espressif__esp_wifi_remote/scripts/README.md b/resources/espressif__esp_wifi_remote/scripts/README.md new file mode 100644 index 0000000..777b04e --- /dev/null +++ b/resources/espressif__esp_wifi_remote/scripts/README.md @@ -0,0 +1,38 @@ +# Parsing and generating code + +This folder contains scripts for parsing `esp_wifi` component headers and configs and generates configs, headers and sources of `esp_wifi_remote`. + +The CI job runs the parse and generation step, after which the generated files appear locally in this folder. Then the CI jobs compares the generated files with the specific version files. In case of a mismatch (CI failure), please check if the generated file is correct. If so, update the component and create a new version. If not, update the scripts. + +## Parsing `esp_wifi` headers + +Extract prototypes from the selected wifi headers + +## Generating `Kconfig` + +* Kconfig -- we only replace `SOC_WIFI_` -> `SLAVE_SOC_WIFI_` and `IDF_TARGET_` -> `SLAVE_IDF_TARGET_` configs +* Kconfig.soc_wifi_caps.in -- we parse `IDF/components/soc/$SLAVE/include/soc/Kconfig.soc_caps.in` for all slaves and collect `SOC_WIFI_` configs, which we enclose with `if SLAVE_IDF_TARGET...` ... `endif`. +This way the slave's WiFi capabilities become runtime available in `esp_wifi_remote` submenu + +## Generating headers and forwarding to `esp_hosted` + +Based on extracted WiFi function prototypes we generate + +* `esp_wifi_remote_api.h` -- declares all wifi APIs with `esp_wifi_remote...()` prefix +* `esp_wifi_with_remote.c` -- defines all original wifi APIs that forward calls for `esp_wifi_remote` -- This file is used only for targets with no WiFi capabilities, so the original WiFi APIs could be called the same way as on WiFi targets. (this file is not compiled for targets with WiFi caps) +* `esp_wifi_remote_with_hosted.h` -- defines `static inline` functions that directly forward calls from `esp_wifi_remote` to `esp_hosted` + +## Generating slave's WiFi native types + +* `esp_wifi_types_native.h` -- defines specific WiFi types based on the selected WiFI slave and its capabilities. We use the original header and only replace `CONFIG_SOC_WIFI_` -> `CONFIG_SLAVE_SOC_WIFI_` and `CONFIG_IDF_TARGET_` -> `CONFIG_SLAVE_IDF_TARGET_` configs + +## Generating test cases + +This component includes a simple build-only test that exercises all APIs from `esp_wifi_remote` (and also from `esp_wifi`). The test is also generated by the same script, since we know the function prototypes, so we could tell what parameters we call the exercised APIs. +This test includes a mocked version of the `esp_hosted` component, so the generated files are: + +* `esp_hosted_mock.c` -- all WiFi APIs to just return a default value (typically `ESP_OK`) +* `esp_hosted_mock.h` -- declares all WiFi related APIs +* `Kconfig` -- selection of all SLAVE targets (with WiFi capabilities) +* `all_wifi_calls.c` -- calls all WiFi APIs (to check that targets without WiFi caps can use the original APIs) +* `all_wifi_remote_calls.c` -- calls all remote WiFi APIs (to check that also the targets with WiFi caps can use the remote wifi functionality) diff --git a/resources/espressif__esp_wifi_remote/scripts/copyright_header.h b/resources/espressif__esp_wifi_remote/scripts/copyright_header.h new file mode 100644 index 0000000..e03d31b --- /dev/null +++ b/resources/espressif__esp_wifi_remote/scripts/copyright_header.h @@ -0,0 +1,6 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +// This file is auto-generated diff --git a/resources/espressif__esp_wifi_remote/scripts/generate_and_check.py b/resources/espressif__esp_wifi_remote/scripts/generate_and_check.py new file mode 100644 index 0000000..9f2e4a6 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/scripts/generate_and_check.py @@ -0,0 +1,636 @@ +# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Apache-2.0 +import argparse +import glob +import json +import os +import re +import shutil +import subprocess +from collections import namedtuple + +from idf_build_apps.constants import PREVIEW_TARGETS, SUPPORTED_TARGETS +from pycparser import c_ast, c_parser, preprocess_file + +Param = namedtuple('Param', ['ptr', 'array', 'qual', 'type', 'name']) + +AUTO_GENERATED = 'This file is auto-generated' +COPYRIGHT_HEADER = open('copyright_header.h', 'r').read() +NAMESPACE = re.compile(r'^esp_wifi') +DEPRECATED_API = ['esp_wifi_set_ant_gpio', 'esp_wifi_get_ant', 'esp_wifi_get_ant_gpio', 'esp_wifi_set_ant'] +KCONFIG_MULTIPLE_DEF = '# ignore: multiple-definition' +wifi_configs = [] + + +class FunctionVisitor(c_ast.NodeVisitor): + def __init__(self, header): + self.function_prototypes = {} + self.ptr = 0 + self.array = 0 + self.content = open(header, 'r').read() + + def get_type(self, node, suffix='param'): + if suffix == 'param': + self.ptr = 0 + self.array = 0 + + if isinstance(node.type, c_ast.TypeDecl): + typename = node.type.declname + quals = '' + if node.type.quals: + quals = ' '.join(node.type.quals) + if node.type.type.names: + type = node.type.type.names[0] + return quals, type, typename + if isinstance(node.type, c_ast.PtrDecl): + quals, type, name = self.get_type(node.type, 'ptr') + self.ptr += 1 + return quals, type, name + + if isinstance(node.type, c_ast.ArrayDecl): + quals, type, name = self.get_type(node.type, 'array') + self.array = int(node.type.dim.value) + return quals, type, name + + def visit_FuncDecl(self, node): + if isinstance(node.type, c_ast.TypeDecl): + func_name = node.type.declname + if func_name.startswith('esp_wifi') and not func_name.endswith('_t') and func_name in self.content: + if func_name in DEPRECATED_API: + return + ret = node.type.type.names[0] + args = [] + for param in node.args.params: + quals, type, name = self.get_type(param) + param = Param(ptr=self.ptr, array=self.array, qual=quals, type=type, name=name) + args.append(param) + self.function_prototypes[func_name] = (ret, args) + + +# Parse the header file and extract function prototypes +def extract_function_prototypes(header_code, header): + parser = c_parser.CParser() # Set debug parameter to False + ast = parser.parse(header_code) + visitor = FunctionVisitor(header) + visitor.visit(ast) + return visitor.function_prototypes + + +def exec_cmd(what, out_file=None): + p = subprocess.Popen(what, stdin=subprocess.PIPE, stdout=out_file if out_file is not None else subprocess.PIPE, stderr=subprocess.PIPE) + output_b, err_b = p.communicate() + rc = p.returncode + output: str = output_b.decode('utf-8') if output_b is not None else '' + err: str = err_b.decode('utf-8') if err_b is not None else '' + return rc, output, err, ' '.join(what) + + +def preprocess(idf_path, header): + project_dir = os.path.join(idf_path, 'examples', 'wifi', 'getting_started', 'station') + build_dir = os.path.join(project_dir, 'build') + subprocess.check_call(['idf.py', '-B', build_dir, 'reconfigure'], cwd=project_dir) + build_commands_json = os.path.join(build_dir, 'compile_commands.json') + with open(build_commands_json, 'r', encoding='utf-8') as f: + build_command = json.load(f)[0]['command'].split() + include_dir_flags = [] + include_dirs = [] + # process compilation flags (includes and defines) + for item in build_command: + if item.startswith('-I'): + include_dir_flags.append(item) + if 'components' in item: + include_dirs.append(item[2:]) # Removing the leading "-I" + if item.startswith('-D'): + include_dir_flags.append(item.replace('\\','')) # removes escaped quotes, eg: -DMBEDTLS_CONFIG_FILE=\\\"mbedtls/esp_config.h\\\" + include_dir_flags.append('-I' + os.path.join(build_dir, 'config')) + temp_file = 'esp_wifi_preprocessed.h' + with open(temp_file, 'w') as f: + f.write('#define asm\n') + f.write('#define volatile\n') + f.write('#define __asm__\n') + f.write('#define __volatile__\n') + with open(temp_file, 'a') as f: + rc, out, err, cmd = exec_cmd(['xtensa-esp32-elf-gcc', '-w', '-P', '-include', 'ignore_extensions.h', '-E', header] + include_dir_flags, f) + if rc != 0: + print(f'command {cmd} failed!') + print(err) + preprocessed_code = preprocess_file(temp_file) + return preprocessed_code + + +def get_args(parameters): + params = [] + names = [] + for param in parameters: + typename = param.type + if typename == 'void' and param.ptr == 0 and param.name is None: + params.append(f'{typename}') + continue + if param.qual != '': + typename = f'{param.qual} ' + typename + declname = param.name + names.append(f'{declname}') + if param.ptr > 0: + declname = '*' * param.ptr + declname + if param.array > 0: + declname += f'[{param.array}]' + params.append(f'{typename} {declname}') + comma_separated_params = ', '.join(params) + comma_separated_names = ', '.join(names) + return comma_separated_params, comma_separated_names + + +def get_vars(parameters): + definitions = '' + names = [] + for param in parameters: + typename = param.type + if typename == 'void' and param.ptr == 0 and param.name is None: + continue + default_value = '0' + declname = param.name + names.append(f'{declname}') + if param.qual != '': + typename = f'{param.qual} ' + typename + if param.ptr > 0: + declname = '*' * param.ptr + declname + default_value = 'NULL' + if param.array > 0: + declname += f'[{param.array}]' + default_value = '{}' + definitions += f' {typename} {declname} = {default_value};\n' + comma_separated_names = ', '.join(names) + return definitions, comma_separated_names + + +def generate_kconfig_wifi_caps(idf_path, idf_ver_dir, component_path): + kconfig = os.path.join(component_path, idf_ver_dir, 'Kconfig.soc_wifi_caps.in') + slave_select = os.path.join(component_path, idf_ver_dir, 'Kconfig.slave_select.in') + + # Read and parse the global Kconfig file for target selections + target_selections = {} + current_target = None + with open(os.path.join(idf_path, 'Kconfig'), 'r') as f: + for line in f: + line = line.strip() + if line.startswith('config IDF_TARGET_'): + current_target = line.split()[1] + target_selections[current_target] = [] + elif current_target and line.strip().startswith('select'): + selection = line.split()[1] + target_selections[current_target].append(selection) + + with open(kconfig, 'w') as slave_caps, open(slave_select, 'w') as slave: + slave_caps.write(f'# {AUTO_GENERATED}\n') + slave.write(f'# {AUTO_GENERATED}\n') + slave.write(' choice SLAVE_IDF_TARGET\n') + slave.write(' prompt "choose slave target"\n') + slave.write(' default SLAVE_IDF_TARGET_ESP32\n') + for slave_target in SUPPORTED_TARGETS + PREVIEW_TARGETS: + add_slave = False + kconfig_content = [] + soc_caps = os.path.join(idf_path, 'components', 'soc', slave_target, 'include', 'soc', 'Kconfig.soc_caps.in') + try: + with open(soc_caps, 'r') as f: + for line in f: + if line.strip().startswith('config SOC_WIFI_'): + if 'config SOC_WIFI_SUPPORTED' in line: + # if WiFi supported for this target, add it to Kconfig slave options and test this slave + add_slave = True + replaced = re.sub(r'SOC_WIFI_', 'SLAVE_SOC_WIFI_', line.strip()) + kconfig_content.append(f' {replaced} {KCONFIG_MULTIPLE_DEF}\n') + kconfig_content.append(f' {f.readline()}') # type + kconfig_content.append(f' {f.readline()}\n') # default + except FileNotFoundError: + print(f'Warning: File {soc_caps} not found. Skipping target {slave_target}.') + continue + except IOError as e: + print(f'Error reading file {soc_caps}: {e}') + continue + + if add_slave: + slave_caps.write(f'\nif SLAVE_IDF_TARGET_{slave_target.upper()}\n\n') + slave_caps.writelines(kconfig_content) + + # Add any target-specific selections from global Kconfig + target_key = f'IDF_TARGET_{slave_target.upper()}' + if target_key in target_selections: + for selection in target_selections[target_key]: + slave_caps.write(f' config SLAVE_{selection} {KCONFIG_MULTIPLE_DEF}\n') + slave_caps.write(f' bool\n') + slave_caps.write(f' default y\n\n') + + slave_caps.write(f'endif # {slave_target.upper()}\n') + + slave_config_name = 'SLAVE_IDF_TARGET_' + slave_target.upper() + slave.write(f' config {slave_config_name}\n') + slave.write(f' bool "{slave_target}"\n') + + slave.write(' endchoice\n') + return [kconfig, slave_select] + + +def generate_remote_wifi_api(function_prototypes, idf_ver_dir, component_path): + header = os.path.join(component_path, idf_ver_dir, 'include', 'esp_wifi_remote_api.h') + wifi_source = os.path.join(component_path, idf_ver_dir, 'esp_wifi_with_remote.c') + remote_source = os.path.join(component_path, idf_ver_dir, 'esp_wifi_remote_weak.c') + with open(header, 'w') as f: + f.write(COPYRIGHT_HEADER) + f.write('#pragma once\n') + for func_name, args in function_prototypes.items(): + params, _ = get_args(args[1]) + remote_func_name = NAMESPACE.sub('esp_wifi_remote', func_name) + f.write(f'{args[0]} {remote_func_name}({params});\n') + with open(wifi_source, 'w') as wifi, open(remote_source, 'w') as remote: + wifi.write(COPYRIGHT_HEADER) + wifi.write('#include "esp_wifi.h"\n') + wifi.write('#include "esp_wifi_remote.h"\n') + remote.write(COPYRIGHT_HEADER) + remote.write('#include "esp_wifi_remote.h"\n') + remote.write('#include "esp_log.h"\n\n') + remote.write('#define WEAK __attribute__((weak))\n') + remote.write('#define LOG_UNSUPPORTED_AND_RETURN(ret) ESP_LOGW("esp_wifi_remote_weak", "%s unsupported", __func__); \\\n return ret;\n') + for func_name, args in function_prototypes.items(): + remote_func_name = NAMESPACE.sub('esp_wifi_remote', func_name) + params, names = get_args(args[1]) + ret_type = args[0] + ret_value = '-1' # default return value indicating error + if (ret_type == 'esp_err_t'): + ret_value = 'ESP_ERR_NOT_SUPPORTED' + wifi.write(f'\n{args[0]} {func_name}({params})\n') + wifi.write('{\n') + wifi.write(f' return {remote_func_name}({names});\n') + wifi.write('}\n') + remote.write(f'\nWEAK {args[0]} {remote_func_name}({params})\n') + remote.write('{\n') + remote.write(f' LOG_UNSUPPORTED_AND_RETURN({ret_value});\n') + remote.write('}\n') + return [header, wifi_source, remote_source] + + +def generate_hosted_mocks(function_prototypes, idf_ver_dir, component_path): + if 'tag' in idf_ver_dir: + return [] + source = os.path.join(component_path, 'test', 'smoke_test', 'components', 'esp_hosted', idf_ver_dir, 'esp_hosted_mock.c') + header = os.path.join(component_path, 'test', 'smoke_test', 'components', 'esp_hosted', idf_ver_dir, 'include', 'esp_hosted_mock.h') + with open(source, 'w') as f, open(header, 'w') as h: + f.write(COPYRIGHT_HEADER) + h.write(COPYRIGHT_HEADER) + h.write('#pragma once\n') + f.write('#include "esp_wifi.h"\n') + f.write('#include "esp_wifi_remote.h"\n') + for func_name, args in function_prototypes.items(): + hosted_func_name = NAMESPACE.sub('esp_wifi_remote', func_name) + params, names = get_args(args[1]) + ret_type = args[0] + ret_value = '0' # default return value + if (ret_type == 'esp_err_t'): + ret_value = 'ESP_OK' + f.write(f'\n{ret_type} {hosted_func_name}({params})\n') + f.write('{\n') + f.write(f' return {ret_value};\n') + f.write('}\n') + h.write(f'{ret_type} {hosted_func_name}({params});\n') + return [source, header] + + +def generate_test_cases(function_prototypes, idf_ver_dir, component_path): + if 'tag' in idf_ver_dir: + return [] + wifi_cases = os.path.join(component_path, 'test', 'smoke_test', 'main', idf_ver_dir, 'all_wifi_calls.c') + remote_wifi_cases = os.path.join(component_path, 'test', 'smoke_test', 'main', idf_ver_dir, 'all_wifi_remote_calls.c') + with open(wifi_cases, 'w') as wifi, open(remote_wifi_cases, 'w') as remote: + wifi.write(COPYRIGHT_HEADER) + remote.write(COPYRIGHT_HEADER) + wifi.write('#include "esp_wifi.h"\n\n') + remote.write('#include "esp_wifi_remote.h"\n\n') + wifi.write('void run_all_wifi_apis(void)\n{\n') + remote.write('void run_all_wifi_remote_apis(void)\n{\n') + for func_name, args in function_prototypes.items(): + remote_func_name = NAMESPACE.sub('esp_wifi_remote', func_name) + defs, names = get_vars(args[1]) + wifi.write(' {\n') + wifi.write(f'{defs}') + wifi.write(f' {func_name}({names});\n') + wifi.write(' }\n\n') + remote.write(' {\n') + remote.write(f'{defs}') + remote.write(f' {remote_func_name}({names});\n') + remote.write(' }\n\n') + wifi.write('}\n') + remote.write('}\n') + return [wifi_cases, remote_wifi_cases] + + +def generate_wifi_native(idf_path, idf_ver_dir, component_path): + native_headers = [] + + def replace_configs(original, replaced): + with open(original, 'r') as f: + content = f.read() + content = content.replace(r'CONFIG_ESP_WIFI_', 'CONFIG_WIFI_RMT_') + content = content.replace(r'CONFIG_SOC_WIFI_', 'CONFIG_SLAVE_SOC_WIFI_') + content = content.replace(r'CONFIG_FREERTOS_', 'CONFIG_SLAVE_FREERTOS_') + content = content.replace(r'CONFIG_IDF_TARGET_', 'CONFIG_SLAVE_IDF_TARGET_') + with open(replaced, 'w') as f: + f.write(content) + return replaced + + include_dir = os.path.join(idf_path, 'components', 'esp_wifi', 'include') + remote_dir = os.path.join(component_path, idf_ver_dir, 'include', 'injected') + os.makedirs(remote_dir, exist_ok=True) + + header_mappings = [ + ('local/esp_wifi_types_native.h', 'esp_wifi_types_native.h'), + ('esp_wifi.h', 'esp_wifi.h'), + ('esp_wifi_types_generic.h', 'esp_wifi_types_generic.h'), + ('esp_wifi_he_types.h', 'esp_wifi_he_types.h'), + ('esp_wifi_types.h', 'esp_wifi_types.h'), + ] + + for src_rel, dest_name in header_mappings: + original = os.path.join(include_dir, src_rel) + replaced = os.path.join(remote_dir, dest_name) + native_headers.append(replace_configs(original, replaced)) + + # Copy remaining headers + for pattern in ['esp_wifi*.h', 'esp_mesh*.h', 'esp_now.h']: + for header in glob.glob(os.path.join(include_dir, pattern)): + dest = os.path.join(remote_dir, os.path.basename(header)) + if dest not in native_headers: + shutil.copy(header, dest) + native_headers.append(dest) + + return native_headers + + +def get_global_configs(idf_path): + """Extract global configs from Kconfig that are selected by IDF_TARGET configs""" + global_configs = set() + current_target = None + with open(os.path.join(idf_path, 'Kconfig'), 'r') as f: + for line in f: + line = line.strip() + if line.startswith('config IDF_TARGET_'): + current_target = True + elif current_target and line.strip().startswith('select'): + selection = line.split()[1] + global_configs.add(selection) + elif line.startswith('config') or line.startswith('choice'): + current_target = False + return global_configs + + +def generate_kconfig(idf_path, idf_ver_dir, component_path): + # Define file paths + remote_kconfig = os.path.join(component_path, idf_ver_dir, 'Kconfig.wifi.in') + esp_wifi_kconfig = os.path.join(idf_path, 'components', 'esp_wifi', 'Kconfig') + # Variables for accumulating configuration details + remote_configs = '' + current_config = None + current_config_indent = 0 + depends_on = None + + # Config prefixes to be replaced + base_configs = ['SOC_WIFI_', 'IDF_TARGET_'] + # Get global configs from the original Kconfig (assumed to be defined elsewhere) + global_configs = get_global_configs(idf_path) + + # Read the source Kconfig lines + with open(esp_wifi_kconfig, 'r') as f: + lines = f.readlines() + + # Setup counters and flags for nested ifs and choice blocks + nesting_threshold = 100 # Initial high threshold; will be adjusted later + nested_if = 0 + initial_indent = -1 # Will be set once the first config/choice line is encountered + inside_choice = False + + with open(remote_kconfig, 'w') as outfile: + # Write header comments + outfile.write('# Wi-Fi configuration\n') + outfile.write(f'# {AUTO_GENERATED}\n') + + for original_line in lines: + stripped_line = original_line.strip() + + # Update nesting level counters for if/endif blocks + if re.match(r'^if\s+[A-Z_0-9]+\s*$', stripped_line): + nested_if += 1 + elif stripped_line.startswith('endif'): + nested_if -= 1 + + # Track whether we are inside a choice block + if re.match(r'^choice', stripped_line): + inside_choice = True + elif stripped_line.startswith('endchoice'): + inside_choice = False + + # Process lines after reaching the nesting threshold + if nested_if >= nesting_threshold: + # Capture the initial indentation level when encountering the first config/choice + if initial_indent == -1 and re.match(r'^(config|choice)\s+ESP_WIFI_', stripped_line): + initial_indent = len(re.match(r'^\s*', original_line).group()) + + # Make a copy of the original line for modifications + modified_line = original_line + # Replace base configuration prefixes + for config in base_configs: + modified_line = re.compile(config).sub('SLAVE_' + config, modified_line) + # Replace global config names (ensuring whole word match) + for config in global_configs: + modified_line = re.compile(r'\b' + config + r'\b').sub('SLAVE_' + config, modified_line) + # Replace the primary prefix ESP_WIFI_ with WIFI_RMT_ + modified_line = re.compile(r'\bESP_WIFI_').sub('WIFI_RMT_', modified_line) + + # If a current config block is active, check for changes in indentation + if current_config is not None: + # If the current line is still within the current config block (by indent) + if len(re.match(r'^\s*', original_line).group()) > current_config_indent: + # Check for config properties: type (int or bool) or dependency + for keyword in ['int', 'bool', 'depends']: + if re.match(fr'^{keyword}', stripped_line): + if keyword == 'depends': + depends_on = modified_line.strip() + else: + config_type = keyword + # Prepare the default remote value by replacing the prefix + remote_value = current_config.replace('ESP_WIFI_', 'WIFI_RMT_') + else: + # End of the current config block; append the accumulated remote config block + if config_type == 'bool': + remote_configs += f'if {remote_value}\n' + remote_configs += f' config {current_config} {KCONFIG_MULTIPLE_DEF}\n' + remote_configs += f' {config_type}\n' + if depends_on is not None: + remote_configs += f' {depends_on}\n' + depends_on = None + remote_configs += f' default {remote_value}\n' + if config_type == 'bool': + remote_configs += f'endif\n' + remote_configs += '\n' + current_config = None + + # Check if the line declares a config or choice for ESP_WIFI_ + match = re.match(r'^(config|choice)\s+(ESP_WIFI_[A-Z0-9_]+)', stripped_line) + if match: + wifi_configs.append(match.group(2)) + # Only treat non-choice config declarations as starting a config block + if match.group(1) == 'config' and not inside_choice: + current_config = match.group(2) + current_config_indent = len(re.match(r'^\s*', modified_line).group()) + + # Adjust indentation relative to the captured initial indent + if len(modified_line) > initial_indent and modified_line[:initial_indent].isspace(): + modified_line = modified_line[initial_indent:] + outfile.write(modified_line) + + # When an ESP_WIFI_ENABLED condition is encountered, update the nesting threshold + if re.match(r'^if\s+\(?ESP_WIFI_ENABLED', stripped_line): + nesting_threshold = nested_if + + # Append the accumulated remote configurations under the disabled ESP_WIFI condition + outfile.write('if !ESP_WIFI_ENABLED\n') + outfile.write(remote_configs) + outfile.write('endif # ESP_WIFI_ENABLED\n') + outfile.write('# Wi-Fi configuration end\n') + + return [remote_kconfig] + + +def generate_wifi_static(idf_vr_dir, component_path): + wifi_static = os.path.join(component_path, idf_ver_dir, 'include', 'esp_wifi_default_config.h') + with open(wifi_static, 'w') as f: + f.write(COPYRIGHT_HEADER) + f.write('#pragma once\n') + kconfig_path = os.path.join(component_path, 'Kconfig') + all_targets = SUPPORTED_TARGETS + PREVIEW_TARGETS + for target in all_targets: + if target == 'linux': + continue + default_config = f'default.{target}' + with open(default_config, 'w') as file: + for slave_target in all_targets: + value = 'y' if slave_target == target else 'n' + file.write(f'CONFIG_SLAVE_IDF_TARGET_{slave_target.upper()}={value}\n') + rc, _, err, cmd = exec_cmd(['python', '-m', 'kconfgen', '--kconfig', f'{kconfig_path}', + '--config', f'{default_config}', '--output', 'header', f'{default_config}']) + if rc != 0: + print(f'command {cmd} failed!') + print(err) + with open(wifi_static, 'a') as f: + f.write(f'\n#if CONFIG_SLAVE_IDF_TARGET_{target.upper()}\n') + with open(default_config, 'r') as config_file: + for line in config_file: + if line.strip().startswith('#define'): + f.write(line) + f.write(f'#endif // CONFIG_SLAVE_IDF_TARGET_{target.upper()}\n') + return [wifi_static] + + +def compare_files(base_dir, component_path, files_to_check): + failures = [] + for file_path in files_to_check: + relative_path = os.path.relpath(file_path, component_path) + base_file = os.path.join(base_dir, relative_path) + + if not os.path.exists(base_file): + failures.append((relative_path, 'File does not exist in base directory')) + continue + + diff_cmd = ['diff', '-I', 'Copyright', file_path, base_file] + result = subprocess.run(diff_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + + if result.returncode != 0: # diff returns 0 if files are identical + failures.append((relative_path, result.stdout.decode('utf-8'))) + + return failures + + +def get_idf_ver_dir(idf_path, component_path): + try: + # Run `git describe` inside the IDF_PATH directory + result = subprocess.run( + ['git', 'describe', '--tags', '--dirty'], + cwd=idf_path, + capture_output=True, + text=True, + check=True + ) + idf_ver = result.stdout.strip() + except subprocess.CalledProcessError: + raise RuntimeError('Failed to retrieve IDF version using `git describe`.') + # Regex to match version tags like vX.Y or vX.Y.Z (with optional -dirty) + match = re.match(r'^(v\d+\.\d+(\.\d+)?)(-dirty)?$', idf_ver) + + if match and os.path.isdir(os.path.join(component_path, f'idf_tag_{match.group(1)}')): + return f'idf_tag_{match.group(1)}' # Return the clean tag (without -dirty) + idf_version = os.getenv('ESP_IDF_VERSION') + if idf_version is None: + raise RuntimeError("Environment variable 'ESP_IDF_VERSION' wasn't set.") + return f'idf_v{idf_version}' + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description='Build all projects', + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + epilog='''\ +TEST FAILED +----------- +Some of the component files are different from the pregenerated output. +Please check the files that marked as "FAILED" in this step, +typically you'd just need to commit the changes and create a new version. +Please be aware that the pregenerated files use the same copyright header, so after +making changes you might need to modify 'copyright_header.h' in the script directory. + ''') + parser.add_argument('-s', '--skip-check', help='Skip checking the versioned files against the re-generated', action='store_true') + parser.add_argument('--base-dir', help='Base directory to compare generated files against') + args = parser.parse_args() + + idf_path = os.getenv('IDF_PATH') + if idf_path is None: + raise RuntimeError("Environment variable 'IDF_PATH' wasn't set.") + + component_path = os.path.normpath(os.path.join(os.path.realpath(__file__),'..', '..')) + idf_path = os.getenv('IDF_PATH') + if idf_path is None: + raise RuntimeError("Environment variable 'IDF_PATH' wasn't set.") + idf_ver_dir = get_idf_ver_dir(idf_path, component_path) + + header = os.path.join(idf_path, 'components', 'esp_wifi', 'include', 'esp_wifi.h') + function_prototypes = extract_function_prototypes(preprocess(idf_path, header), header) + + files_to_check = [] + + files_to_check += generate_kconfig_wifi_caps(idf_path, idf_ver_dir, component_path) + + files_to_check += generate_remote_wifi_api(function_prototypes, idf_ver_dir, component_path) + + files_to_check += generate_hosted_mocks(function_prototypes, idf_ver_dir, component_path) + + files_to_check += generate_test_cases(function_prototypes, idf_ver_dir, component_path) + + files_to_check += generate_wifi_native(idf_path, idf_ver_dir, component_path) + + files_to_check += generate_kconfig(idf_path, idf_ver_dir, component_path) + + files_to_check += generate_wifi_static(idf_ver_dir, component_path) + + for f in files_to_check: + print(f) + + if args.skip_check or args.base_dir is None: + exit(0) + + failures = compare_files(args.base_dir, component_path, files_to_check) + + if failures: + print(parser.epilog) + print('\nDifferent files:\n') + for file, diff in failures: + print(f'{file}\nChanges:\n{diff}') + exit(1) + else: + print('All files are identical to the base directory.') + exit(0) diff --git a/resources/espressif__esp_wifi_remote/scripts/generate_slave_configs.py b/resources/espressif__esp_wifi_remote/scripts/generate_slave_configs.py new file mode 100644 index 0000000..33ebef9 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/scripts/generate_slave_configs.py @@ -0,0 +1,33 @@ +# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Apache-2.0 +import os +import re +import sys + +if len(sys.argv) < 2: + print('Usage: python generate_slave_configs.py ') + sys.exit(1) +output_directory = sys.argv[1] + +# Input Kconfig file +component_path = os.path.normpath(os.path.join(os.path.realpath(__file__),'..', '..')) +kconfig_file = os.path.join(component_path, f"idf_v{os.getenv('ESP_IDF_VERSION')}", 'Kconfig.slave_select.in') + +# Output file prefix +output_prefix = 'sdkconfig.ci.' + +# Regex pattern to match all available options for SLAVE_IDF_TARGET +pattern = r'^ *config SLAVE_IDF_TARGET_(\w+)' + +# Read the Kconfig and generate specific sdkconfig.ci.{slave} for each option +with open(kconfig_file, 'r') as file: + for line in file: + match = re.match(pattern, line) + if match: + slave = match.group(1) + output_file = os.path.join(output_directory, f'{output_prefix}{slave.lower()}') + + with open(output_file, 'w') as out_file: + out_file.write(f'CONFIG_SLAVE_IDF_TARGET_{slave.upper()}=y\n') + + print(f'Generated: {output_file}') diff --git a/resources/espressif__esp_wifi_remote/scripts/ignore_extensions.h b/resources/espressif__esp_wifi_remote/scripts/ignore_extensions.h new file mode 100644 index 0000000..f65b3ca --- /dev/null +++ b/resources/espressif__esp_wifi_remote/scripts/ignore_extensions.h @@ -0,0 +1,13 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#define __attribute__(x) +#define __asm__(x) +#define __volatile__(...) +#define volatile(...) +typedef void *__builtin_va_list; +#define __inline__ inline +#define __inline inline +#define __extension__ diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/CMakeLists.txt b/resources/espressif__esp_wifi_remote/test/smoke_test/CMakeLists.txt new file mode 100644 index 0000000..413711e --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/CMakeLists.txt @@ -0,0 +1,8 @@ +# For more information about build system see +# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html +# The following five lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.16) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(smoke_test) diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/README.md b/resources/espressif__esp_wifi_remote/test/smoke_test/README.md new file mode 100644 index 0000000..900d946 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/README.md @@ -0,0 +1,5 @@ +# Smoke (build-only) test + +This test tries to build an application which calls all declared APIs from this component and from `esp_wifi`. +Most of the test code is autogenerated, please see [README.md](../../scripts/README.md) for more details on the generation process. +This test should be build for all combinations of host and slave targets. diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/CMakeLists.txt b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/CMakeLists.txt new file mode 100644 index 0000000..daa27d1 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/CMakeLists.txt @@ -0,0 +1,5 @@ +set(IDF_VER_DIR "idf_v${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}") + +idf_component_register(SRCS "${IDF_VER_DIR}/esp_hosted_mock.c" + INCLUDE_DIRS "${IDF_VER_DIR}/include" "include" + REQUIRES esp_wifi esp_wifi_remote) diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_component.yml b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_component.yml new file mode 100644 index 0000000..2ef3d52 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_component.yml @@ -0,0 +1 @@ +version: 1.0.0 diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_v5.3/esp_hosted_mock.c b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_v5.3/esp_hosted_mock.c new file mode 100644 index 0000000..ab8266c --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_v5.3/esp_hosted_mock.c @@ -0,0 +1,393 @@ +/* + * 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_remote_init(const wifi_init_config_t *config) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_deinit(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_mode(wifi_mode_t mode) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_mode(wifi_mode_t *mode) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_start(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_stop(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_restore(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_connect(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_disconnect(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_clear_fast_connect(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_deauth_sta(uint16_t aid) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_scan_start(const wifi_scan_config_t *config, _Bool block) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_scan_parameters(const wifi_scan_default_params_t *config) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_scan_parameters(wifi_scan_default_params_t *config) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_scan_stop(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_scan_get_ap_num(uint16_t *number) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_scan_get_ap_record(wifi_ap_record_t *ap_record) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_clear_ap_list(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_sta_get_ap_info(wifi_ap_record_t *ap_info) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_ps(wifi_ps_type_t type) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_ps(wifi_ps_type_t *type) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_channel(uint8_t primary, wifi_second_chan_t second) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_channel(uint8_t *primary, wifi_second_chan_t *second) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_country(const wifi_country_t *country) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_country(wifi_country_t *country) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_mac(wifi_interface_t ifx, const uint8_t mac[6]) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_mac(wifi_interface_t ifx, uint8_t mac[6]) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_promiscuous_rx_cb(wifi_promiscuous_cb_t cb) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_promiscuous(_Bool en) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_promiscuous(_Bool *en) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_promiscuous_filter(const wifi_promiscuous_filter_t *filter) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_promiscuous_filter(wifi_promiscuous_filter_t *filter) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_promiscuous_ctrl_filter(const wifi_promiscuous_filter_t *filter) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_promiscuous_ctrl_filter(wifi_promiscuous_filter_t *filter) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_config(wifi_interface_t interface, wifi_config_t *conf) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_config(wifi_interface_t interface, wifi_config_t *conf) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_ap_get_sta_list(wifi_sta_list_t *sta) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_ap_get_sta_aid(const uint8_t mac[6], uint16_t *aid) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_storage(wifi_storage_t storage) +{ + return ESP_OK; +} + +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) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_max_tx_power(int8_t power) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_max_tx_power(int8_t *power) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_event_mask(uint32_t mask) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_event_mask(uint32_t *mask) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_80211_tx(wifi_interface_t ifx, const void *buffer, int len, _Bool en_sys_seq) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_csi_rx_cb(wifi_csi_cb_t cb, void *ctx) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_csi_config(const wifi_csi_config_t *config) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_csi_config(wifi_csi_config_t *config) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_csi(_Bool en) +{ + return ESP_OK; +} + +int64_t esp_wifi_remote_get_tsf_time(wifi_interface_t interface) +{ + return 0; +} + +esp_err_t esp_wifi_remote_set_inactive_time(wifi_interface_t ifx, uint16_t sec) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_inactive_time(wifi_interface_t ifx, uint16_t *sec) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_statis_dump(uint32_t modules) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_rssi_threshold(int32_t rssi) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_ftm_initiate_session(wifi_ftm_initiator_cfg_t *cfg) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_ftm_end_session(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_ftm_resp_set_offset(int16_t offset_cm) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_ftm_get_report(wifi_ftm_report_entry_t *report, uint8_t num_entries) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_config_11b_rate(wifi_interface_t ifx, _Bool disable) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_connectionless_module_set_wake_interval(uint16_t wake_interval) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_force_wakeup_acquire(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_force_wakeup_release(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_country_code(const char *country, _Bool ieee80211d_enabled) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_country_code(char *country) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_config_80211_tx_rate(wifi_interface_t ifx, wifi_phy_rate_t rate) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_config_80211_tx(wifi_interface_t ifx, wifi_tx_rate_config_t *config) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_disable_pmf_config(wifi_interface_t ifx) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_sta_get_aid(uint16_t *aid) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_dynamic_cs(_Bool enabled) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_sta_get_rssi(int *rssi) +{ + return ESP_OK; +} diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_v5.3/include/esp_hosted_mock.h b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_v5.3/include/esp_hosted_mock.h new file mode 100644 index 0000000..71e471d --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_v5.3/include/esp_hosted_mock.h @@ -0,0 +1,84 @@ +/* + * 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); diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_v5.4/esp_hosted_mock.c b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_v5.4/esp_hosted_mock.c new file mode 100644 index 0000000..1b45b32 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_v5.4/esp_hosted_mock.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_remote_init(const wifi_init_config_t *config) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_deinit(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_mode(wifi_mode_t mode) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_mode(wifi_mode_t *mode) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_start(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_stop(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_restore(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_connect(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_disconnect(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_clear_fast_connect(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_deauth_sta(uint16_t aid) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_scan_start(const wifi_scan_config_t *config, _Bool block) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_scan_parameters(const wifi_scan_default_params_t *config) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_scan_parameters(wifi_scan_default_params_t *config) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_scan_stop(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_scan_get_ap_num(uint16_t *number) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_scan_get_ap_record(wifi_ap_record_t *ap_record) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_clear_ap_list(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_sta_get_ap_info(wifi_ap_record_t *ap_info) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_ps(wifi_ps_type_t type) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_ps(wifi_ps_type_t *type) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_channel(uint8_t primary, wifi_second_chan_t second) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_channel(uint8_t *primary, wifi_second_chan_t *second) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_country(const wifi_country_t *country) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_country(wifi_country_t *country) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_mac(wifi_interface_t ifx, const uint8_t mac[6]) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_mac(wifi_interface_t ifx, uint8_t mac[6]) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_promiscuous_rx_cb(wifi_promiscuous_cb_t cb) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_promiscuous(_Bool en) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_promiscuous(_Bool *en) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_promiscuous_filter(const wifi_promiscuous_filter_t *filter) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_promiscuous_filter(wifi_promiscuous_filter_t *filter) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_promiscuous_ctrl_filter(const wifi_promiscuous_filter_t *filter) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_promiscuous_ctrl_filter(wifi_promiscuous_filter_t *filter) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_config(wifi_interface_t interface, wifi_config_t *conf) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_config(wifi_interface_t interface, wifi_config_t *conf) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_ap_get_sta_list(wifi_sta_list_t *sta) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_ap_get_sta_aid(const uint8_t mac[6], uint16_t *aid) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_storage(wifi_storage_t storage) +{ + return ESP_OK; +} + +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) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_max_tx_power(int8_t power) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_max_tx_power(int8_t *power) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_event_mask(uint32_t mask) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_event_mask(uint32_t *mask) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_80211_tx(wifi_interface_t ifx, const void *buffer, int len, _Bool en_sys_seq) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_csi_rx_cb(wifi_csi_cb_t cb, void *ctx) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_csi_config(const wifi_csi_config_t *config) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_csi_config(wifi_csi_config_t *config) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_csi(_Bool en) +{ + return ESP_OK; +} + +int64_t esp_wifi_remote_get_tsf_time(wifi_interface_t interface) +{ + return 0; +} + +esp_err_t esp_wifi_remote_set_inactive_time(wifi_interface_t ifx, uint16_t sec) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_inactive_time(wifi_interface_t ifx, uint16_t *sec) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_statis_dump(uint32_t modules) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_rssi_threshold(int32_t rssi) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_ftm_initiate_session(wifi_ftm_initiator_cfg_t *cfg) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_ftm_end_session(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_ftm_resp_set_offset(int16_t offset_cm) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_ftm_get_report(wifi_ftm_report_entry_t *report, uint8_t num_entries) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_config_11b_rate(wifi_interface_t ifx, _Bool disable) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_connectionless_module_set_wake_interval(uint16_t wake_interval) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_force_wakeup_acquire(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_force_wakeup_release(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_country_code(const char *country, _Bool ieee80211d_enabled) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_country_code(char *country) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_config_80211_tx_rate(wifi_interface_t ifx, wifi_phy_rate_t rate) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_config_80211_tx(wifi_interface_t ifx, wifi_tx_rate_config_t *config) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_disable_pmf_config(wifi_interface_t ifx) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_sta_get_aid(uint16_t *aid) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_dynamic_cs(_Bool enabled) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_sta_get_rssi(int *rssi) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_band(wifi_band_t band) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_band(wifi_band_t *band) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_band_mode(wifi_band_mode_t band_mode) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_band_mode(wifi_band_mode_t *band_mode) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw) +{ + return ESP_OK; +} diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_v5.4/include/esp_hosted_mock.h b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_v5.4/include/esp_hosted_mock.h new file mode 100644 index 0000000..b61b1c2 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_v5.4/include/esp_hosted_mock.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/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_v5.5/esp_hosted_mock.c b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_v5.5/esp_hosted_mock.c new file mode 100644 index 0000000..0b81155 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_v5.5/esp_hosted_mock.c @@ -0,0 +1,448 @@ +/* + * 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_remote_init(const wifi_init_config_t *config) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_deinit(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_mode(wifi_mode_t mode) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_mode(wifi_mode_t *mode) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_start(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_stop(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_restore(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_connect(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_disconnect(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_clear_fast_connect(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_deauth_sta(uint16_t aid) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_scan_start(const wifi_scan_config_t *config, _Bool block) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_scan_parameters(const wifi_scan_default_params_t *config) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_scan_parameters(wifi_scan_default_params_t *config) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_scan_stop(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_scan_get_ap_num(uint16_t *number) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_scan_get_ap_record(wifi_ap_record_t *ap_record) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_clear_ap_list(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_sta_get_ap_info(wifi_ap_record_t *ap_info) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_ps(wifi_ps_type_t type) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_ps(wifi_ps_type_t *type) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_protocol(wifi_interface_t ifx, uint8_t protocol_bitmap) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_protocol(wifi_interface_t ifx, uint8_t *protocol_bitmap) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t bw) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_channel(uint8_t primary, wifi_second_chan_t second) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_channel(uint8_t *primary, wifi_second_chan_t *second) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_country(const wifi_country_t *country) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_country(wifi_country_t *country) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_mac(wifi_interface_t ifx, const uint8_t mac[6]) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_mac(wifi_interface_t ifx, uint8_t mac[6]) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_promiscuous_rx_cb(wifi_promiscuous_cb_t cb) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_promiscuous(_Bool en) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_promiscuous(_Bool *en) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_promiscuous_filter(const wifi_promiscuous_filter_t *filter) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_promiscuous_filter(wifi_promiscuous_filter_t *filter) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_promiscuous_ctrl_filter(const wifi_promiscuous_filter_t *filter) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_promiscuous_ctrl_filter(wifi_promiscuous_filter_t *filter) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_config(wifi_interface_t interface, wifi_config_t *conf) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_config(wifi_interface_t interface, wifi_config_t *conf) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_ap_get_sta_list(wifi_sta_list_t *sta) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_ap_get_sta_aid(const uint8_t mac[6], uint16_t *aid) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_storage(wifi_storage_t storage) +{ + return ESP_OK; +} + +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) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_max_tx_power(int8_t power) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_max_tx_power(int8_t *power) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_event_mask(uint32_t mask) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_event_mask(uint32_t *mask) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_80211_tx(wifi_interface_t ifx, const void *buffer, int len, _Bool en_sys_seq) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_register_80211_tx_cb(esp_wifi_80211_tx_done_cb_t cb) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_csi_rx_cb(wifi_csi_cb_t cb, void *ctx) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_csi_config(const wifi_csi_config_t *config) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_csi_config(wifi_csi_config_t *config) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_csi(_Bool en) +{ + return ESP_OK; +} + +int64_t esp_wifi_remote_get_tsf_time(wifi_interface_t interface) +{ + return 0; +} + +esp_err_t esp_wifi_remote_set_inactive_time(wifi_interface_t ifx, uint16_t sec) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_inactive_time(wifi_interface_t ifx, uint16_t *sec) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_statis_dump(uint32_t modules) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_rssi_threshold(int32_t rssi) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_ftm_initiate_session(wifi_ftm_initiator_cfg_t *cfg) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_ftm_end_session(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_ftm_resp_set_offset(int16_t offset_cm) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_ftm_get_report(wifi_ftm_report_entry_t *report, uint8_t num_entries) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_config_11b_rate(wifi_interface_t ifx, _Bool disable) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_connectionless_module_set_wake_interval(uint16_t wake_interval) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_force_wakeup_acquire(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_force_wakeup_release(void) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_country_code(const char *country, _Bool ieee80211d_enabled) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_country_code(char *country) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_config_80211_tx_rate(wifi_interface_t ifx, wifi_phy_rate_t rate) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_config_80211_tx(wifi_interface_t ifx, wifi_tx_rate_config_t *config) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_disable_pmf_config(wifi_interface_t ifx) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_sta_get_aid(uint16_t *aid) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_dynamic_cs(_Bool enabled) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_sta_get_rssi(int *rssi) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_band(wifi_band_t band) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_band(wifi_band_t *band) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_band_mode(wifi_band_mode_t band_mode) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_band_mode(wifi_band_mode_t *band_mode) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_protocols(wifi_interface_t ifx, wifi_protocols_t *protocols) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_set_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_get_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_action_tx_req(wifi_action_tx_req_t *req) +{ + return ESP_OK; +} + +esp_err_t esp_wifi_remote_remain_on_channel(wifi_roc_req_t *req) +{ + return ESP_OK; +} diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_v5.5/include/esp_hosted_mock.h b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_v5.5/include/esp_hosted_mock.h new file mode 100644 index 0000000..538e783 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/idf_v5.5/include/esp_hosted_mock.h @@ -0,0 +1,95 @@ +/* + * 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_register_80211_tx_cb(esp_wifi_80211_tx_done_cb_t cb); +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); +esp_err_t esp_wifi_remote_action_tx_req(wifi_action_tx_req_t *req); +esp_err_t esp_wifi_remote_remain_on_channel(wifi_roc_req_t *req); diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/include/esp_hosted_api.h b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/include/esp_hosted_api.h new file mode 100644 index 0000000..e1efa1a --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/include/esp_hosted_api.h @@ -0,0 +1,21 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Unlicense OR CC0-1.0 + */ +#pragma once +#include "esp_wifi.h" +#include "esp_hosted_mock.h" +#include "esp_wifi_remote.h" + +#define ESP_HOSTED_CHANNEL_CONFIG_DEFAULT() {} +#define ESP_SERIAL_IF 0 +#define ESP_STA_IF 1 +#define ESP_AP_IF 2 + +struct esp_remote_channel_config { + int if_type; + bool secure; +}; + +esp_remote_channel_t esp_hosted_add_channel(struct esp_remote_channel_config *config, esp_remote_channel_tx_fn_t *tx_cb, esp_remote_channel_rx_fn_t rx_cb); diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/include/esp_hosted_wifi_api.h b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/include/esp_hosted_wifi_api.h new file mode 100644 index 0000000..7fd42fb --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/components/esp_hosted/include/esp_hosted_wifi_api.h @@ -0,0 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Unlicense OR CC0-1.0 + */ +#pragma once +#include "esp_wifi.h" +#include "esp_hosted_api.h" diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/main/CMakeLists.txt b/resources/espressif__esp_wifi_remote/test/smoke_test/main/CMakeLists.txt new file mode 100644 index 0000000..fe54b8a --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/main/CMakeLists.txt @@ -0,0 +1,6 @@ +set(IDF_VER_DIR "idf_v${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}") + +idf_component_register(SRCS "smoke_test.c" + "${IDF_VER_DIR}/all_wifi_calls.c" + "${IDF_VER_DIR}/all_wifi_remote_calls.c" + INCLUDE_DIRS ".") diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_component.yml b/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_component.yml new file mode 100644 index 0000000..cb6183a --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_component.yml @@ -0,0 +1,8 @@ +## IDF Component Manager Manifest File +dependencies: + ## Required IDF version + idf: + version: '>=5.3' + espressif/esp_wifi_remote: + version: "*" + override_path: ../../.. diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_v5.3/all_wifi_calls.c b/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_v5.3/all_wifi_calls.c new file mode 100644 index 0000000..c6595ea --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_v5.3/all_wifi_calls.c @@ -0,0 +1,412 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +// This file is auto-generated +#include "esp_wifi.h" + +void run_all_wifi_apis(void) +{ + { + const wifi_init_config_t *config = NULL; + esp_wifi_init(config); + } + + { + esp_wifi_deinit(); + } + + { + wifi_mode_t mode = 0; + esp_wifi_set_mode(mode); + } + + { + wifi_mode_t *mode = NULL; + esp_wifi_get_mode(mode); + } + + { + esp_wifi_start(); + } + + { + esp_wifi_stop(); + } + + { + esp_wifi_restore(); + } + + { + esp_wifi_connect(); + } + + { + esp_wifi_disconnect(); + } + + { + esp_wifi_clear_fast_connect(); + } + + { + uint16_t aid = 0; + esp_wifi_deauth_sta(aid); + } + + { + const wifi_scan_config_t *config = NULL; + _Bool block = 0; + esp_wifi_scan_start(config, block); + } + + { + const wifi_scan_default_params_t *config = NULL; + esp_wifi_set_scan_parameters(config); + } + + { + wifi_scan_default_params_t *config = NULL; + esp_wifi_get_scan_parameters(config); + } + + { + esp_wifi_scan_stop(); + } + + { + uint16_t *number = NULL; + esp_wifi_scan_get_ap_num(number); + } + + { + uint16_t *number = NULL; + wifi_ap_record_t *ap_records = NULL; + esp_wifi_scan_get_ap_records(number, ap_records); + } + + { + wifi_ap_record_t *ap_record = NULL; + esp_wifi_scan_get_ap_record(ap_record); + } + + { + esp_wifi_clear_ap_list(); + } + + { + wifi_ap_record_t *ap_info = NULL; + esp_wifi_sta_get_ap_info(ap_info); + } + + { + wifi_ps_type_t type = 0; + esp_wifi_set_ps(type); + } + + { + wifi_ps_type_t *type = NULL; + esp_wifi_get_ps(type); + } + + { + wifi_interface_t ifx = 0; + uint8_t protocol_bitmap = 0; + esp_wifi_set_protocol(ifx, protocol_bitmap); + } + + { + wifi_interface_t ifx = 0; + uint8_t *protocol_bitmap = NULL; + esp_wifi_get_protocol(ifx, protocol_bitmap); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidth_t bw = 0; + esp_wifi_set_bandwidth(ifx, bw); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidth_t *bw = NULL; + esp_wifi_get_bandwidth(ifx, bw); + } + + { + uint8_t primary = 0; + wifi_second_chan_t second = 0; + esp_wifi_set_channel(primary, second); + } + + { + uint8_t *primary = NULL; + wifi_second_chan_t *second = NULL; + esp_wifi_get_channel(primary, second); + } + + { + const wifi_country_t *country = NULL; + esp_wifi_set_country(country); + } + + { + wifi_country_t *country = NULL; + esp_wifi_get_country(country); + } + + { + wifi_interface_t ifx = 0; + const uint8_t mac[6] = {}; + esp_wifi_set_mac(ifx, mac); + } + + { + wifi_interface_t ifx = 0; + uint8_t mac[6] = {}; + esp_wifi_get_mac(ifx, mac); + } + + { + wifi_promiscuous_cb_t cb = 0; + esp_wifi_set_promiscuous_rx_cb(cb); + } + + { + _Bool en = 0; + esp_wifi_set_promiscuous(en); + } + + { + _Bool *en = NULL; + esp_wifi_get_promiscuous(en); + } + + { + const wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_set_promiscuous_filter(filter); + } + + { + wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_get_promiscuous_filter(filter); + } + + { + const wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_set_promiscuous_ctrl_filter(filter); + } + + { + wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_get_promiscuous_ctrl_filter(filter); + } + + { + wifi_interface_t interface = 0; + wifi_config_t *conf = NULL; + esp_wifi_set_config(interface, conf); + } + + { + wifi_interface_t interface = 0; + wifi_config_t *conf = NULL; + esp_wifi_get_config(interface, conf); + } + + { + wifi_sta_list_t *sta = NULL; + esp_wifi_ap_get_sta_list(sta); + } + + { + const uint8_t mac[6] = {}; + uint16_t *aid = NULL; + esp_wifi_ap_get_sta_aid(mac, aid); + } + + { + wifi_storage_t storage = 0; + esp_wifi_set_storage(storage); + } + + { + _Bool enable = 0; + wifi_vendor_ie_type_t type = 0; + wifi_vendor_ie_id_t idx = 0; + const void *vnd_ie = NULL; + esp_wifi_set_vendor_ie(enable, type, idx, vnd_ie); + } + + { + esp_vendor_ie_cb_t cb = 0; + void *ctx = NULL; + esp_wifi_set_vendor_ie_cb(cb, ctx); + } + + { + int8_t power = 0; + esp_wifi_set_max_tx_power(power); + } + + { + int8_t *power = NULL; + esp_wifi_get_max_tx_power(power); + } + + { + uint32_t mask = 0; + esp_wifi_set_event_mask(mask); + } + + { + uint32_t *mask = NULL; + esp_wifi_get_event_mask(mask); + } + + { + wifi_interface_t ifx = 0; + const void *buffer = NULL; + int len = 0; + _Bool en_sys_seq = 0; + esp_wifi_80211_tx(ifx, buffer, len, en_sys_seq); + } + + { + wifi_csi_cb_t cb = 0; + void *ctx = NULL; + esp_wifi_set_csi_rx_cb(cb, ctx); + } + + { + const wifi_csi_config_t *config = NULL; + esp_wifi_set_csi_config(config); + } + + { + wifi_csi_config_t *config = NULL; + esp_wifi_get_csi_config(config); + } + + { + _Bool en = 0; + esp_wifi_set_csi(en); + } + + { + wifi_interface_t interface = 0; + esp_wifi_get_tsf_time(interface); + } + + { + wifi_interface_t ifx = 0; + uint16_t sec = 0; + esp_wifi_set_inactive_time(ifx, sec); + } + + { + wifi_interface_t ifx = 0; + uint16_t *sec = NULL; + esp_wifi_get_inactive_time(ifx, sec); + } + + { + uint32_t modules = 0; + esp_wifi_statis_dump(modules); + } + + { + int32_t rssi = 0; + esp_wifi_set_rssi_threshold(rssi); + } + + { + wifi_ftm_initiator_cfg_t *cfg = NULL; + esp_wifi_ftm_initiate_session(cfg); + } + + { + esp_wifi_ftm_end_session(); + } + + { + int16_t offset_cm = 0; + esp_wifi_ftm_resp_set_offset(offset_cm); + } + + { + wifi_ftm_report_entry_t *report = NULL; + uint8_t num_entries = 0; + esp_wifi_ftm_get_report(report, num_entries); + } + + { + wifi_interface_t ifx = 0; + _Bool disable = 0; + esp_wifi_config_11b_rate(ifx, disable); + } + + { + uint16_t wake_interval = 0; + esp_wifi_connectionless_module_set_wake_interval(wake_interval); + } + + { + esp_wifi_force_wakeup_acquire(); + } + + { + esp_wifi_force_wakeup_release(); + } + + { + const char *country = NULL; + _Bool ieee80211d_enabled = 0; + esp_wifi_set_country_code(country, ieee80211d_enabled); + } + + { + char *country = NULL; + esp_wifi_get_country_code(country); + } + + { + wifi_interface_t ifx = 0; + wifi_phy_rate_t rate = 0; + esp_wifi_config_80211_tx_rate(ifx, rate); + } + + { + wifi_interface_t ifx = 0; + wifi_tx_rate_config_t *config = NULL; + esp_wifi_config_80211_tx(ifx, config); + } + + { + wifi_interface_t ifx = 0; + esp_wifi_disable_pmf_config(ifx); + } + + { + uint16_t *aid = NULL; + esp_wifi_sta_get_aid(aid); + } + + { + wifi_phy_mode_t *phymode = NULL; + esp_wifi_sta_get_negotiated_phymode(phymode); + } + + { + _Bool enabled = 0; + esp_wifi_set_dynamic_cs(enabled); + } + + { + int *rssi = NULL; + esp_wifi_sta_get_rssi(rssi); + } + +} diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_v5.3/all_wifi_remote_calls.c b/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_v5.3/all_wifi_remote_calls.c new file mode 100644 index 0000000..bec423f --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_v5.3/all_wifi_remote_calls.c @@ -0,0 +1,412 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +// This file is auto-generated +#include "esp_wifi_remote.h" + +void run_all_wifi_remote_apis(void) +{ + { + const wifi_init_config_t *config = NULL; + esp_wifi_remote_init(config); + } + + { + esp_wifi_remote_deinit(); + } + + { + wifi_mode_t mode = 0; + esp_wifi_remote_set_mode(mode); + } + + { + wifi_mode_t *mode = NULL; + esp_wifi_remote_get_mode(mode); + } + + { + esp_wifi_remote_start(); + } + + { + esp_wifi_remote_stop(); + } + + { + esp_wifi_remote_restore(); + } + + { + esp_wifi_remote_connect(); + } + + { + esp_wifi_remote_disconnect(); + } + + { + esp_wifi_remote_clear_fast_connect(); + } + + { + uint16_t aid = 0; + esp_wifi_remote_deauth_sta(aid); + } + + { + const wifi_scan_config_t *config = NULL; + _Bool block = 0; + esp_wifi_remote_scan_start(config, block); + } + + { + const wifi_scan_default_params_t *config = NULL; + esp_wifi_remote_set_scan_parameters(config); + } + + { + wifi_scan_default_params_t *config = NULL; + esp_wifi_remote_get_scan_parameters(config); + } + + { + esp_wifi_remote_scan_stop(); + } + + { + uint16_t *number = NULL; + esp_wifi_remote_scan_get_ap_num(number); + } + + { + uint16_t *number = NULL; + wifi_ap_record_t *ap_records = NULL; + esp_wifi_remote_scan_get_ap_records(number, ap_records); + } + + { + wifi_ap_record_t *ap_record = NULL; + esp_wifi_remote_scan_get_ap_record(ap_record); + } + + { + esp_wifi_remote_clear_ap_list(); + } + + { + wifi_ap_record_t *ap_info = NULL; + esp_wifi_remote_sta_get_ap_info(ap_info); + } + + { + wifi_ps_type_t type = 0; + esp_wifi_remote_set_ps(type); + } + + { + wifi_ps_type_t *type = NULL; + esp_wifi_remote_get_ps(type); + } + + { + wifi_interface_t ifx = 0; + uint8_t protocol_bitmap = 0; + esp_wifi_remote_set_protocol(ifx, protocol_bitmap); + } + + { + wifi_interface_t ifx = 0; + uint8_t *protocol_bitmap = NULL; + esp_wifi_remote_get_protocol(ifx, protocol_bitmap); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidth_t bw = 0; + esp_wifi_remote_set_bandwidth(ifx, bw); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidth_t *bw = NULL; + esp_wifi_remote_get_bandwidth(ifx, bw); + } + + { + uint8_t primary = 0; + wifi_second_chan_t second = 0; + esp_wifi_remote_set_channel(primary, second); + } + + { + uint8_t *primary = NULL; + wifi_second_chan_t *second = NULL; + esp_wifi_remote_get_channel(primary, second); + } + + { + const wifi_country_t *country = NULL; + esp_wifi_remote_set_country(country); + } + + { + wifi_country_t *country = NULL; + esp_wifi_remote_get_country(country); + } + + { + wifi_interface_t ifx = 0; + const uint8_t mac[6] = {}; + esp_wifi_remote_set_mac(ifx, mac); + } + + { + wifi_interface_t ifx = 0; + uint8_t mac[6] = {}; + esp_wifi_remote_get_mac(ifx, mac); + } + + { + wifi_promiscuous_cb_t cb = 0; + esp_wifi_remote_set_promiscuous_rx_cb(cb); + } + + { + _Bool en = 0; + esp_wifi_remote_set_promiscuous(en); + } + + { + _Bool *en = NULL; + esp_wifi_remote_get_promiscuous(en); + } + + { + const wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_remote_set_promiscuous_filter(filter); + } + + { + wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_remote_get_promiscuous_filter(filter); + } + + { + const wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_remote_set_promiscuous_ctrl_filter(filter); + } + + { + wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_remote_get_promiscuous_ctrl_filter(filter); + } + + { + wifi_interface_t interface = 0; + wifi_config_t *conf = NULL; + esp_wifi_remote_set_config(interface, conf); + } + + { + wifi_interface_t interface = 0; + wifi_config_t *conf = NULL; + esp_wifi_remote_get_config(interface, conf); + } + + { + wifi_sta_list_t *sta = NULL; + esp_wifi_remote_ap_get_sta_list(sta); + } + + { + const uint8_t mac[6] = {}; + uint16_t *aid = NULL; + esp_wifi_remote_ap_get_sta_aid(mac, aid); + } + + { + wifi_storage_t storage = 0; + esp_wifi_remote_set_storage(storage); + } + + { + _Bool enable = 0; + wifi_vendor_ie_type_t type = 0; + wifi_vendor_ie_id_t idx = 0; + const void *vnd_ie = NULL; + esp_wifi_remote_set_vendor_ie(enable, type, idx, vnd_ie); + } + + { + esp_vendor_ie_cb_t cb = 0; + void *ctx = NULL; + esp_wifi_remote_set_vendor_ie_cb(cb, ctx); + } + + { + int8_t power = 0; + esp_wifi_remote_set_max_tx_power(power); + } + + { + int8_t *power = NULL; + esp_wifi_remote_get_max_tx_power(power); + } + + { + uint32_t mask = 0; + esp_wifi_remote_set_event_mask(mask); + } + + { + uint32_t *mask = NULL; + esp_wifi_remote_get_event_mask(mask); + } + + { + wifi_interface_t ifx = 0; + const void *buffer = NULL; + int len = 0; + _Bool en_sys_seq = 0; + esp_wifi_remote_80211_tx(ifx, buffer, len, en_sys_seq); + } + + { + wifi_csi_cb_t cb = 0; + void *ctx = NULL; + esp_wifi_remote_set_csi_rx_cb(cb, ctx); + } + + { + const wifi_csi_config_t *config = NULL; + esp_wifi_remote_set_csi_config(config); + } + + { + wifi_csi_config_t *config = NULL; + esp_wifi_remote_get_csi_config(config); + } + + { + _Bool en = 0; + esp_wifi_remote_set_csi(en); + } + + { + wifi_interface_t interface = 0; + esp_wifi_remote_get_tsf_time(interface); + } + + { + wifi_interface_t ifx = 0; + uint16_t sec = 0; + esp_wifi_remote_set_inactive_time(ifx, sec); + } + + { + wifi_interface_t ifx = 0; + uint16_t *sec = NULL; + esp_wifi_remote_get_inactive_time(ifx, sec); + } + + { + uint32_t modules = 0; + esp_wifi_remote_statis_dump(modules); + } + + { + int32_t rssi = 0; + esp_wifi_remote_set_rssi_threshold(rssi); + } + + { + wifi_ftm_initiator_cfg_t *cfg = NULL; + esp_wifi_remote_ftm_initiate_session(cfg); + } + + { + esp_wifi_remote_ftm_end_session(); + } + + { + int16_t offset_cm = 0; + esp_wifi_remote_ftm_resp_set_offset(offset_cm); + } + + { + wifi_ftm_report_entry_t *report = NULL; + uint8_t num_entries = 0; + esp_wifi_remote_ftm_get_report(report, num_entries); + } + + { + wifi_interface_t ifx = 0; + _Bool disable = 0; + esp_wifi_remote_config_11b_rate(ifx, disable); + } + + { + uint16_t wake_interval = 0; + esp_wifi_remote_connectionless_module_set_wake_interval(wake_interval); + } + + { + esp_wifi_remote_force_wakeup_acquire(); + } + + { + esp_wifi_remote_force_wakeup_release(); + } + + { + const char *country = NULL; + _Bool ieee80211d_enabled = 0; + esp_wifi_remote_set_country_code(country, ieee80211d_enabled); + } + + { + char *country = NULL; + esp_wifi_remote_get_country_code(country); + } + + { + wifi_interface_t ifx = 0; + wifi_phy_rate_t rate = 0; + esp_wifi_remote_config_80211_tx_rate(ifx, rate); + } + + { + wifi_interface_t ifx = 0; + wifi_tx_rate_config_t *config = NULL; + esp_wifi_remote_config_80211_tx(ifx, config); + } + + { + wifi_interface_t ifx = 0; + esp_wifi_remote_disable_pmf_config(ifx); + } + + { + uint16_t *aid = NULL; + esp_wifi_remote_sta_get_aid(aid); + } + + { + wifi_phy_mode_t *phymode = NULL; + esp_wifi_remote_sta_get_negotiated_phymode(phymode); + } + + { + _Bool enabled = 0; + esp_wifi_remote_set_dynamic_cs(enabled); + } + + { + int *rssi = NULL; + esp_wifi_remote_sta_get_rssi(rssi); + } + +} diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_v5.4/all_wifi_calls.c b/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_v5.4/all_wifi_calls.c new file mode 100644 index 0000000..2ee7287 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_v5.4/all_wifi_calls.c @@ -0,0 +1,456 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +// This file is auto-generated +#include "esp_wifi.h" + +void run_all_wifi_apis(void) +{ + { + const wifi_init_config_t *config = NULL; + esp_wifi_init(config); + } + + { + esp_wifi_deinit(); + } + + { + wifi_mode_t mode = 0; + esp_wifi_set_mode(mode); + } + + { + wifi_mode_t *mode = NULL; + esp_wifi_get_mode(mode); + } + + { + esp_wifi_start(); + } + + { + esp_wifi_stop(); + } + + { + esp_wifi_restore(); + } + + { + esp_wifi_connect(); + } + + { + esp_wifi_disconnect(); + } + + { + esp_wifi_clear_fast_connect(); + } + + { + uint16_t aid = 0; + esp_wifi_deauth_sta(aid); + } + + { + const wifi_scan_config_t *config = NULL; + _Bool block = 0; + esp_wifi_scan_start(config, block); + } + + { + const wifi_scan_default_params_t *config = NULL; + esp_wifi_set_scan_parameters(config); + } + + { + wifi_scan_default_params_t *config = NULL; + esp_wifi_get_scan_parameters(config); + } + + { + esp_wifi_scan_stop(); + } + + { + uint16_t *number = NULL; + esp_wifi_scan_get_ap_num(number); + } + + { + uint16_t *number = NULL; + wifi_ap_record_t *ap_records = NULL; + esp_wifi_scan_get_ap_records(number, ap_records); + } + + { + wifi_ap_record_t *ap_record = NULL; + esp_wifi_scan_get_ap_record(ap_record); + } + + { + esp_wifi_clear_ap_list(); + } + + { + wifi_ap_record_t *ap_info = NULL; + esp_wifi_sta_get_ap_info(ap_info); + } + + { + wifi_ps_type_t type = 0; + esp_wifi_set_ps(type); + } + + { + wifi_ps_type_t *type = NULL; + esp_wifi_get_ps(type); + } + + { + wifi_interface_t ifx = 0; + uint8_t protocol_bitmap = 0; + esp_wifi_set_protocol(ifx, protocol_bitmap); + } + + { + wifi_interface_t ifx = 0; + uint8_t *protocol_bitmap = NULL; + esp_wifi_get_protocol(ifx, protocol_bitmap); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidth_t bw = 0; + esp_wifi_set_bandwidth(ifx, bw); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidth_t *bw = NULL; + esp_wifi_get_bandwidth(ifx, bw); + } + + { + uint8_t primary = 0; + wifi_second_chan_t second = 0; + esp_wifi_set_channel(primary, second); + } + + { + uint8_t *primary = NULL; + wifi_second_chan_t *second = NULL; + esp_wifi_get_channel(primary, second); + } + + { + const wifi_country_t *country = NULL; + esp_wifi_set_country(country); + } + + { + wifi_country_t *country = NULL; + esp_wifi_get_country(country); + } + + { + wifi_interface_t ifx = 0; + const uint8_t mac[6] = {}; + esp_wifi_set_mac(ifx, mac); + } + + { + wifi_interface_t ifx = 0; + uint8_t mac[6] = {}; + esp_wifi_get_mac(ifx, mac); + } + + { + wifi_promiscuous_cb_t cb = 0; + esp_wifi_set_promiscuous_rx_cb(cb); + } + + { + _Bool en = 0; + esp_wifi_set_promiscuous(en); + } + + { + _Bool *en = NULL; + esp_wifi_get_promiscuous(en); + } + + { + const wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_set_promiscuous_filter(filter); + } + + { + wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_get_promiscuous_filter(filter); + } + + { + const wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_set_promiscuous_ctrl_filter(filter); + } + + { + wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_get_promiscuous_ctrl_filter(filter); + } + + { + wifi_interface_t interface = 0; + wifi_config_t *conf = NULL; + esp_wifi_set_config(interface, conf); + } + + { + wifi_interface_t interface = 0; + wifi_config_t *conf = NULL; + esp_wifi_get_config(interface, conf); + } + + { + wifi_sta_list_t *sta = NULL; + esp_wifi_ap_get_sta_list(sta); + } + + { + const uint8_t mac[6] = {}; + uint16_t *aid = NULL; + esp_wifi_ap_get_sta_aid(mac, aid); + } + + { + wifi_storage_t storage = 0; + esp_wifi_set_storage(storage); + } + + { + _Bool enable = 0; + wifi_vendor_ie_type_t type = 0; + wifi_vendor_ie_id_t idx = 0; + const void *vnd_ie = NULL; + esp_wifi_set_vendor_ie(enable, type, idx, vnd_ie); + } + + { + esp_vendor_ie_cb_t cb = 0; + void *ctx = NULL; + esp_wifi_set_vendor_ie_cb(cb, ctx); + } + + { + int8_t power = 0; + esp_wifi_set_max_tx_power(power); + } + + { + int8_t *power = NULL; + esp_wifi_get_max_tx_power(power); + } + + { + uint32_t mask = 0; + esp_wifi_set_event_mask(mask); + } + + { + uint32_t *mask = NULL; + esp_wifi_get_event_mask(mask); + } + + { + wifi_interface_t ifx = 0; + const void *buffer = NULL; + int len = 0; + _Bool en_sys_seq = 0; + esp_wifi_80211_tx(ifx, buffer, len, en_sys_seq); + } + + { + wifi_csi_cb_t cb = 0; + void *ctx = NULL; + esp_wifi_set_csi_rx_cb(cb, ctx); + } + + { + const wifi_csi_config_t *config = NULL; + esp_wifi_set_csi_config(config); + } + + { + wifi_csi_config_t *config = NULL; + esp_wifi_get_csi_config(config); + } + + { + _Bool en = 0; + esp_wifi_set_csi(en); + } + + { + wifi_interface_t interface = 0; + esp_wifi_get_tsf_time(interface); + } + + { + wifi_interface_t ifx = 0; + uint16_t sec = 0; + esp_wifi_set_inactive_time(ifx, sec); + } + + { + wifi_interface_t ifx = 0; + uint16_t *sec = NULL; + esp_wifi_get_inactive_time(ifx, sec); + } + + { + uint32_t modules = 0; + esp_wifi_statis_dump(modules); + } + + { + int32_t rssi = 0; + esp_wifi_set_rssi_threshold(rssi); + } + + { + wifi_ftm_initiator_cfg_t *cfg = NULL; + esp_wifi_ftm_initiate_session(cfg); + } + + { + esp_wifi_ftm_end_session(); + } + + { + int16_t offset_cm = 0; + esp_wifi_ftm_resp_set_offset(offset_cm); + } + + { + wifi_ftm_report_entry_t *report = NULL; + uint8_t num_entries = 0; + esp_wifi_ftm_get_report(report, num_entries); + } + + { + wifi_interface_t ifx = 0; + _Bool disable = 0; + esp_wifi_config_11b_rate(ifx, disable); + } + + { + uint16_t wake_interval = 0; + esp_wifi_connectionless_module_set_wake_interval(wake_interval); + } + + { + esp_wifi_force_wakeup_acquire(); + } + + { + esp_wifi_force_wakeup_release(); + } + + { + const char *country = NULL; + _Bool ieee80211d_enabled = 0; + esp_wifi_set_country_code(country, ieee80211d_enabled); + } + + { + char *country = NULL; + esp_wifi_get_country_code(country); + } + + { + wifi_interface_t ifx = 0; + wifi_phy_rate_t rate = 0; + esp_wifi_config_80211_tx_rate(ifx, rate); + } + + { + wifi_interface_t ifx = 0; + wifi_tx_rate_config_t *config = NULL; + esp_wifi_config_80211_tx(ifx, config); + } + + { + wifi_interface_t ifx = 0; + esp_wifi_disable_pmf_config(ifx); + } + + { + uint16_t *aid = NULL; + esp_wifi_sta_get_aid(aid); + } + + { + wifi_phy_mode_t *phymode = NULL; + esp_wifi_sta_get_negotiated_phymode(phymode); + } + + { + _Bool enabled = 0; + esp_wifi_set_dynamic_cs(enabled); + } + + { + int *rssi = NULL; + esp_wifi_sta_get_rssi(rssi); + } + + { + wifi_band_t band = 0; + esp_wifi_set_band(band); + } + + { + wifi_band_t *band = NULL; + esp_wifi_get_band(band); + } + + { + wifi_band_mode_t band_mode = 0; + esp_wifi_set_band_mode(band_mode); + } + + { + wifi_band_mode_t *band_mode = NULL; + esp_wifi_get_band_mode(band_mode); + } + + { + wifi_interface_t ifx = 0; + wifi_protocols_t *protocols = NULL; + esp_wifi_set_protocols(ifx, protocols); + } + + { + wifi_interface_t ifx = 0; + wifi_protocols_t *protocols = NULL; + esp_wifi_get_protocols(ifx, protocols); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidths_t *bw = NULL; + esp_wifi_set_bandwidths(ifx, bw); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidths_t *bw = NULL; + esp_wifi_get_bandwidths(ifx, bw); + } + +} diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_v5.4/all_wifi_remote_calls.c b/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_v5.4/all_wifi_remote_calls.c new file mode 100644 index 0000000..3cf8d9c --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_v5.4/all_wifi_remote_calls.c @@ -0,0 +1,456 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +// This file is auto-generated +#include "esp_wifi_remote.h" + +void run_all_wifi_remote_apis(void) +{ + { + const wifi_init_config_t *config = NULL; + esp_wifi_remote_init(config); + } + + { + esp_wifi_remote_deinit(); + } + + { + wifi_mode_t mode = 0; + esp_wifi_remote_set_mode(mode); + } + + { + wifi_mode_t *mode = NULL; + esp_wifi_remote_get_mode(mode); + } + + { + esp_wifi_remote_start(); + } + + { + esp_wifi_remote_stop(); + } + + { + esp_wifi_remote_restore(); + } + + { + esp_wifi_remote_connect(); + } + + { + esp_wifi_remote_disconnect(); + } + + { + esp_wifi_remote_clear_fast_connect(); + } + + { + uint16_t aid = 0; + esp_wifi_remote_deauth_sta(aid); + } + + { + const wifi_scan_config_t *config = NULL; + _Bool block = 0; + esp_wifi_remote_scan_start(config, block); + } + + { + const wifi_scan_default_params_t *config = NULL; + esp_wifi_remote_set_scan_parameters(config); + } + + { + wifi_scan_default_params_t *config = NULL; + esp_wifi_remote_get_scan_parameters(config); + } + + { + esp_wifi_remote_scan_stop(); + } + + { + uint16_t *number = NULL; + esp_wifi_remote_scan_get_ap_num(number); + } + + { + uint16_t *number = NULL; + wifi_ap_record_t *ap_records = NULL; + esp_wifi_remote_scan_get_ap_records(number, ap_records); + } + + { + wifi_ap_record_t *ap_record = NULL; + esp_wifi_remote_scan_get_ap_record(ap_record); + } + + { + esp_wifi_remote_clear_ap_list(); + } + + { + wifi_ap_record_t *ap_info = NULL; + esp_wifi_remote_sta_get_ap_info(ap_info); + } + + { + wifi_ps_type_t type = 0; + esp_wifi_remote_set_ps(type); + } + + { + wifi_ps_type_t *type = NULL; + esp_wifi_remote_get_ps(type); + } + + { + wifi_interface_t ifx = 0; + uint8_t protocol_bitmap = 0; + esp_wifi_remote_set_protocol(ifx, protocol_bitmap); + } + + { + wifi_interface_t ifx = 0; + uint8_t *protocol_bitmap = NULL; + esp_wifi_remote_get_protocol(ifx, protocol_bitmap); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidth_t bw = 0; + esp_wifi_remote_set_bandwidth(ifx, bw); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidth_t *bw = NULL; + esp_wifi_remote_get_bandwidth(ifx, bw); + } + + { + uint8_t primary = 0; + wifi_second_chan_t second = 0; + esp_wifi_remote_set_channel(primary, second); + } + + { + uint8_t *primary = NULL; + wifi_second_chan_t *second = NULL; + esp_wifi_remote_get_channel(primary, second); + } + + { + const wifi_country_t *country = NULL; + esp_wifi_remote_set_country(country); + } + + { + wifi_country_t *country = NULL; + esp_wifi_remote_get_country(country); + } + + { + wifi_interface_t ifx = 0; + const uint8_t mac[6] = {}; + esp_wifi_remote_set_mac(ifx, mac); + } + + { + wifi_interface_t ifx = 0; + uint8_t mac[6] = {}; + esp_wifi_remote_get_mac(ifx, mac); + } + + { + wifi_promiscuous_cb_t cb = 0; + esp_wifi_remote_set_promiscuous_rx_cb(cb); + } + + { + _Bool en = 0; + esp_wifi_remote_set_promiscuous(en); + } + + { + _Bool *en = NULL; + esp_wifi_remote_get_promiscuous(en); + } + + { + const wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_remote_set_promiscuous_filter(filter); + } + + { + wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_remote_get_promiscuous_filter(filter); + } + + { + const wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_remote_set_promiscuous_ctrl_filter(filter); + } + + { + wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_remote_get_promiscuous_ctrl_filter(filter); + } + + { + wifi_interface_t interface = 0; + wifi_config_t *conf = NULL; + esp_wifi_remote_set_config(interface, conf); + } + + { + wifi_interface_t interface = 0; + wifi_config_t *conf = NULL; + esp_wifi_remote_get_config(interface, conf); + } + + { + wifi_sta_list_t *sta = NULL; + esp_wifi_remote_ap_get_sta_list(sta); + } + + { + const uint8_t mac[6] = {}; + uint16_t *aid = NULL; + esp_wifi_remote_ap_get_sta_aid(mac, aid); + } + + { + wifi_storage_t storage = 0; + esp_wifi_remote_set_storage(storage); + } + + { + _Bool enable = 0; + wifi_vendor_ie_type_t type = 0; + wifi_vendor_ie_id_t idx = 0; + const void *vnd_ie = NULL; + esp_wifi_remote_set_vendor_ie(enable, type, idx, vnd_ie); + } + + { + esp_vendor_ie_cb_t cb = 0; + void *ctx = NULL; + esp_wifi_remote_set_vendor_ie_cb(cb, ctx); + } + + { + int8_t power = 0; + esp_wifi_remote_set_max_tx_power(power); + } + + { + int8_t *power = NULL; + esp_wifi_remote_get_max_tx_power(power); + } + + { + uint32_t mask = 0; + esp_wifi_remote_set_event_mask(mask); + } + + { + uint32_t *mask = NULL; + esp_wifi_remote_get_event_mask(mask); + } + + { + wifi_interface_t ifx = 0; + const void *buffer = NULL; + int len = 0; + _Bool en_sys_seq = 0; + esp_wifi_remote_80211_tx(ifx, buffer, len, en_sys_seq); + } + + { + wifi_csi_cb_t cb = 0; + void *ctx = NULL; + esp_wifi_remote_set_csi_rx_cb(cb, ctx); + } + + { + const wifi_csi_config_t *config = NULL; + esp_wifi_remote_set_csi_config(config); + } + + { + wifi_csi_config_t *config = NULL; + esp_wifi_remote_get_csi_config(config); + } + + { + _Bool en = 0; + esp_wifi_remote_set_csi(en); + } + + { + wifi_interface_t interface = 0; + esp_wifi_remote_get_tsf_time(interface); + } + + { + wifi_interface_t ifx = 0; + uint16_t sec = 0; + esp_wifi_remote_set_inactive_time(ifx, sec); + } + + { + wifi_interface_t ifx = 0; + uint16_t *sec = NULL; + esp_wifi_remote_get_inactive_time(ifx, sec); + } + + { + uint32_t modules = 0; + esp_wifi_remote_statis_dump(modules); + } + + { + int32_t rssi = 0; + esp_wifi_remote_set_rssi_threshold(rssi); + } + + { + wifi_ftm_initiator_cfg_t *cfg = NULL; + esp_wifi_remote_ftm_initiate_session(cfg); + } + + { + esp_wifi_remote_ftm_end_session(); + } + + { + int16_t offset_cm = 0; + esp_wifi_remote_ftm_resp_set_offset(offset_cm); + } + + { + wifi_ftm_report_entry_t *report = NULL; + uint8_t num_entries = 0; + esp_wifi_remote_ftm_get_report(report, num_entries); + } + + { + wifi_interface_t ifx = 0; + _Bool disable = 0; + esp_wifi_remote_config_11b_rate(ifx, disable); + } + + { + uint16_t wake_interval = 0; + esp_wifi_remote_connectionless_module_set_wake_interval(wake_interval); + } + + { + esp_wifi_remote_force_wakeup_acquire(); + } + + { + esp_wifi_remote_force_wakeup_release(); + } + + { + const char *country = NULL; + _Bool ieee80211d_enabled = 0; + esp_wifi_remote_set_country_code(country, ieee80211d_enabled); + } + + { + char *country = NULL; + esp_wifi_remote_get_country_code(country); + } + + { + wifi_interface_t ifx = 0; + wifi_phy_rate_t rate = 0; + esp_wifi_remote_config_80211_tx_rate(ifx, rate); + } + + { + wifi_interface_t ifx = 0; + wifi_tx_rate_config_t *config = NULL; + esp_wifi_remote_config_80211_tx(ifx, config); + } + + { + wifi_interface_t ifx = 0; + esp_wifi_remote_disable_pmf_config(ifx); + } + + { + uint16_t *aid = NULL; + esp_wifi_remote_sta_get_aid(aid); + } + + { + wifi_phy_mode_t *phymode = NULL; + esp_wifi_remote_sta_get_negotiated_phymode(phymode); + } + + { + _Bool enabled = 0; + esp_wifi_remote_set_dynamic_cs(enabled); + } + + { + int *rssi = NULL; + esp_wifi_remote_sta_get_rssi(rssi); + } + + { + wifi_band_t band = 0; + esp_wifi_remote_set_band(band); + } + + { + wifi_band_t *band = NULL; + esp_wifi_remote_get_band(band); + } + + { + wifi_band_mode_t band_mode = 0; + esp_wifi_remote_set_band_mode(band_mode); + } + + { + wifi_band_mode_t *band_mode = NULL; + esp_wifi_remote_get_band_mode(band_mode); + } + + { + wifi_interface_t ifx = 0; + wifi_protocols_t *protocols = NULL; + esp_wifi_remote_set_protocols(ifx, protocols); + } + + { + wifi_interface_t ifx = 0; + wifi_protocols_t *protocols = NULL; + esp_wifi_remote_get_protocols(ifx, protocols); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidths_t *bw = NULL; + esp_wifi_remote_set_bandwidths(ifx, bw); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidths_t *bw = NULL; + esp_wifi_remote_get_bandwidths(ifx, bw); + } + +} diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_v5.5/all_wifi_calls.c b/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_v5.5/all_wifi_calls.c new file mode 100644 index 0000000..7c3e58b --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_v5.5/all_wifi_calls.c @@ -0,0 +1,471 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +// This file is auto-generated +#include "esp_wifi.h" + +void run_all_wifi_apis(void) +{ + { + const wifi_init_config_t *config = NULL; + esp_wifi_init(config); + } + + { + esp_wifi_deinit(); + } + + { + wifi_mode_t mode = 0; + esp_wifi_set_mode(mode); + } + + { + wifi_mode_t *mode = NULL; + esp_wifi_get_mode(mode); + } + + { + esp_wifi_start(); + } + + { + esp_wifi_stop(); + } + + { + esp_wifi_restore(); + } + + { + esp_wifi_connect(); + } + + { + esp_wifi_disconnect(); + } + + { + esp_wifi_clear_fast_connect(); + } + + { + uint16_t aid = 0; + esp_wifi_deauth_sta(aid); + } + + { + const wifi_scan_config_t *config = NULL; + _Bool block = 0; + esp_wifi_scan_start(config, block); + } + + { + const wifi_scan_default_params_t *config = NULL; + esp_wifi_set_scan_parameters(config); + } + + { + wifi_scan_default_params_t *config = NULL; + esp_wifi_get_scan_parameters(config); + } + + { + esp_wifi_scan_stop(); + } + + { + uint16_t *number = NULL; + esp_wifi_scan_get_ap_num(number); + } + + { + uint16_t *number = NULL; + wifi_ap_record_t *ap_records = NULL; + esp_wifi_scan_get_ap_records(number, ap_records); + } + + { + wifi_ap_record_t *ap_record = NULL; + esp_wifi_scan_get_ap_record(ap_record); + } + + { + esp_wifi_clear_ap_list(); + } + + { + wifi_ap_record_t *ap_info = NULL; + esp_wifi_sta_get_ap_info(ap_info); + } + + { + wifi_ps_type_t type = 0; + esp_wifi_set_ps(type); + } + + { + wifi_ps_type_t *type = NULL; + esp_wifi_get_ps(type); + } + + { + wifi_interface_t ifx = 0; + uint8_t protocol_bitmap = 0; + esp_wifi_set_protocol(ifx, protocol_bitmap); + } + + { + wifi_interface_t ifx = 0; + uint8_t *protocol_bitmap = NULL; + esp_wifi_get_protocol(ifx, protocol_bitmap); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidth_t bw = 0; + esp_wifi_set_bandwidth(ifx, bw); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidth_t *bw = NULL; + esp_wifi_get_bandwidth(ifx, bw); + } + + { + uint8_t primary = 0; + wifi_second_chan_t second = 0; + esp_wifi_set_channel(primary, second); + } + + { + uint8_t *primary = NULL; + wifi_second_chan_t *second = NULL; + esp_wifi_get_channel(primary, second); + } + + { + const wifi_country_t *country = NULL; + esp_wifi_set_country(country); + } + + { + wifi_country_t *country = NULL; + esp_wifi_get_country(country); + } + + { + wifi_interface_t ifx = 0; + const uint8_t mac[6] = {}; + esp_wifi_set_mac(ifx, mac); + } + + { + wifi_interface_t ifx = 0; + uint8_t mac[6] = {}; + esp_wifi_get_mac(ifx, mac); + } + + { + wifi_promiscuous_cb_t cb = 0; + esp_wifi_set_promiscuous_rx_cb(cb); + } + + { + _Bool en = 0; + esp_wifi_set_promiscuous(en); + } + + { + _Bool *en = NULL; + esp_wifi_get_promiscuous(en); + } + + { + const wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_set_promiscuous_filter(filter); + } + + { + wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_get_promiscuous_filter(filter); + } + + { + const wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_set_promiscuous_ctrl_filter(filter); + } + + { + wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_get_promiscuous_ctrl_filter(filter); + } + + { + wifi_interface_t interface = 0; + wifi_config_t *conf = NULL; + esp_wifi_set_config(interface, conf); + } + + { + wifi_interface_t interface = 0; + wifi_config_t *conf = NULL; + esp_wifi_get_config(interface, conf); + } + + { + wifi_sta_list_t *sta = NULL; + esp_wifi_ap_get_sta_list(sta); + } + + { + const uint8_t mac[6] = {}; + uint16_t *aid = NULL; + esp_wifi_ap_get_sta_aid(mac, aid); + } + + { + wifi_storage_t storage = 0; + esp_wifi_set_storage(storage); + } + + { + _Bool enable = 0; + wifi_vendor_ie_type_t type = 0; + wifi_vendor_ie_id_t idx = 0; + const void *vnd_ie = NULL; + esp_wifi_set_vendor_ie(enable, type, idx, vnd_ie); + } + + { + esp_vendor_ie_cb_t cb = 0; + void *ctx = NULL; + esp_wifi_set_vendor_ie_cb(cb, ctx); + } + + { + int8_t power = 0; + esp_wifi_set_max_tx_power(power); + } + + { + int8_t *power = NULL; + esp_wifi_get_max_tx_power(power); + } + + { + uint32_t mask = 0; + esp_wifi_set_event_mask(mask); + } + + { + uint32_t *mask = NULL; + esp_wifi_get_event_mask(mask); + } + + { + wifi_interface_t ifx = 0; + const void *buffer = NULL; + int len = 0; + _Bool en_sys_seq = 0; + esp_wifi_80211_tx(ifx, buffer, len, en_sys_seq); + } + + { + esp_wifi_80211_tx_done_cb_t cb = 0; + esp_wifi_register_80211_tx_cb(cb); + } + + { + wifi_csi_cb_t cb = 0; + void *ctx = NULL; + esp_wifi_set_csi_rx_cb(cb, ctx); + } + + { + const wifi_csi_config_t *config = NULL; + esp_wifi_set_csi_config(config); + } + + { + wifi_csi_config_t *config = NULL; + esp_wifi_get_csi_config(config); + } + + { + _Bool en = 0; + esp_wifi_set_csi(en); + } + + { + wifi_interface_t interface = 0; + esp_wifi_get_tsf_time(interface); + } + + { + wifi_interface_t ifx = 0; + uint16_t sec = 0; + esp_wifi_set_inactive_time(ifx, sec); + } + + { + wifi_interface_t ifx = 0; + uint16_t *sec = NULL; + esp_wifi_get_inactive_time(ifx, sec); + } + + { + uint32_t modules = 0; + esp_wifi_statis_dump(modules); + } + + { + int32_t rssi = 0; + esp_wifi_set_rssi_threshold(rssi); + } + + { + wifi_ftm_initiator_cfg_t *cfg = NULL; + esp_wifi_ftm_initiate_session(cfg); + } + + { + esp_wifi_ftm_end_session(); + } + + { + int16_t offset_cm = 0; + esp_wifi_ftm_resp_set_offset(offset_cm); + } + + { + wifi_ftm_report_entry_t *report = NULL; + uint8_t num_entries = 0; + esp_wifi_ftm_get_report(report, num_entries); + } + + { + wifi_interface_t ifx = 0; + _Bool disable = 0; + esp_wifi_config_11b_rate(ifx, disable); + } + + { + uint16_t wake_interval = 0; + esp_wifi_connectionless_module_set_wake_interval(wake_interval); + } + + { + esp_wifi_force_wakeup_acquire(); + } + + { + esp_wifi_force_wakeup_release(); + } + + { + const char *country = NULL; + _Bool ieee80211d_enabled = 0; + esp_wifi_set_country_code(country, ieee80211d_enabled); + } + + { + char *country = NULL; + esp_wifi_get_country_code(country); + } + + { + wifi_interface_t ifx = 0; + wifi_phy_rate_t rate = 0; + esp_wifi_config_80211_tx_rate(ifx, rate); + } + + { + wifi_interface_t ifx = 0; + wifi_tx_rate_config_t *config = NULL; + esp_wifi_config_80211_tx(ifx, config); + } + + { + wifi_interface_t ifx = 0; + esp_wifi_disable_pmf_config(ifx); + } + + { + uint16_t *aid = NULL; + esp_wifi_sta_get_aid(aid); + } + + { + wifi_phy_mode_t *phymode = NULL; + esp_wifi_sta_get_negotiated_phymode(phymode); + } + + { + _Bool enabled = 0; + esp_wifi_set_dynamic_cs(enabled); + } + + { + int *rssi = NULL; + esp_wifi_sta_get_rssi(rssi); + } + + { + wifi_band_t band = 0; + esp_wifi_set_band(band); + } + + { + wifi_band_t *band = NULL; + esp_wifi_get_band(band); + } + + { + wifi_band_mode_t band_mode = 0; + esp_wifi_set_band_mode(band_mode); + } + + { + wifi_band_mode_t *band_mode = NULL; + esp_wifi_get_band_mode(band_mode); + } + + { + wifi_interface_t ifx = 0; + wifi_protocols_t *protocols = NULL; + esp_wifi_set_protocols(ifx, protocols); + } + + { + wifi_interface_t ifx = 0; + wifi_protocols_t *protocols = NULL; + esp_wifi_get_protocols(ifx, protocols); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidths_t *bw = NULL; + esp_wifi_set_bandwidths(ifx, bw); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidths_t *bw = NULL; + esp_wifi_get_bandwidths(ifx, bw); + } + + { + wifi_action_tx_req_t *req = NULL; + esp_wifi_action_tx_req(req); + } + + { + wifi_roc_req_t *req = NULL; + esp_wifi_remain_on_channel(req); + } + +} diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_v5.5/all_wifi_remote_calls.c b/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_v5.5/all_wifi_remote_calls.c new file mode 100644 index 0000000..900d11c --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/main/idf_v5.5/all_wifi_remote_calls.c @@ -0,0 +1,471 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +// This file is auto-generated +#include "esp_wifi_remote.h" + +void run_all_wifi_remote_apis(void) +{ + { + const wifi_init_config_t *config = NULL; + esp_wifi_remote_init(config); + } + + { + esp_wifi_remote_deinit(); + } + + { + wifi_mode_t mode = 0; + esp_wifi_remote_set_mode(mode); + } + + { + wifi_mode_t *mode = NULL; + esp_wifi_remote_get_mode(mode); + } + + { + esp_wifi_remote_start(); + } + + { + esp_wifi_remote_stop(); + } + + { + esp_wifi_remote_restore(); + } + + { + esp_wifi_remote_connect(); + } + + { + esp_wifi_remote_disconnect(); + } + + { + esp_wifi_remote_clear_fast_connect(); + } + + { + uint16_t aid = 0; + esp_wifi_remote_deauth_sta(aid); + } + + { + const wifi_scan_config_t *config = NULL; + _Bool block = 0; + esp_wifi_remote_scan_start(config, block); + } + + { + const wifi_scan_default_params_t *config = NULL; + esp_wifi_remote_set_scan_parameters(config); + } + + { + wifi_scan_default_params_t *config = NULL; + esp_wifi_remote_get_scan_parameters(config); + } + + { + esp_wifi_remote_scan_stop(); + } + + { + uint16_t *number = NULL; + esp_wifi_remote_scan_get_ap_num(number); + } + + { + uint16_t *number = NULL; + wifi_ap_record_t *ap_records = NULL; + esp_wifi_remote_scan_get_ap_records(number, ap_records); + } + + { + wifi_ap_record_t *ap_record = NULL; + esp_wifi_remote_scan_get_ap_record(ap_record); + } + + { + esp_wifi_remote_clear_ap_list(); + } + + { + wifi_ap_record_t *ap_info = NULL; + esp_wifi_remote_sta_get_ap_info(ap_info); + } + + { + wifi_ps_type_t type = 0; + esp_wifi_remote_set_ps(type); + } + + { + wifi_ps_type_t *type = NULL; + esp_wifi_remote_get_ps(type); + } + + { + wifi_interface_t ifx = 0; + uint8_t protocol_bitmap = 0; + esp_wifi_remote_set_protocol(ifx, protocol_bitmap); + } + + { + wifi_interface_t ifx = 0; + uint8_t *protocol_bitmap = NULL; + esp_wifi_remote_get_protocol(ifx, protocol_bitmap); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidth_t bw = 0; + esp_wifi_remote_set_bandwidth(ifx, bw); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidth_t *bw = NULL; + esp_wifi_remote_get_bandwidth(ifx, bw); + } + + { + uint8_t primary = 0; + wifi_second_chan_t second = 0; + esp_wifi_remote_set_channel(primary, second); + } + + { + uint8_t *primary = NULL; + wifi_second_chan_t *second = NULL; + esp_wifi_remote_get_channel(primary, second); + } + + { + const wifi_country_t *country = NULL; + esp_wifi_remote_set_country(country); + } + + { + wifi_country_t *country = NULL; + esp_wifi_remote_get_country(country); + } + + { + wifi_interface_t ifx = 0; + const uint8_t mac[6] = {}; + esp_wifi_remote_set_mac(ifx, mac); + } + + { + wifi_interface_t ifx = 0; + uint8_t mac[6] = {}; + esp_wifi_remote_get_mac(ifx, mac); + } + + { + wifi_promiscuous_cb_t cb = 0; + esp_wifi_remote_set_promiscuous_rx_cb(cb); + } + + { + _Bool en = 0; + esp_wifi_remote_set_promiscuous(en); + } + + { + _Bool *en = NULL; + esp_wifi_remote_get_promiscuous(en); + } + + { + const wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_remote_set_promiscuous_filter(filter); + } + + { + wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_remote_get_promiscuous_filter(filter); + } + + { + const wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_remote_set_promiscuous_ctrl_filter(filter); + } + + { + wifi_promiscuous_filter_t *filter = NULL; + esp_wifi_remote_get_promiscuous_ctrl_filter(filter); + } + + { + wifi_interface_t interface = 0; + wifi_config_t *conf = NULL; + esp_wifi_remote_set_config(interface, conf); + } + + { + wifi_interface_t interface = 0; + wifi_config_t *conf = NULL; + esp_wifi_remote_get_config(interface, conf); + } + + { + wifi_sta_list_t *sta = NULL; + esp_wifi_remote_ap_get_sta_list(sta); + } + + { + const uint8_t mac[6] = {}; + uint16_t *aid = NULL; + esp_wifi_remote_ap_get_sta_aid(mac, aid); + } + + { + wifi_storage_t storage = 0; + esp_wifi_remote_set_storage(storage); + } + + { + _Bool enable = 0; + wifi_vendor_ie_type_t type = 0; + wifi_vendor_ie_id_t idx = 0; + const void *vnd_ie = NULL; + esp_wifi_remote_set_vendor_ie(enable, type, idx, vnd_ie); + } + + { + esp_vendor_ie_cb_t cb = 0; + void *ctx = NULL; + esp_wifi_remote_set_vendor_ie_cb(cb, ctx); + } + + { + int8_t power = 0; + esp_wifi_remote_set_max_tx_power(power); + } + + { + int8_t *power = NULL; + esp_wifi_remote_get_max_tx_power(power); + } + + { + uint32_t mask = 0; + esp_wifi_remote_set_event_mask(mask); + } + + { + uint32_t *mask = NULL; + esp_wifi_remote_get_event_mask(mask); + } + + { + wifi_interface_t ifx = 0; + const void *buffer = NULL; + int len = 0; + _Bool en_sys_seq = 0; + esp_wifi_remote_80211_tx(ifx, buffer, len, en_sys_seq); + } + + { + esp_wifi_80211_tx_done_cb_t cb = 0; + esp_wifi_remote_register_80211_tx_cb(cb); + } + + { + wifi_csi_cb_t cb = 0; + void *ctx = NULL; + esp_wifi_remote_set_csi_rx_cb(cb, ctx); + } + + { + const wifi_csi_config_t *config = NULL; + esp_wifi_remote_set_csi_config(config); + } + + { + wifi_csi_config_t *config = NULL; + esp_wifi_remote_get_csi_config(config); + } + + { + _Bool en = 0; + esp_wifi_remote_set_csi(en); + } + + { + wifi_interface_t interface = 0; + esp_wifi_remote_get_tsf_time(interface); + } + + { + wifi_interface_t ifx = 0; + uint16_t sec = 0; + esp_wifi_remote_set_inactive_time(ifx, sec); + } + + { + wifi_interface_t ifx = 0; + uint16_t *sec = NULL; + esp_wifi_remote_get_inactive_time(ifx, sec); + } + + { + uint32_t modules = 0; + esp_wifi_remote_statis_dump(modules); + } + + { + int32_t rssi = 0; + esp_wifi_remote_set_rssi_threshold(rssi); + } + + { + wifi_ftm_initiator_cfg_t *cfg = NULL; + esp_wifi_remote_ftm_initiate_session(cfg); + } + + { + esp_wifi_remote_ftm_end_session(); + } + + { + int16_t offset_cm = 0; + esp_wifi_remote_ftm_resp_set_offset(offset_cm); + } + + { + wifi_ftm_report_entry_t *report = NULL; + uint8_t num_entries = 0; + esp_wifi_remote_ftm_get_report(report, num_entries); + } + + { + wifi_interface_t ifx = 0; + _Bool disable = 0; + esp_wifi_remote_config_11b_rate(ifx, disable); + } + + { + uint16_t wake_interval = 0; + esp_wifi_remote_connectionless_module_set_wake_interval(wake_interval); + } + + { + esp_wifi_remote_force_wakeup_acquire(); + } + + { + esp_wifi_remote_force_wakeup_release(); + } + + { + const char *country = NULL; + _Bool ieee80211d_enabled = 0; + esp_wifi_remote_set_country_code(country, ieee80211d_enabled); + } + + { + char *country = NULL; + esp_wifi_remote_get_country_code(country); + } + + { + wifi_interface_t ifx = 0; + wifi_phy_rate_t rate = 0; + esp_wifi_remote_config_80211_tx_rate(ifx, rate); + } + + { + wifi_interface_t ifx = 0; + wifi_tx_rate_config_t *config = NULL; + esp_wifi_remote_config_80211_tx(ifx, config); + } + + { + wifi_interface_t ifx = 0; + esp_wifi_remote_disable_pmf_config(ifx); + } + + { + uint16_t *aid = NULL; + esp_wifi_remote_sta_get_aid(aid); + } + + { + wifi_phy_mode_t *phymode = NULL; + esp_wifi_remote_sta_get_negotiated_phymode(phymode); + } + + { + _Bool enabled = 0; + esp_wifi_remote_set_dynamic_cs(enabled); + } + + { + int *rssi = NULL; + esp_wifi_remote_sta_get_rssi(rssi); + } + + { + wifi_band_t band = 0; + esp_wifi_remote_set_band(band); + } + + { + wifi_band_t *band = NULL; + esp_wifi_remote_get_band(band); + } + + { + wifi_band_mode_t band_mode = 0; + esp_wifi_remote_set_band_mode(band_mode); + } + + { + wifi_band_mode_t *band_mode = NULL; + esp_wifi_remote_get_band_mode(band_mode); + } + + { + wifi_interface_t ifx = 0; + wifi_protocols_t *protocols = NULL; + esp_wifi_remote_set_protocols(ifx, protocols); + } + + { + wifi_interface_t ifx = 0; + wifi_protocols_t *protocols = NULL; + esp_wifi_remote_get_protocols(ifx, protocols); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidths_t *bw = NULL; + esp_wifi_remote_set_bandwidths(ifx, bw); + } + + { + wifi_interface_t ifx = 0; + wifi_bandwidths_t *bw = NULL; + esp_wifi_remote_get_bandwidths(ifx, bw); + } + + { + wifi_action_tx_req_t *req = NULL; + esp_wifi_remote_action_tx_req(req); + } + + { + wifi_roc_req_t *req = NULL; + esp_wifi_remote_remain_on_channel(req); + } + +} diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/main/smoke_test.c b/resources/espressif__esp_wifi_remote/test/smoke_test/main/smoke_test.c new file mode 100644 index 0000000..c210497 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/main/smoke_test.c @@ -0,0 +1,24 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Unlicense OR CC0-1.0 + */ +#include +#include "esp_wifi_remote.h" + +void run_all_wifi_apis(void); +void run_all_wifi_remote_apis(void); + +void app_main(void) +{ + // manual init and deinit + wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); + esp_wifi_init(&cfg); + esp_wifi_deinit(); + +#if CONFIG_SOC_WIFI_SUPPORTED + run_all_wifi_remote_apis(); +#else + run_all_wifi_apis(); +#endif +} diff --git a/resources/espressif__esp_wifi_remote/test/smoke_test/sdkconfig.defaults b/resources/espressif__esp_wifi_remote/test/smoke_test/sdkconfig.defaults new file mode 100644 index 0000000..25ec8b5 --- /dev/null +++ b/resources/espressif__esp_wifi_remote/test/smoke_test/sdkconfig.defaults @@ -0,0 +1 @@ +CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED=y diff --git a/sdkconfig.defaults b/sdkconfig.defaults index 765cffb..b0cee8e 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -127,6 +127,8 @@ CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 CONFIG_BT_NIMBLE_MSYS_BUF_FROM_HEAP=n CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT=n +CONFIG_NIMBLE_CPP_LOG_LEVEL=0 +CONFIG_BT_NIMBLE_LOG_LEVEL=0 # LWIP CONFIG_LWIP_MAX_SOCKETS=24 diff --git a/sdkconfig.defaults.esp32-p4 b/sdkconfig.defaults.esp32-p4 index c6dcc6b..3f14f4b 100644 --- a/sdkconfig.defaults.esp32-p4 +++ b/sdkconfig.defaults.esp32-p4 @@ -18,6 +18,7 @@ CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP_WIFI_TX_BA_WIN=32 CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP_WIFI_RX_BA_WIN=32 + CONFIG_ESP_WIFI_REMOTE_ENABLED=y CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED=y CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=7 @@ -27,11 +28,12 @@ CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=16 CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=32 CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 -CONFIG_ESP_HCI_VHCI=y -CONFIG_BT_CONTROLLER_DISABLED=y +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y CONFIG_BT_BLUEDROID_ENABLED=n CONFIG_BT_NIMBLE_TRANSPORT_UART=n -CONFIG_ESP_ENABLE_BT=y -CONFIG_BT_NIMBLE_ENABLED=y +CONFIG_BT_CONTROLLER_DISABLED=y +CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE=y CONFIG_ESP_HOSTED_ENABLE_BT_NIMBLE=y +CONFIG_ESP_HOSTED_NIMBLE_HCI_VHCI=y CONFIG_SLAVE_IDF_TARGET_ESP32C6=y \ No newline at end of file diff --git a/src/Config.h b/src/Config.h index ada776e..76ce67c 100644 --- a/src/Config.h +++ b/src/Config.h @@ -5,7 +5,7 @@ #define NUKI_HUB_VERSION "9.11" #define NUKI_HUB_VERSION_INT (uint32_t)911 #define NUKI_HUB_BUILD "unknownbuildnr" -#define NUKI_HUB_DATE "2025-06-09" +#define NUKI_HUB_DATE "2025-06-10" #define GITHUB_LATEST_RELEASE_URL (char*)"https://github.com/technyon/nuki_hub/releases/latest" #define GITHUB_OTA_MANIFEST_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/manifest.json" diff --git a/src/idf_component.yml b/src/idf_component.yml index 1a2fff3..e27c608 100644 --- a/src/idf_component.yml +++ b/src/idf_component.yml @@ -12,8 +12,10 @@ dependencies: version: "*" rules: - if: "target in [esp32p4]" + espressif/esp_wifi_remote: version: "*" + override_path: '../resources/espressif__esp_wifi_remote/' rules: - if: "target in [esp32p4]" diff --git a/updater/platformio.ini b/updater/platformio.ini index fdb81f0..91d86bd 100644 --- a/updater/platformio.ini +++ b/updater/platformio.ini @@ -113,15 +113,6 @@ board_build.cmake_extra_args = build_flags = ${env.build_flags} -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE - -DCONFIG_NIMBLE_CPP_LOG_LEVEL=0 - -DCONFIG_BT_NIMBLE_LOG_LEVEL=0 - -DCONFIG_WIFI_RMT_ESPNOW_MAX_ENCRYPT_NUM=7 - -DCONFIG_WIFI_RMT_CACHE_TX_BUFFER_NUM=32 - -DCONFIG_WIFI_RMT_TX_BUFFER_TYPE=0 - -DCONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=16 - -DCONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=32 - -DCONFIG_WIFI_RMT_DYNAMIC_RX_MGMT_BUF=0 - -DCONFIG_WIFI_RMT_SOFTAP_SUPPORT=y [env:updater_esp32-h2] extends = env:updater_esp32 diff --git a/updater/sdkconfig.defaults b/updater/sdkconfig.defaults index c9a90e4..43b663e 100644 --- a/updater/sdkconfig.defaults +++ b/updater/sdkconfig.defaults @@ -56,4 +56,6 @@ CONFIG_BOOTLOADER_WDT_TIME_MS=120000 CONFIG_LWIP_MAX_SOCKETS=24 CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=1024 -CONFIG_ARDUINO_LOOP_STACK_SIZE=12288 \ No newline at end of file +CONFIG_ARDUINO_LOOP_STACK_SIZE=12288 +CONFIG_NIMBLE_CPP_LOG_LEVEL=0 +CONFIG_BT_NIMBLE_LOG_LEVEL=0 \ No newline at end of file diff --git a/updater/sdkconfig.defaults.esp32-p4 b/updater/sdkconfig.defaults.esp32-p4 index 958ef78..3f14f4b 100644 --- a/updater/sdkconfig.defaults.esp32-p4 +++ b/updater/sdkconfig.defaults.esp32-p4 @@ -2,7 +2,6 @@ CONFIG_SPIRAM=y CONFIG_SPIRAM_IGNORE_NOTFOUND=y CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC=y CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_DEFAULT=y - CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=50768 CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 @@ -29,11 +28,12 @@ CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=16 CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=32 CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 -CONFIG_ESP_HCI_VHCI=y -CONFIG_BT_CONTROLLER_DISABLED=y +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y CONFIG_BT_BLUEDROID_ENABLED=n CONFIG_BT_NIMBLE_TRANSPORT_UART=n -CONFIG_ESP_ENABLE_BT=y -CONFIG_BT_NIMBLE_ENABLED=y +CONFIG_BT_CONTROLLER_DISABLED=y +CONFIG_ESP_HOSTED_SDIO_HOST_INTERFACE=y CONFIG_ESP_HOSTED_ENABLE_BT_NIMBLE=y +CONFIG_ESP_HOSTED_NIMBLE_HCI_VHCI=y CONFIG_SLAVE_IDF_TARGET_ESP32C6=y \ No newline at end of file diff --git a/updater/src/idf_component.yml b/updater/src/idf_component.yml index 737cd20..2bf3442 100644 --- a/updater/src/idf_component.yml +++ b/updater/src/idf_component.yml @@ -9,6 +9,7 @@ dependencies: espressif/esp_wifi_remote: version: "*" + override_path: '../../resources/espressif__esp_wifi_remote/' rules: - if: "target in [esp32p4]"