mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
feat(wifi-remote): Add support for wifi-remote to esp_wifi
This commit is contained in:
@@ -1,2 +1,43 @@
|
||||
# CMakeLists.txt remote functionality for esp_wifi component
|
||||
return()
|
||||
target_include_directories(${COMPONENT_LIB} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
|
||||
if(NOT CONFIG_ESP_WIFI_ENABLED AND NOT CONFIG_ESP_HOST_WIFI_ENABLED)
|
||||
set(wifi_remote_sources esp_wifi_remote.c esp_wifi_remote_net.c)
|
||||
target_include_directories(${COMPONENT_LIB} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/injected)
|
||||
set(wifi_remote_sources esp_wifi_remote.c esp_wifi_remote_net.c)
|
||||
|
||||
set(src_wifi_with_remote ${CMAKE_CURRENT_SOURCE_DIR}/esp_wifi_with_remote.c)
|
||||
if(CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED)
|
||||
list(APPEND src_wifi_with_remote ${CMAKE_CURRENT_SOURCE_DIR}/esp_eap_client_with_remote.c)
|
||||
endif()
|
||||
get_target_property(wifi_sources ${COMPONENT_LIB} SOURCES)
|
||||
# set_target_properties(${COMPONENT_LIB} PROPERTIES SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/dummy_src.c")
|
||||
|
||||
# Update wifi include directories to prepend the injected dir with modified headers supporting SLAVE capability
|
||||
get_target_property(original_wifi_dirs ${COMPONENT_LIB} INTERFACE_INCLUDE_DIRECTORIES)
|
||||
set(updated_wifi_dirs "${CMAKE_CURRENT_SOURCE_DIR}/include/injected" ${original_wifi_dirs})
|
||||
set_target_properties(${COMPONENT_LIB} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${updated_wifi_dirs}")
|
||||
else()
|
||||
set(wifi_remote_sources esp_wifi_remote_net2.c)
|
||||
endif()
|
||||
|
||||
# Add weak symbol for the wifi_remote API if we're using esp_hosted implementation
|
||||
if(CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED)
|
||||
set(src_wifi_remote_weak ${CMAKE_CURRENT_SOURCE_DIR}/esp_wifi_remote_weak.c)
|
||||
if(CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED)
|
||||
list(APPEND src_wifi_remote_weak ${CMAKE_CURRENT_SOURCE_DIR}/esp_eap_client_remote_weak.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_sources(${COMPONENT_LIB} PRIVATE ${src_wifi_remote_weak}
|
||||
${src_wifi_with_remote}
|
||||
${wifi_remote_sources}
|
||||
${wifi_sources})
|
||||
|
||||
if(CONFIG_ESP_WIFI_REMOTE_EAP_ENABLED)
|
||||
idf_component_optional_requires(PRIVATE wpa_supplicant)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ESP_WIFI_REMOTE_LIBRARY_EPPP)
|
||||
idf_component_optional_requires(PRIVATE wifi_remote_over_eppp espressif__wifi_remote_over_eppp)
|
||||
endif()
|
||||
|
||||
@@ -1 +1,50 @@
|
||||
# Configuration of remote functionality for esp_wifi component
|
||||
menu "Wi-Fi Remote"
|
||||
|
||||
config ESP_WIFI_REMOTE_IN_IDF
|
||||
bool
|
||||
default y
|
||||
|
||||
config ESP_WIFI_REMOTE_ENABLED # ignore: multiple-definition
|
||||
bool
|
||||
default y if !ESP_HOST_WIFI_ENABLED
|
||||
default n if ESP_HOST_WIFI_ENABLED
|
||||
|
||||
if ESP_WIFI_REMOTE_ENABLED
|
||||
rsource "./Kconfig.slave_select.in"
|
||||
rsource "./Kconfig.soc_wifi_caps.in"
|
||||
|
||||
menu "Wi-Fi configuration"
|
||||
rsource "./Kconfig.wifi.in"
|
||||
endmenu
|
||||
|
||||
orsource "./Kconfig.rpc.in"
|
||||
|
||||
config ESP_WIFI_REMOTE_EAP_ENABLED
|
||||
bool "Enable EAP client remote API"
|
||||
default y
|
||||
depends on WIFI_RMT_ENTERPRISE_SUPPORT
|
||||
help
|
||||
When enabled, the EAP client remote API will be available.
|
||||
This allows remote control of EAP authentication functions.
|
||||
|
||||
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
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
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 possible to use EPPP, which uses PPPoS link between micros and NAPT,
|
||||
so it's slower, but allows for more customization on the slave side.
|
||||
It's also possible to select CUSTOM and provide wifi_remote implementation
|
||||
in any other component or application (needs to set link dependency from wifi-remote
|
||||
to the custom implementation)
|
||||
|
||||
config ESP_WIFI_REMOTE_LIBRARY_HOSTED
|
||||
bool "ESP-HOSTED"
|
||||
config ESP_WIFI_REMOTE_LIBRARY_EPPP
|
||||
bool "EPPP"
|
||||
config ESP_WIFI_REMOTE_LIBRARY_CUSTOM
|
||||
bool "CUSTOM"
|
||||
|
||||
endchoice
|
||||
@@ -0,0 +1,23 @@
|
||||
# This file is auto-generated
|
||||
choice SLAVE_IDF_TARGET
|
||||
prompt "choose slave target"
|
||||
default SLAVE_IDF_TARGET_ESP32C6 if IDF_TARGET_ESP32P4 # To support common use-cases
|
||||
default SLAVE_IDF_TARGET_ESP32
|
||||
|
||||
config SLAVE_IDF_TARGET_ESP32
|
||||
bool "esp32"
|
||||
config SLAVE_IDF_TARGET_ESP32S2
|
||||
bool "esp32s2"
|
||||
config SLAVE_IDF_TARGET_ESP32C3
|
||||
bool "esp32c3"
|
||||
config SLAVE_IDF_TARGET_ESP32S3
|
||||
bool "esp32s3"
|
||||
config SLAVE_IDF_TARGET_ESP32C2
|
||||
bool "esp32c2"
|
||||
config SLAVE_IDF_TARGET_ESP32C6
|
||||
bool "esp32c6"
|
||||
config SLAVE_IDF_TARGET_ESP32C5
|
||||
bool "esp32c5"
|
||||
config SLAVE_IDF_TARGET_ESP32C61
|
||||
bool "esp32c61"
|
||||
endchoice
|
||||
@@ -0,0 +1,409 @@
|
||||
# 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_TXOP_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_TXOP_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_TXOP_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_TXOP_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 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_TXOP_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 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_TXOP_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
|
||||
@@ -0,0 +1,866 @@
|
||||
# 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_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_ENABLE_SAE_PK
|
||||
bool "Enable SAE-PK"
|
||||
default y
|
||||
depends on WIFI_RMT_ENABLE_SAE_H2E
|
||||
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_WPA3_COMPATIBLE_SUPPORT
|
||||
bool "Enable WPA3 Compatible support"
|
||||
default y
|
||||
depends on WIFI_RMT_ENABLE_SAE_H2E
|
||||
help
|
||||
Select this option to support wpa3_compatible mode for station and AP
|
||||
|
||||
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
|
||||
select WIFI_RMT_PHY_IRAM_OPT
|
||||
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_SYNC_ENABLE
|
||||
bool "Enable Wi-Fi Aware: Synchronization (NAN-Sync)"
|
||||
default n
|
||||
depends on SLAVE_SOC_WIFI_NAN_SUPPORT
|
||||
select LWIP_IPV6
|
||||
help
|
||||
Enable Wi-Fi Aware: Synchronization feature (NAN-Sync).
|
||||
|
||||
config WIFI_RMT_NAN_USD_ENABLE
|
||||
bool "Enable Wi-Fi Aware: Unsynchronized service discovery (NAN-USD)"
|
||||
depends on IDF_EXPERIMENTAL_FEATURES
|
||||
default n
|
||||
help
|
||||
Enable Wi-Fi Aware: Unsynchronized service discovery (NAN-USD)
|
||||
|
||||
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 WIFI_RMT_ENTERPRISE_SUPPORT
|
||||
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.
|
||||
|
||||
config WIFI_RMT_WPS_RECONNECT_ON_FAIL
|
||||
bool "Reconnect to previous SSID if WPS failed"
|
||||
default n
|
||||
help
|
||||
Select this option to enable reconnection to previous SSID if WPS fails.
|
||||
This option will only work if station was connected to a network
|
||||
when WPS was started.
|
||||
|
||||
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_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.
|
||||
|
||||
config WIFI_RMT_MODEM_RF_FLAG_UPDATE_DEBUG
|
||||
bool "Enable debug assertions for modem RF flag update"
|
||||
depends on WIFI_RMT_ENHANCED_LIGHT_SLEEP
|
||||
default n
|
||||
help
|
||||
Enable debug assertions to verify modem RF flag update operations.
|
||||
This option enables assert checks to verify that modem RF power state
|
||||
is correctly cleared before pmu sleep.
|
||||
|
||||
if !ESP_WIFI_ENABLED
|
||||
rsource "Kconfig.wifi_is_remote.in"
|
||||
endif # ESP_WIFI_ENABLED
|
||||
# Wi-Fi configuration end
|
||||
@@ -0,0 +1,482 @@
|
||||
# This file is auto-generated
|
||||
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_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_ENABLE_SAE_PK
|
||||
config ESP_WIFI_ENABLE_SAE_PK # ignore: multiple-definition
|
||||
bool
|
||||
depends on WIFI_RMT_ENABLE_SAE_H2E
|
||||
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_WPA3_COMPATIBLE_SUPPORT
|
||||
config ESP_WIFI_WPA3_COMPATIBLE_SUPPORT # ignore: multiple-definition
|
||||
bool
|
||||
depends on WIFI_RMT_ENABLE_SAE_H2E
|
||||
default WIFI_RMT_WPA3_COMPATIBLE_SUPPORT
|
||||
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_SYNC_ENABLE
|
||||
config ESP_WIFI_NAN_SYNC_ENABLE # ignore: multiple-definition
|
||||
bool
|
||||
depends on SLAVE_SOC_WIFI_NAN_SUPPORT
|
||||
default WIFI_RMT_NAN_SYNC_ENABLE
|
||||
endif
|
||||
|
||||
if WIFI_RMT_NAN_USD_ENABLE
|
||||
config ESP_WIFI_NAN_USD_ENABLE # ignore: multiple-definition
|
||||
bool
|
||||
depends on IDF_EXPERIMENTAL_FEATURES
|
||||
default WIFI_RMT_NAN_USD_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_WPS_RECONNECT_ON_FAIL
|
||||
config ESP_WIFI_WPS_RECONNECT_ON_FAIL # ignore: multiple-definition
|
||||
bool
|
||||
default WIFI_RMT_WPS_RECONNECT_ON_FAIL
|
||||
endif
|
||||
|
||||
if WIFI_RMT_DEBUG_PRINT
|
||||
config ESP_WIFI_DEBUG_PRINT # ignore: multiple-definition
|
||||
bool
|
||||
default WIFI_RMT_DEBUG_PRINT
|
||||
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
|
||||
|
||||
if WIFI_RMT_MODEM_RF_FLAG_UPDATE_DEBUG
|
||||
config ESP_WIFI_MODEM_RF_FLAG_UPDATE_DEBUG # ignore: multiple-definition
|
||||
bool
|
||||
depends on WIFI_RMT_ENHANCED_LIGHT_SLEEP
|
||||
default WIFI_RMT_MODEM_RF_FLAG_UPDATE_DEBUG
|
||||
endif
|
||||
@@ -1,3 +1,17 @@
|
||||
Placeholder for "remote" functionality of esp_wifi component.
|
||||
# esp_wifi (remote)
|
||||
|
||||
This functionality is currently provided by a standalone component "esp_wifi_remote" -- an external component developed in https://github.com/espressif/esp-wifi-remote repository
|
||||
The `esp_wifi_remote` component provides transparent WiFi connectivity for ESP chips through external WiFi hardware while keeping the public `esp_wifi` API compatible. It routes `esp_wifi` calls from a host device to a WiFi-capable slave via RPC, enabling WiFi on chips without native WiFi or adding a second WiFi interface alongside local `esp_wifi`.
|
||||
|
||||
Remote connectivity is provided by backend solutions such as `esp_hosted`, `wifi_remote_over_eppp`, and `wifi_remote_over_at`.
|
||||
|
||||
## Directory Structure and Auto-Generation
|
||||
|
||||
The `esp_wifi_remote` component relies heavily on auto-generated code to maintain synchronization with the native `esp_wifi` API. The generation is handled by `scripts/generate_and_check.py`, which parses the original `esp_wifi` headers and produces the necessary remote wrappers, mocked C implementations, and Kconfig files.
|
||||
|
||||
### Key Directories and Files
|
||||
|
||||
* **`include/`**: Contains the generated header files defining the remote API (e.g., `esp_wifi_remote_api.h`, `esp_eap_client_remote_api.h`).
|
||||
* **`include/injected/`**: Contains modified copies of the native ESP-IDF headers (like `esp_wifi.h`, `esp_mesh.h`, `esp_now.h`). The generator script copies these from the native `esp_wifi/include` directory and "injects" changes into them—specifically replacing native Kconfig macros (e.g., `CONFIG_ESP_WIFI_`, `CONFIG_SOC_WIFI_`) with remote-specific macros (e.g., `CONFIG_WIFI_RMT_`, `CONFIG_SLAVE_SOC_WIFI_`). This allows the remote component to reuse the native data structures while relying on different Kconfig selections corresponding to the slave device.
|
||||
* **`scripts/generate_and_check.py`**: The core Python script responsible for generating the remote wrappers, injected headers, Kconfig mappings, and default implementations. This script is run as part of the CI pipeline (`check_wif_remote_api` job) to ensure the generated files are always up-to-date with any changes to the native WiFi API.
|
||||
* **`esp_wifi_remote_weak.c` & `esp_eap_client_remote_weak.c`**: Auto-generated C files containing weakly linked default implementations for the remote APIs. By default, these functions log a warning and return an unsupported error (`ESP_ERR_NOT_SUPPORTED`). Backend solutions (like `esp_hosted`) provide the actual strong implementations for these functions to route the calls over RPC.
|
||||
* **`Kconfig.*.in`**: Template Kconfig files used by the generator script. They bridge standard Wi-Fi configuration selections to the slave targets, enabling the host to configure the remote WiFi hardware seamlessly
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
// This file is auto-generated
|
||||
#include "esp_eap_client_remote_api.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
#define WEAK __attribute__((weak))
|
||||
#define LOG_UNSUPPORTED_AND_RETURN(ret) ESP_LOGW("esp_eap_client_remote_weak", "%s unsupported", __func__); \
|
||||
return ret;
|
||||
#define LOG_UNSUPPORTED_VOID() ESP_LOGW("esp_eap_client_remote_weak", "%s unsupported", __func__);
|
||||
|
||||
WEAK esp_err_t esp_wifi_remote_sta_enterprise_enable(void)
|
||||
{
|
||||
LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
WEAK esp_err_t esp_wifi_remote_sta_enterprise_disable(void)
|
||||
{
|
||||
LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
WEAK esp_err_t esp_eap_client_remote_set_identity(const unsigned char *identity, int len)
|
||||
{
|
||||
LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
WEAK void esp_eap_client_remote_clear_identity(void)
|
||||
{
|
||||
LOG_UNSUPPORTED_VOID();
|
||||
}
|
||||
|
||||
WEAK esp_err_t esp_eap_client_remote_set_username(const unsigned char *username, int len)
|
||||
{
|
||||
LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
WEAK void esp_eap_client_remote_clear_username(void)
|
||||
{
|
||||
LOG_UNSUPPORTED_VOID();
|
||||
}
|
||||
|
||||
WEAK esp_err_t esp_eap_client_remote_set_password(const unsigned char *password, int len)
|
||||
{
|
||||
LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
WEAK void esp_eap_client_remote_clear_password(void)
|
||||
{
|
||||
LOG_UNSUPPORTED_VOID();
|
||||
}
|
||||
|
||||
WEAK esp_err_t esp_eap_client_remote_set_new_password(const unsigned char *new_password, int len)
|
||||
{
|
||||
LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
WEAK void esp_eap_client_remote_clear_new_password(void)
|
||||
{
|
||||
LOG_UNSUPPORTED_VOID();
|
||||
}
|
||||
|
||||
WEAK esp_err_t esp_eap_client_remote_set_ca_cert(const unsigned char *ca_cert, int ca_cert_len)
|
||||
{
|
||||
LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
WEAK void esp_eap_client_remote_clear_ca_cert(void)
|
||||
{
|
||||
LOG_UNSUPPORTED_VOID();
|
||||
}
|
||||
|
||||
WEAK esp_err_t esp_eap_client_remote_set_certificate_and_key(const unsigned char *client_cert, int client_cert_len, const unsigned char *private_key, int private_key_len, const unsigned char *private_key_password, int private_key_passwd_len)
|
||||
{
|
||||
LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
WEAK void esp_eap_client_remote_clear_certificate_and_key(void)
|
||||
{
|
||||
LOG_UNSUPPORTED_VOID();
|
||||
}
|
||||
|
||||
WEAK esp_err_t esp_eap_client_remote_set_disable_time_check(_Bool disable)
|
||||
{
|
||||
LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
WEAK esp_err_t esp_eap_client_remote_get_disable_time_check(_Bool *disable)
|
||||
{
|
||||
LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
WEAK esp_err_t esp_eap_client_remote_set_ttls_phase2_method(esp_eap_ttls_phase2_types type)
|
||||
{
|
||||
LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
WEAK esp_err_t esp_eap_client_remote_set_suiteb_192bit_certification(_Bool enable)
|
||||
{
|
||||
LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
WEAK esp_err_t esp_eap_client_remote_set_pac_file(const unsigned char *pac_file, int pac_file_len)
|
||||
{
|
||||
LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
WEAK esp_err_t esp_eap_client_remote_set_fast_params(esp_eap_fast_config config)
|
||||
{
|
||||
LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
WEAK esp_err_t esp_eap_client_remote_use_default_cert_bundle(_Bool use_default_bundle)
|
||||
{
|
||||
LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
WEAK void esp_wifi_remote_set_okc_support(_Bool enable)
|
||||
{
|
||||
LOG_UNSUPPORTED_VOID();
|
||||
}
|
||||
|
||||
WEAK esp_err_t esp_eap_client_remote_set_domain_name(const char *domain_name)
|
||||
{
|
||||
LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
WEAK esp_err_t esp_eap_client_remote_set_eap_methods(esp_eap_method_t methods)
|
||||
{
|
||||
LOG_UNSUPPORTED_AND_RETURN(ESP_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
// This file is auto-generated
|
||||
#include "esp_eap_client.h"
|
||||
#include "esp_eap_client_remote_api.h"
|
||||
|
||||
esp_err_t esp_wifi_sta_enterprise_enable(void)
|
||||
{
|
||||
return esp_wifi_remote_sta_enterprise_enable();
|
||||
}
|
||||
|
||||
esp_err_t esp_wifi_sta_enterprise_disable(void)
|
||||
{
|
||||
return esp_wifi_remote_sta_enterprise_disable();
|
||||
}
|
||||
|
||||
esp_err_t esp_eap_client_set_identity(const unsigned char *identity, int len)
|
||||
{
|
||||
return esp_eap_client_remote_set_identity(identity, len);
|
||||
}
|
||||
|
||||
void esp_eap_client_clear_identity(void)
|
||||
{
|
||||
esp_eap_client_remote_clear_identity();
|
||||
}
|
||||
|
||||
esp_err_t esp_eap_client_set_username(const unsigned char *username, int len)
|
||||
{
|
||||
return esp_eap_client_remote_set_username(username, len);
|
||||
}
|
||||
|
||||
void esp_eap_client_clear_username(void)
|
||||
{
|
||||
esp_eap_client_remote_clear_username();
|
||||
}
|
||||
|
||||
esp_err_t esp_eap_client_set_password(const unsigned char *password, int len)
|
||||
{
|
||||
return esp_eap_client_remote_set_password(password, len);
|
||||
}
|
||||
|
||||
void esp_eap_client_clear_password(void)
|
||||
{
|
||||
esp_eap_client_remote_clear_password();
|
||||
}
|
||||
|
||||
esp_err_t esp_eap_client_set_new_password(const unsigned char *new_password, int len)
|
||||
{
|
||||
return esp_eap_client_remote_set_new_password(new_password, len);
|
||||
}
|
||||
|
||||
void esp_eap_client_clear_new_password(void)
|
||||
{
|
||||
esp_eap_client_remote_clear_new_password();
|
||||
}
|
||||
|
||||
esp_err_t esp_eap_client_set_ca_cert(const unsigned char *ca_cert, int ca_cert_len)
|
||||
{
|
||||
return esp_eap_client_remote_set_ca_cert(ca_cert, ca_cert_len);
|
||||
}
|
||||
|
||||
void esp_eap_client_clear_ca_cert(void)
|
||||
{
|
||||
esp_eap_client_remote_clear_ca_cert();
|
||||
}
|
||||
|
||||
esp_err_t esp_eap_client_set_certificate_and_key(const unsigned char *client_cert, int client_cert_len, const unsigned char *private_key, int private_key_len, const unsigned char *private_key_password, int private_key_passwd_len)
|
||||
{
|
||||
return esp_eap_client_remote_set_certificate_and_key(client_cert, client_cert_len, private_key, private_key_len, private_key_password, private_key_passwd_len);
|
||||
}
|
||||
|
||||
void esp_eap_client_clear_certificate_and_key(void)
|
||||
{
|
||||
esp_eap_client_remote_clear_certificate_and_key();
|
||||
}
|
||||
|
||||
esp_err_t esp_eap_client_set_disable_time_check(_Bool disable)
|
||||
{
|
||||
return esp_eap_client_remote_set_disable_time_check(disable);
|
||||
}
|
||||
|
||||
esp_err_t esp_eap_client_get_disable_time_check(_Bool *disable)
|
||||
{
|
||||
return esp_eap_client_remote_get_disable_time_check(disable);
|
||||
}
|
||||
|
||||
esp_err_t esp_eap_client_set_ttls_phase2_method(esp_eap_ttls_phase2_types type)
|
||||
{
|
||||
return esp_eap_client_remote_set_ttls_phase2_method(type);
|
||||
}
|
||||
|
||||
esp_err_t esp_eap_client_set_suiteb_192bit_certification(_Bool enable)
|
||||
{
|
||||
return esp_eap_client_remote_set_suiteb_192bit_certification(enable);
|
||||
}
|
||||
|
||||
esp_err_t esp_eap_client_set_pac_file(const unsigned char *pac_file, int pac_file_len)
|
||||
{
|
||||
return esp_eap_client_remote_set_pac_file(pac_file, pac_file_len);
|
||||
}
|
||||
|
||||
esp_err_t esp_eap_client_set_fast_params(esp_eap_fast_config config)
|
||||
{
|
||||
return esp_eap_client_remote_set_fast_params(config);
|
||||
}
|
||||
|
||||
esp_err_t esp_eap_client_use_default_cert_bundle(_Bool use_default_bundle)
|
||||
{
|
||||
return esp_eap_client_remote_use_default_cert_bundle(use_default_bundle);
|
||||
}
|
||||
|
||||
void esp_wifi_set_okc_support(_Bool enable)
|
||||
{
|
||||
esp_wifi_remote_set_okc_support(enable);
|
||||
}
|
||||
|
||||
esp_err_t esp_eap_client_set_domain_name(const char *domain_name)
|
||||
{
|
||||
return esp_eap_client_remote_set_domain_name(domain_name);
|
||||
}
|
||||
|
||||
esp_err_t esp_eap_client_set_eap_methods(esp_eap_method_t methods)
|
||||
{
|
||||
return esp_eap_client_remote_set_eap_methods(methods);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 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;
|
||||
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include <esp_private/wifi.h>
|
||||
#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);
|
||||
}
|
||||
esp_wifi_internal_free_rx_buffer(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;
|
||||
}
|
||||
@@ -0,0 +1,386 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "sdkconfig.h"
|
||||
#include "esp_system.h"
|
||||
#include "esp_wifi.h"
|
||||
#include "esp_netif.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_check.h"
|
||||
#include "esp_wifi_netif.h"
|
||||
#include <string.h>
|
||||
#include "esp_wifi_remote.h"
|
||||
|
||||
#define WEAK __attribute__((weak))
|
||||
|
||||
typedef enum {
|
||||
CHANNEL_STA = 0,
|
||||
CHANNEL_AP = 1,
|
||||
CHANNELS = 2
|
||||
} wifi_remote_channel_t;
|
||||
|
||||
typedef esp_err_t (*wifi_rxcb_t)(void *buffer, uint16_t len, void *eb);
|
||||
|
||||
static bool wifi_default_handlers_set = false;
|
||||
static esp_netif_t *s_wifi_netifs[MAX_WIFI_IFS] = { NULL };
|
||||
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];
|
||||
static const char* TAG = "wifi_remote_default_netif";
|
||||
|
||||
WEAK esp_err_t 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_remote_channel_rx(void *h, void *buffer, void *buff_to_free, size_t len)
|
||||
{
|
||||
assert(h);
|
||||
if (h == s_channel[CHANNEL_STA] && s_rx_fn[CHANNEL_STA]) {
|
||||
return s_rx_fn[CHANNEL_STA](buffer, len, buff_to_free);
|
||||
}
|
||||
if (h == s_channel[CHANNEL_AP] && s_rx_fn[CHANNEL_AP]) {
|
||||
return s_rx_fn[CHANNEL_AP](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[CHANNEL_STA] = h;
|
||||
s_tx_cb[CHANNEL_STA] = tx_cb;
|
||||
return ESP_OK;
|
||||
}
|
||||
if (ifx == WIFI_IF_AP) {
|
||||
s_channel[CHANNEL_AP] = h;
|
||||
s_tx_cb[CHANNEL_AP] = tx_cb;
|
||||
return ESP_OK;
|
||||
}
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline int internal_tx(wifi_interface_t ifx, void *buffer, uint16_t len)
|
||||
{
|
||||
if (ifx == WIFI_IF_STA && s_tx_cb[CHANNEL_STA]) {
|
||||
return s_tx_cb[CHANNEL_STA](s_channel[CHANNEL_STA], buffer, len);
|
||||
}
|
||||
if (ifx == WIFI_IF_AP && s_tx_cb[CHANNEL_AP]) {
|
||||
return s_tx_cb[CHANNEL_AP](s_channel[CHANNEL_AP], buffer, len);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
#define IMPLEMENT_WIFI_TRANSMIT(name, interface) static esp_err_t name(void *h, void *buffer, size_t len) \
|
||||
{ return internal_tx(interface, buffer, len); }
|
||||
#define IMPLEMENT_WIFI_TRANSMIT_WRAP(name, interface) static esp_err_t name(void *h, void *buffer, size_t len, void *netbuf) \
|
||||
{ return internal_tx(interface, buffer, len); }
|
||||
|
||||
IMPLEMENT_WIFI_TRANSMIT(transmit_sta, WIFI_IF_STA)
|
||||
IMPLEMENT_WIFI_TRANSMIT_WRAP(transmit_wrap_sta, WIFI_IF_STA)
|
||||
|
||||
#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT
|
||||
IMPLEMENT_WIFI_TRANSMIT_WRAP(transmit_wrap_ap, WIFI_IF_AP)
|
||||
IMPLEMENT_WIFI_TRANSMIT(transmit_ap, WIFI_IF_AP)
|
||||
#endif
|
||||
|
||||
static void wifi_free(void *h, void* buffer)
|
||||
{
|
||||
// remote wifi, no need to free the buffer
|
||||
}
|
||||
|
||||
static esp_err_t receive_sta(void *buffer, uint16_t len, void *eb)
|
||||
{
|
||||
return esp_netif_receive(s_wifi_netifs[WIFI_IF_STA], buffer, len, eb);
|
||||
}
|
||||
|
||||
static esp_err_t receive_ap(void *buffer, uint16_t len, void *eb)
|
||||
{
|
||||
return esp_netif_receive(s_wifi_netifs[WIFI_IF_AP], buffer, len, eb);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wifi start action when station or AP get started
|
||||
*/
|
||||
static void wifi_start(wifi_interface_t ifx, esp_event_base_t base, int32_t event_id, void *data)
|
||||
{
|
||||
uint8_t mac[6];
|
||||
esp_err_t ret;
|
||||
|
||||
if ((ret = esp_wifi_remote_get_mac(ifx, mac)) != ESP_OK) {
|
||||
ESP_LOGE(TAG, "esp_wifi_get_mac failed with %d", ret);
|
||||
return;
|
||||
}
|
||||
ESP_LOGI(TAG, "WIFI mac address: %x %x %x %x %x %x", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
|
||||
|
||||
if (ifx == WIFI_IF_AP) {
|
||||
s_rx_fn[CHANNEL_AP] = receive_ap;
|
||||
}
|
||||
esp_netif_set_mac(s_wifi_netifs[ifx], mac);
|
||||
esp_netif_action_start(s_wifi_netifs[ifx], base, event_id, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wifi default handlers for specific events for station and APs
|
||||
*/
|
||||
static void wifi_default_action_sta_start(void *arg, esp_event_base_t base, int32_t event_id, void *data)
|
||||
{
|
||||
if (s_wifi_netifs[WIFI_IF_STA] != NULL) {
|
||||
wifi_start(WIFI_IF_STA, base, event_id, data);
|
||||
}
|
||||
}
|
||||
|
||||
static void wifi_default_action_sta_stop(void *arg, esp_event_base_t base, int32_t event_id, void *data)
|
||||
{
|
||||
if (s_wifi_netifs[WIFI_IF_STA] != NULL) {
|
||||
esp_netif_action_stop(s_wifi_netifs[WIFI_IF_STA], base, event_id, data);
|
||||
}
|
||||
}
|
||||
|
||||
static void wifi_default_action_sta_connected(void *arg, esp_event_base_t base, int32_t event_id, void *data)
|
||||
{
|
||||
if (s_wifi_netifs[WIFI_IF_STA] != NULL) {
|
||||
s_rx_fn[CHANNEL_STA] = receive_sta;
|
||||
esp_netif_action_connected(s_wifi_netifs[WIFI_IF_STA], base, event_id, data);
|
||||
}
|
||||
}
|
||||
|
||||
static void wifi_default_action_sta_disconnected(void *arg, esp_event_base_t base, int32_t event_id, void *data)
|
||||
{
|
||||
if (s_wifi_netifs[WIFI_IF_STA] != NULL) {
|
||||
esp_netif_action_disconnected(s_wifi_netifs[WIFI_IF_STA], base, event_id, data);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WIFI_RMT_SOFTAP_SUPPORT
|
||||
static void wifi_default_action_ap_start(void *arg, esp_event_base_t base, int32_t event_id, void *data)
|
||||
{
|
||||
if (s_wifi_netifs[WIFI_IF_AP] != NULL) {
|
||||
wifi_start(WIFI_IF_AP, base, event_id, data);
|
||||
}
|
||||
}
|
||||
|
||||
static void wifi_default_action_ap_stop(void *arg, esp_event_base_t base, int32_t event_id, void *data)
|
||||
{
|
||||
if (s_wifi_netifs[WIFI_IF_AP] != NULL) {
|
||||
esp_netif_action_stop(s_wifi_netifs[WIFI_IF_AP], base, event_id, data);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void wifi_default_action_sta_got_ip(void *arg, esp_event_base_t base, int32_t event_id, void *data)
|
||||
{
|
||||
if (s_wifi_netifs[WIFI_IF_STA] != NULL) {
|
||||
ESP_LOGD(TAG, "Got IP wifi default handler entered");
|
||||
int ret = internal_set_sta_ip();
|
||||
if (ret != ESP_OK) {
|
||||
ESP_LOGE(TAG, "esp_wifi_internal_set_sta_ip failed with %d", ret);
|
||||
}
|
||||
esp_netif_action_got_ip(s_wifi_netifs[WIFI_IF_STA], base, event_id, data);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @brief Clear default handlers
|
||||
*/
|
||||
static esp_err_t clear_default_wifi_handlers(void)
|
||||
{
|
||||
esp_event_handler_unregister(WIFI_REMOTE_EVENT, WIFI_EVENT_STA_START, wifi_default_action_sta_start);
|
||||
esp_event_handler_unregister(WIFI_REMOTE_EVENT, WIFI_EVENT_STA_STOP, wifi_default_action_sta_stop);
|
||||
esp_event_handler_unregister(WIFI_REMOTE_EVENT, WIFI_EVENT_STA_CONNECTED, wifi_default_action_sta_connected);
|
||||
esp_event_handler_unregister(WIFI_REMOTE_EVENT, WIFI_EVENT_STA_DISCONNECTED, wifi_default_action_sta_disconnected);
|
||||
#ifdef CONFIG_WIFI_RMT_SOFTAP_SUPPORT
|
||||
esp_event_handler_unregister(WIFI_REMOTE_EVENT, WIFI_EVENT_AP_START, wifi_default_action_ap_start);
|
||||
esp_event_handler_unregister(WIFI_REMOTE_EVENT, WIFI_EVENT_AP_STOP, wifi_default_action_ap_stop);
|
||||
#endif
|
||||
esp_event_handler_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, wifi_default_action_sta_got_ip);
|
||||
esp_unregister_shutdown_handler((shutdown_handler_t)esp_wifi_stop);
|
||||
wifi_default_handlers_set = false;
|
||||
return ESP_OK;
|
||||
}
|
||||
/**
|
||||
* @brief Set default handlers
|
||||
*/
|
||||
static esp_err_t set_default_wifi_handlers(void)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
if (wifi_default_handlers_set) {
|
||||
return ret;
|
||||
}
|
||||
ESP_GOTO_ON_ERROR(esp_event_handler_register(WIFI_REMOTE_EVENT, WIFI_EVENT_STA_START, wifi_default_action_sta_start, NULL),
|
||||
err, TAG, "Failed to register WiFi event");
|
||||
ESP_GOTO_ON_ERROR(esp_event_handler_register(WIFI_REMOTE_EVENT, WIFI_EVENT_STA_STOP, wifi_default_action_sta_stop, NULL),
|
||||
err, TAG, "Failed to register WiFi event");
|
||||
ESP_GOTO_ON_ERROR(esp_event_handler_register(WIFI_REMOTE_EVENT, WIFI_EVENT_STA_CONNECTED, wifi_default_action_sta_connected, NULL),
|
||||
err, TAG, "Failed to register WiFi event");
|
||||
ESP_GOTO_ON_ERROR(esp_event_handler_register(WIFI_REMOTE_EVENT, WIFI_EVENT_STA_DISCONNECTED, wifi_default_action_sta_disconnected, NULL),
|
||||
err, TAG, "Failed to register WiFi event");
|
||||
#ifdef CONFIG_WIFI_RMT_SOFTAP_SUPPORT
|
||||
ESP_GOTO_ON_ERROR(esp_event_handler_register(WIFI_REMOTE_EVENT, WIFI_EVENT_AP_START, wifi_default_action_ap_start, NULL),
|
||||
err, TAG, "Failed to register WiFi event");
|
||||
ESP_GOTO_ON_ERROR(esp_event_handler_register(WIFI_REMOTE_EVENT, WIFI_EVENT_AP_STOP, wifi_default_action_ap_stop, NULL),
|
||||
err, TAG, "Failed to register WiFi event");
|
||||
#endif
|
||||
ESP_GOTO_ON_ERROR(esp_event_handler_register(IP_EVENT, IP_EVENT_STA_GOT_IP, wifi_default_action_sta_got_ip, NULL),
|
||||
err, TAG, "Failed to register IP event");
|
||||
ret = esp_register_shutdown_handler((shutdown_handler_t)esp_wifi_stop);
|
||||
ESP_GOTO_ON_FALSE(ret == ESP_OK || ret == ESP_ERR_INVALID_STATE, ESP_FAIL, err, TAG, "Failed to register WiFi event");
|
||||
wifi_default_handlers_set = true;
|
||||
return ESP_OK;
|
||||
|
||||
err:
|
||||
clear_default_wifi_handlers();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief User init custom wifi interface
|
||||
*/
|
||||
esp_netif_t* esp_netif_create_wifi_remote(wifi_interface_t wifi_if, const esp_netif_inherent_config_t *esp_netif_config)
|
||||
{
|
||||
esp_netif_driver_ifconfig_t driver_ifconfig = {
|
||||
/* This is a simplified driver, since we support static number of netifs (only STA and AP)
|
||||
* no need to create driver pointer -> but need to make the handle is not NULL */
|
||||
.handle = ((void*)1),
|
||||
.driver_free_rx_buffer = wifi_free
|
||||
};
|
||||
esp_netif_config_t cfg = {
|
||||
.base = esp_netif_config,
|
||||
.driver = &driver_ifconfig
|
||||
};
|
||||
if (wifi_if == WIFI_IF_STA) {
|
||||
cfg.stack = _g_esp_netif_netstack_default_wifi_sta;
|
||||
driver_ifconfig.transmit = transmit_sta;
|
||||
driver_ifconfig.transmit_wrap = transmit_wrap_sta;
|
||||
#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT
|
||||
} else if (wifi_if == WIFI_IF_AP) {
|
||||
cfg.stack = _g_esp_netif_netstack_default_wifi_ap;
|
||||
driver_ifconfig.transmit = transmit_ap;
|
||||
driver_ifconfig.transmit_wrap = transmit_wrap_ap;
|
||||
#endif
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
esp_netif_t *netif = esp_netif_new(&cfg);
|
||||
if (netif == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
s_wifi_netifs[wifi_if] = netif;
|
||||
return netif;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set default handlers for station (official API)
|
||||
*/
|
||||
esp_err_t esp_wifi_set_default_wifi_remote_sta_handlers(void)
|
||||
{
|
||||
return set_default_wifi_handlers();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set default handlers for AP (official API)
|
||||
*/
|
||||
esp_err_t esp_wifi_set_default_wifi_remote_ap_handlers(void)
|
||||
{
|
||||
return set_default_wifi_handlers();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear default handlers and destroy appropriate objects (official API)
|
||||
*/
|
||||
esp_err_t esp_wifi_remote_clear_default_wifi_driver_and_handlers(void *esp_netif)
|
||||
{
|
||||
int i;
|
||||
wifi_interface_t ifx = MAX_WIFI_IFS;
|
||||
for (i = 0; i < MAX_WIFI_IFS; ++i) {
|
||||
// clear internal static pointers to netifs
|
||||
if (s_wifi_netifs[i] == esp_netif) {
|
||||
s_wifi_netifs[i] = NULL;
|
||||
ifx = i;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < MAX_WIFI_IFS; ++i) {
|
||||
// check if all netifs are cleared to delete default handlers
|
||||
if (s_wifi_netifs[i] != NULL) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == MAX_WIFI_IFS) { // if all wifi default netifs are null
|
||||
ESP_LOGD(TAG, "Clearing wifi default handlers");
|
||||
clear_default_wifi_handlers();
|
||||
}
|
||||
if (ifx == WIFI_IF_STA) {
|
||||
s_rx_fn[CHANNEL_STA] = NULL;
|
||||
} else if (ifx == WIFI_IF_AP) {
|
||||
s_rx_fn[CHANNEL_AP] = NULL;
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
void esp_netif_destroy_wifi_remote(void *esp_netif)
|
||||
{
|
||||
if (esp_netif) {
|
||||
esp_wifi_remote_clear_default_wifi_driver_and_handlers(esp_netif);
|
||||
}
|
||||
esp_netif_destroy(esp_netif);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_WIFI_RMT_SOFTAP_SUPPORT) && !defined(CONFIG_ESP_WIFI_SOFTAP_SUPPORT)
|
||||
|
||||
// We have to redefine all netif properties for AP, if IDF's AP definition is missing (i.e. WiFi AP is disabled)
|
||||
// (and at the same time Remote-WiFi AP is enabled, thus we know that we would need it)
|
||||
static const esp_netif_ip_info_t s_wifi_remote_soft_ap_ip = {
|
||||
.ip = { .addr = ESP_IP4TOADDR(192, 168, 4, 1) },
|
||||
.gw = { .addr = ESP_IP4TOADDR(192, 168, 4, 1) },
|
||||
.netmask = { .addr = ESP_IP4TOADDR(255, 255, 255, 0) },
|
||||
};
|
||||
|
||||
#ifdef CONFIG_LWIP_IPV4
|
||||
#define ESP_NETIF_IPV4_ONLY_FLAGS(flags) (flags)
|
||||
#else
|
||||
#define ESP_NETIF_IPV4_ONLY_FLAGS(flags) (0)
|
||||
#endif
|
||||
|
||||
#define ESP_NETIF_INHERENT_DEFAULT_WIFI_AP() \
|
||||
{ \
|
||||
.flags = (esp_netif_flags_t)(ESP_NETIF_IPV4_ONLY_FLAGS(ESP_NETIF_DHCP_SERVER) | ESP_NETIF_FLAG_AUTOUP), \
|
||||
ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_EMPTY(mac) \
|
||||
.ip_info = &s_wifi_remote_soft_ap_ip, \
|
||||
.get_ip_event = 0, \
|
||||
.lost_ip_event = 0, \
|
||||
.if_key = "WIFI_AP_DEF", \
|
||||
.if_desc = "ap", \
|
||||
.route_prio = 10, \
|
||||
.bridge_info = NULL \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief User init default AP (official API)
|
||||
*/
|
||||
esp_netif_t* esp_wifi_remote_create_default_ap(void)
|
||||
{
|
||||
esp_netif_inherent_config_t esp_netif_config = ESP_NETIF_INHERENT_DEFAULT_WIFI_AP();
|
||||
esp_netif_config.if_key = "WIFI_AP_RMT";
|
||||
esp_netif_config.if_desc = "wifi_ap_remote";
|
||||
esp_netif_t *netif = esp_netif_create_wifi_remote(WIFI_IF_AP, &esp_netif_config);
|
||||
esp_wifi_set_default_wifi_remote_ap_handlers();
|
||||
return netif;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief User init default station (official API)
|
||||
*/
|
||||
esp_netif_t* esp_wifi_remote_create_default_sta(void)
|
||||
{
|
||||
esp_netif_inherent_config_t esp_netif_config = ESP_NETIF_INHERENT_DEFAULT_WIFI_STA();
|
||||
esp_netif_config.if_key = "WIFI_STA_RMT";
|
||||
esp_netif_config.if_desc = "wifi_sta_remote";
|
||||
esp_netif_t *netif = esp_netif_create_wifi_remote(WIFI_IF_STA, &esp_netif_config);
|
||||
esp_wifi_set_default_wifi_remote_sta_handlers();
|
||||
return netif;
|
||||
}
|
||||
@@ -0,0 +1,452 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 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);
|
||||
}
|
||||
@@ -0,0 +1,448 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 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);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
// This file is auto-generated
|
||||
#pragma once
|
||||
#include "esp_eap_client.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
esp_err_t esp_wifi_remote_sta_enterprise_enable(void);
|
||||
esp_err_t esp_wifi_remote_sta_enterprise_disable(void);
|
||||
esp_err_t esp_eap_client_remote_set_identity(const unsigned char *identity, int len);
|
||||
void esp_eap_client_remote_clear_identity(void);
|
||||
esp_err_t esp_eap_client_remote_set_username(const unsigned char *username, int len);
|
||||
void esp_eap_client_remote_clear_username(void);
|
||||
esp_err_t esp_eap_client_remote_set_password(const unsigned char *password, int len);
|
||||
void esp_eap_client_remote_clear_password(void);
|
||||
esp_err_t esp_eap_client_remote_set_new_password(const unsigned char *new_password, int len);
|
||||
void esp_eap_client_remote_clear_new_password(void);
|
||||
esp_err_t esp_eap_client_remote_set_ca_cert(const unsigned char *ca_cert, int ca_cert_len);
|
||||
void esp_eap_client_remote_clear_ca_cert(void);
|
||||
esp_err_t esp_eap_client_remote_set_certificate_and_key(const unsigned char *client_cert, int client_cert_len, const unsigned char *private_key, int private_key_len, const unsigned char *private_key_password, int private_key_passwd_len);
|
||||
void esp_eap_client_remote_clear_certificate_and_key(void);
|
||||
esp_err_t esp_eap_client_remote_set_disable_time_check(_Bool disable);
|
||||
esp_err_t esp_eap_client_remote_get_disable_time_check(_Bool *disable);
|
||||
esp_err_t esp_eap_client_remote_set_ttls_phase2_method(esp_eap_ttls_phase2_types type);
|
||||
esp_err_t esp_eap_client_remote_set_suiteb_192bit_certification(_Bool enable);
|
||||
esp_err_t esp_eap_client_remote_set_pac_file(const unsigned char *pac_file, int pac_file_len);
|
||||
esp_err_t esp_eap_client_remote_set_fast_params(esp_eap_fast_config config);
|
||||
esp_err_t esp_eap_client_remote_use_default_cert_bundle(_Bool use_default_bundle);
|
||||
void esp_wifi_remote_set_okc_support(_Bool enable);
|
||||
esp_err_t esp_eap_client_remote_set_domain_name(const char *domain_name);
|
||||
esp_err_t esp_eap_client_remote_set_eap_methods(esp_eap_method_t methods);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#pragma once
|
||||
#include "esp_wifi.h"
|
||||
#include "esp_wifi_remote_api.h"
|
||||
#include "esp_wifi_remote_version.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ESP_WIFI_ENABLED)
|
||||
ESP_EVENT_DECLARE_BASE(WIFI_REMOTE_EVENT);
|
||||
#else
|
||||
#define WIFI_REMOTE_EVENT WIFI_EVENT
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @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);
|
||||
|
||||
/**
|
||||
* @brief Create default STA interface
|
||||
* @return ESP_OK on success
|
||||
*/
|
||||
esp_netif_t* esp_wifi_remote_create_default_sta(void);
|
||||
|
||||
/**
|
||||
* @brief Create default AP interface
|
||||
* @return ESP_OK on success
|
||||
*/
|
||||
esp_netif_t* esp_wifi_remote_create_default_ap(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
// This file is auto-generated
|
||||
#pragma once
|
||||
#include "esp_err.h"
|
||||
#include "esp_wifi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
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);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Major version number (X.x.x) */
|
||||
#define ESP_WIFI_REMOTE_VERSION_MAJOR 1
|
||||
/** Minor version number (x.X.x) */
|
||||
#define ESP_WIFI_REMOTE_VERSION_MINOR 3
|
||||
/** Patch version number (x.x.X) */
|
||||
#define ESP_WIFI_REMOTE_VERSION_PATCH 2
|
||||
|
||||
/**
|
||||
* Macro to convert WIFI_REMOTE version number into an integer
|
||||
*
|
||||
* To be used in comparisons, such as ESP_WIFI_REMOTE_VERSION >= ESP_WIFI_REMOTE_VERSION_VAL(1, 3, 0)
|
||||
*/
|
||||
#define ESP_WIFI_REMOTE_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch))
|
||||
|
||||
/**
|
||||
* Current WIFI_REMOTE version, as an integer
|
||||
*
|
||||
* To be used in comparisons, such as ESP_WIFI_REMOTE_VERSION >= ESP_WIFI_REMOTE_VERSION_VAL(1, 3, 0)
|
||||
*/
|
||||
#define ESP_WIFI_REMOTE_VERSION ESP_WIFI_REMOTE_VERSION_VAL(ESP_WIFI_REMOTE_VERSION_MAJOR, \
|
||||
ESP_WIFI_REMOTE_VERSION_MINOR, \
|
||||
ESP_WIFI_REMOTE_VERSION_PATCH)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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__ */
|
||||
@@ -0,0 +1,416 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef __ESP_NOW_H__
|
||||
#define __ESP_NOW_H__
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "esp_err.h"
|
||||
#include "esp_wifi_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#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 ESPNOW switch channel information
|
||||
*/
|
||||
typedef struct {
|
||||
wifi_action_tx_t type; /**< ACTION TX operation type */
|
||||
uint8_t channel; /**< Channel on which to perform ESPNOW TX Operation */
|
||||
wifi_second_chan_t sec_channel; /**< Secondary channel */
|
||||
uint32_t wait_time_ms; /**< Duration to wait for on target channel */
|
||||
uint8_t op_id; /**< Unique Identifier for operation provided by wifi driver */
|
||||
uint8_t dest_mac[6]; /**< Destination MAC address */
|
||||
uint16_t data_len; /**< Length of the appended Data */
|
||||
uint8_t data[0]; /**< Appended Data payload */
|
||||
} esp_now_switch_channel_t;
|
||||
|
||||
/**
|
||||
* @brief ESPNOW remain on channel information
|
||||
*/
|
||||
typedef struct {
|
||||
wifi_roc_t type; /**< ROC operation type */
|
||||
uint8_t channel; /**< Channel on which to perform ESPNOW ROC Operation */
|
||||
wifi_second_chan_t sec_channel; /**< Secondary channel */
|
||||
uint32_t wait_time_ms; /**< Duration to wait for on target channel */
|
||||
uint8_t op_id; /**< ID of this specific ROC operation provided by wifi driver */
|
||||
} esp_now_remain_on_channel_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 tx_info 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 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);
|
||||
|
||||
/**
|
||||
* @brief ESPNOW switch to a specific channel for a required duration, and send one ESPNOW data.
|
||||
*
|
||||
* @param config ESPNOW switch channel relevant information
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK : succeed
|
||||
* - ESP_ERR_NO_MEM: failed to allocate memory
|
||||
* - ESP_ERR_INVALID_ARG: the <channel, sec_channel> pair is invalid
|
||||
* - ESP_FAIL: failed to send frame
|
||||
*/
|
||||
esp_err_t esp_now_switch_channel_tx(esp_now_switch_channel_t *config);
|
||||
|
||||
/**
|
||||
* @brief ESPNOW remain on the target channel for required duration.
|
||||
*
|
||||
* @param config ESPNOW remain on channel relevant information
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK : succeed
|
||||
* - ESP_ERR_NO_MEM: failed to allocate memory
|
||||
* - ESP_ERR_INVALID_ARG: the <channel, sec_channel> pair is invalid
|
||||
* - ESP_FAIL: failed to perform roc operation
|
||||
*/
|
||||
esp_err_t esp_now_remain_on_channel(esp_now_remain_on_channel_t *config);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ESP_NOW_H__ */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
@@ -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 <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#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
|
||||
@@ -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
|
||||
@@ -0,0 +1,238 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#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
|
||||
@@ -0,0 +1,437 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#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 lltf_bit_mode : 1; /**< LLTF bit width mode for I/Q components, 0 : 12-bit, 1 : 8-bit, default : 12-bit */
|
||||
uint32_t reserved : 14; /**< 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
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#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
|
||||
@@ -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")
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
// This file is auto-generated
|
||||
@@ -0,0 +1,680 @@
|
||||
# SPDX-FileCopyrightText: 2026 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
|
||||
import sys
|
||||
from collections import namedtuple
|
||||
from typing import IO
|
||||
from typing import Any
|
||||
from typing import cast
|
||||
|
||||
from idf_build_apps.constants import PREVIEW_TARGETS
|
||||
from idf_build_apps.constants import SUPPORTED_TARGETS
|
||||
from pycparser import c_ast
|
||||
from pycparser import c_parser
|
||||
from pycparser import preprocess_file
|
||||
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
current_dir = os.path.abspath(os.getcwd())
|
||||
if script_dir != current_dir:
|
||||
print(f'Error: This script must be run from its own directory: {script_dir}')
|
||||
print(f'Current working directory is: {current_dir}')
|
||||
sys.exit(1)
|
||||
|
||||
Param = namedtuple('Param', ['ptr', 'array', 'qual', 'type', 'name'])
|
||||
|
||||
component_path = os.path.normpath(os.path.join(os.path.realpath(__file__), '..', '..'))
|
||||
AUTO_GENERATED = 'This file is auto-generated'
|
||||
COPYRIGHT_HEADER = open(component_path + '/scripts/copyright_header.h').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 = []
|
||||
FunctionPrototypes = dict[str, tuple[str, list[Any]]]
|
||||
|
||||
|
||||
class FunctionVisitor(c_ast.NodeVisitor):
|
||||
def __init__(self, header: str, prefixes: str | list[str] | tuple[str, ...]) -> None:
|
||||
self.function_prototypes: FunctionPrototypes = {}
|
||||
self.ptr = 0
|
||||
self.array = 0
|
||||
self.content = open(header).read()
|
||||
self.prefixes = prefixes if isinstance(prefixes, list | tuple) else [prefixes]
|
||||
|
||||
def get_type(self, node: Any, suffix: str = 'param') -> tuple[str, str, Any]:
|
||||
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:
|
||||
c_type = ' '.join(node.type.type.names)
|
||||
return quals, c_type, typename
|
||||
if isinstance(node.type, c_ast.PtrDecl):
|
||||
quals, c_type, name = self.get_type(node.type, 'ptr')
|
||||
self.ptr += 1
|
||||
return quals, c_type, name
|
||||
|
||||
if isinstance(node.type, c_ast.ArrayDecl):
|
||||
quals, c_type, name = self.get_type(node.type, 'array')
|
||||
self.array = int(node.type.dim.value)
|
||||
return quals, c_type, name
|
||||
return '', '', None
|
||||
|
||||
def visit_FuncDecl(self, node: c_ast.FuncDecl) -> None:
|
||||
if isinstance(node.type, c_ast.TypeDecl):
|
||||
func_name = node.type.declname
|
||||
if (
|
||||
any(func_name.startswith(prefix) for prefix in self.prefixes)
|
||||
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, c_type, name = self.get_type(param)
|
||||
param = Param(ptr=self.ptr, array=self.array, qual=quals, type=c_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: str, header: str, prefixes: str | list[str] | tuple[str, ...]
|
||||
) -> FunctionPrototypes:
|
||||
parser = c_parser.CParser() # Set debug parameter to False
|
||||
ast = parser.parse(header_code)
|
||||
visitor = FunctionVisitor(header, prefixes)
|
||||
visitor.visit(ast)
|
||||
return visitor.function_prototypes
|
||||
|
||||
|
||||
def exec_cmd(what: list[str], out_file: IO[str] | None = None) -> tuple[int, str, str, str]:
|
||||
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: str, header: str) -> str:
|
||||
project_dir = os.path.join(idf_path, 'examples', 'wifi', 'getting_started', 'station')
|
||||
build_dir = os.path.join(project_dir, 'build')
|
||||
|
||||
# Clean up build artifacts
|
||||
if os.path.exists(build_dir):
|
||||
shutil.rmtree(build_dir)
|
||||
sdkconfig = os.path.join(project_dir, 'sdkconfig')
|
||||
if os.path.exists(sdkconfig):
|
||||
os.remove(sdkconfig)
|
||||
|
||||
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, 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 cast(str, preprocessed_code)
|
||||
|
||||
|
||||
def get_args(parameters: list[Any]) -> tuple[str, str]:
|
||||
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: list[Any]) -> tuple[str, str]:
|
||||
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: str, component_path: str) -> list[str]:
|
||||
kconfig = os.path.join(component_path, 'Kconfig.soc_wifi_caps.in')
|
||||
slave_select = os.path.join(component_path, 'Kconfig.slave_select.in')
|
||||
|
||||
# Read and parse the global Kconfig file for target selections
|
||||
target_selections: dict[str, list[str]] = {}
|
||||
current_target = None
|
||||
with open(os.path.join(idf_path, 'Kconfig')) 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_ESP32C6 if IDF_TARGET_ESP32P4 # To support common use-cases\n')
|
||||
slave.write(' default SLAVE_IDF_TARGET_ESP32\n\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) 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 OSError 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(' bool\n')
|
||||
slave_caps.write(' 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: FunctionPrototypes, component_path: str) -> list[str]:
|
||||
header = os.path.join(component_path, 'include', 'esp_wifi_remote_api.h')
|
||||
wifi_source = os.path.join(component_path, 'esp_wifi_with_remote.c')
|
||||
remote_source = os.path.join(component_path, 'esp_wifi_remote_weak.c')
|
||||
with open(header, 'w') as f:
|
||||
f.write(COPYRIGHT_HEADER)
|
||||
f.write('#pragma once\n#include "esp_err.h"\n#include "esp_wifi.h"\n')
|
||||
f.write('\n#ifdef __cplusplus\nextern "C" {\n#endif\n\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')
|
||||
f.write('\n#ifdef __cplusplus\n}\n#endif\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_remote_eap_api(function_prototypes: FunctionPrototypes, component_path: str) -> list[str]:
|
||||
header = os.path.join(component_path, 'include', 'esp_eap_client_remote_api.h')
|
||||
eap_source = os.path.join(component_path, 'esp_eap_client_with_remote.c')
|
||||
remote_source = os.path.join(component_path, 'esp_eap_client_remote_weak.c')
|
||||
with open(header, 'w') as f:
|
||||
f.write(COPYRIGHT_HEADER)
|
||||
f.write('#pragma once\n')
|
||||
f.write('#include "esp_eap_client.h"\n')
|
||||
f.write('\n#ifdef __cplusplus\nextern "C" {\n#endif\n\n')
|
||||
for func_name, args in function_prototypes.items():
|
||||
params, _ = get_args(args[1])
|
||||
# Handle esp_wifi functions differently - map them to esp_wifi_remote
|
||||
if func_name.startswith('esp_wifi_'):
|
||||
remote_func_name = NAMESPACE.sub('esp_wifi_remote', func_name)
|
||||
else:
|
||||
remote_func_name = func_name.replace('esp_eap_client', 'esp_eap_client_remote')
|
||||
f.write(f'{args[0]} {remote_func_name}({params});\n')
|
||||
f.write('\n#ifdef __cplusplus\n}\n#endif\n')
|
||||
with open(eap_source, 'w') as eap, open(remote_source, 'w') as remote:
|
||||
eap.write(COPYRIGHT_HEADER)
|
||||
eap.write('#include "esp_eap_client.h"\n')
|
||||
eap.write('#include "esp_eap_client_remote_api.h"\n')
|
||||
remote.write(COPYRIGHT_HEADER)
|
||||
remote.write('#include "esp_eap_client_remote_api.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_eap_client_remote_weak", "%s unsupported", __func__); \\\n'
|
||||
' return ret;\n'
|
||||
)
|
||||
remote.write(
|
||||
'#define LOG_UNSUPPORTED_VOID() ESP_LOGW("esp_eap_client_remote_weak", "%s unsupported", __func__);\n'
|
||||
)
|
||||
for func_name, args in function_prototypes.items():
|
||||
# Handle esp_wifi functions differently - map them to esp_wifi_remote
|
||||
if func_name.startswith('esp_wifi_'):
|
||||
remote_func_name = NAMESPACE.sub('esp_wifi_remote', func_name)
|
||||
else:
|
||||
remote_func_name = func_name.replace('esp_eap_client', 'esp_eap_client_remote')
|
||||
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'
|
||||
eap.write(f'\n{args[0]} {func_name}({params})\n')
|
||||
eap.write('{\n')
|
||||
if ret_type == 'void':
|
||||
eap.write(f' {remote_func_name}({names});\n')
|
||||
else:
|
||||
eap.write(f' return {remote_func_name}({names});\n')
|
||||
eap.write('}\n')
|
||||
remote.write(f'\nWEAK {args[0]} {remote_func_name}({params})\n')
|
||||
remote.write('{\n')
|
||||
if ret_type == 'void':
|
||||
remote.write(' LOG_UNSUPPORTED_VOID();\n')
|
||||
else:
|
||||
remote.write(f' LOG_UNSUPPORTED_AND_RETURN({ret_value});\n')
|
||||
remote.write('}\n')
|
||||
return [header, eap_source, remote_source]
|
||||
|
||||
|
||||
def generate_hosted_mocks(function_prototypes: FunctionPrototypes, component_path: str) -> list[str]:
|
||||
source = os.path.join(component_path, 'test', 'smoke_test', 'components', 'esp_hosted', 'esp_hosted_mock.c')
|
||||
header = os.path.join(
|
||||
component_path, 'test', 'smoke_test', 'components', 'esp_hosted', 'include', 'esp_hosted_mock.h'
|
||||
)
|
||||
os.makedirs(os.path.dirname(source), exist_ok=True)
|
||||
os.makedirs(os.path.dirname(header), exist_ok=True)
|
||||
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_wifi_native(idf_path: str, component_path: str) -> list[str]:
|
||||
native_headers = []
|
||||
|
||||
def replace_configs(original: str, replaced: str) -> str:
|
||||
with open(original) 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, '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: str) -> set[str]:
|
||||
"""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')) 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: str, component_path: str) -> list[str]:
|
||||
# Define file paths
|
||||
remote_kconfig = os.path.join(component_path, 'Kconfig.wifi.in')
|
||||
remote_kconfig_is_remote = os.path.join(component_path, 'Kconfig.wifi_is_remote.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) 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:
|
||||
|
||||
def _indent_len(line: str) -> int:
|
||||
return len(line) - len(line.lstrip())
|
||||
|
||||
# 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 = _indent_len(original_line)
|
||||
|
||||
# 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)
|
||||
# TODO: Capture all host dependencies and replace them with WIFI_RMT_ prefix
|
||||
# keep track and check integrity with slave settings
|
||||
modified_line = re.compile(r'\bESP_PHY_IRAM_OPT').sub('WIFI_RMT_PHY_IRAM_OPT', modified_line)
|
||||
# Kconfig.wifi.in lives under components/esp_wifi/remote, so inherited
|
||||
# rsource paths from components/esp_wifi/Kconfig need one level up.
|
||||
# source_match = re.match(r'^(\s*rsource\s+")([^"]+)(".*)$', modified_line)
|
||||
# if source_match and not source_match.group(2).startswith('../'):
|
||||
# modified_line = f'{source_match.group(1)}../{source_match.group(2)}{source_match.group(3)}\n'
|
||||
|
||||
# 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 _indent_len(original_line) > current_config_indent:
|
||||
# Check for config properties: type (int or bool) or dependency
|
||||
for keyword in ['int', 'bool', 'depends']:
|
||||
if re.match(rf'^{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
|
||||
config_indent = ''
|
||||
if config_type == 'bool':
|
||||
remote_configs += f'if {remote_value}\n'
|
||||
config_indent = ' '
|
||||
remote_configs += f'{config_indent}config {current_config} {KCONFIG_MULTIPLE_DEF}\n'
|
||||
remote_configs += f'{config_indent} {config_type}\n'
|
||||
if depends_on is not None:
|
||||
remote_configs += f'{config_indent} {depends_on}\n'
|
||||
depends_on = None
|
||||
remote_configs += f'{config_indent} default {remote_value}\n'
|
||||
if config_type == 'bool':
|
||||
remote_configs += '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 = _indent_len(modified_line)
|
||||
|
||||
# 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(' rsource "Kconfig.wifi_is_remote.in"\n')
|
||||
outfile.write('endif # ESP_WIFI_ENABLED\n')
|
||||
outfile.write('# Wi-Fi configuration end\n')
|
||||
with open(remote_kconfig_is_remote, 'w') as outfile:
|
||||
outfile.write(f'# {AUTO_GENERATED}\n')
|
||||
outfile.write(remote_configs.rstrip('\n') + '\n')
|
||||
|
||||
return [remote_kconfig, remote_kconfig_is_remote]
|
||||
|
||||
|
||||
def compare_files(base_dir: str, component_path: str, files_to_check: list[str]) -> list[tuple[str, str]]:
|
||||
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, capture_output=True)
|
||||
|
||||
if result.returncode != 0: # diff returns 0 if files are identical
|
||||
failures.append((relative_path, result.stdout.decode('utf-8')))
|
||||
|
||||
return failures
|
||||
|
||||
|
||||
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.")
|
||||
header = os.path.join(idf_path, 'components', 'esp_wifi', 'include', 'esp_wifi.h')
|
||||
eap_header = os.path.join(idf_path, 'components', 'wpa_supplicant', 'esp_supplicant', 'include', 'esp_eap_client.h')
|
||||
function_prototypes = extract_function_prototypes(preprocess(idf_path, header), header, ['esp_wifi_'])
|
||||
eap_function_prototypes = extract_function_prototypes(
|
||||
preprocess(idf_path, eap_header), eap_header, ['esp_eap_client_', 'esp_wifi_']
|
||||
)
|
||||
|
||||
files_to_check = []
|
||||
|
||||
files_to_check += generate_kconfig_wifi_caps(idf_path, component_path)
|
||||
files_to_check += generate_remote_wifi_api(function_prototypes, component_path)
|
||||
files_to_check += generate_remote_eap_api(eap_function_prototypes, component_path)
|
||||
files_to_check += generate_hosted_mocks(function_prototypes, component_path)
|
||||
files_to_check += generate_wifi_native(idf_path, component_path)
|
||||
files_to_check += generate_kconfig(idf_path, 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)
|
||||
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 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;
|
||||
typedef void *__FILE;
|
||||
#define __inline__ inline
|
||||
#define __inline inline
|
||||
#define __extension__
|
||||
#define __typeof__(x) void*
|
||||
#define bool _Bool
|
||||
Reference in New Issue
Block a user