Espressif ESP32-S2 Programming Manual page 221

Table of Contents

Advertisement

Chapter 2. API Reference
• esp_netif: instance of corresponding if object
esp_netif_t *esp_netif_create_default_wifi_ap(void)
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 default wifi handlers.
Return pointer to esp-netif instance
esp_netif_t *esp_netif_create_default_wifi_sta(void)
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
default wifi handlers.
Return pointer to esp-netif instance
void esp_netif_destroy_default_wifi(void *esp_netif)
Destroys default WIFI netif created with esp_netif_create_default_wifi_...() API.
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)
Parameters
• [in] esp_netif: object to detach from WiFi and destroy
esp_netif_t
*esp_netif_create_wifi(wifi_interface_t
Creates esp_netif WiFi object based on the custom configuration.
Attention This API DOES NOT register default handlers!
Return pointer to esp-netif instance
Parameters
• [in] wifi_if: type of wifi interface
• [in] esp_netif_config: inherent esp-netif configuration pointer
esp_err_t
esp_netif_create_default_wifi_mesh_netifs(esp_netif_t
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.
Return ESP_OK on success
Parameters
• [out] p_netif_sta: pointer where the resultant STA interface is saved (if non NULL)
• [out] p_netif_ap: pointer where the resultant AP interface is saved (if non NULL)
TCP/IP Adapter Migration Guide
TCP/IP Adapter is a network interface abstraction component used in IDF prior to v4.1. This page outlines migration
from tcpip_adapter API to its successor ESP-NETIF.
Updating network connection code
Network stack initialization
note that the
ESP-NETIF
initialization API returns standard error code and the esp_netif_deinit() for un-
initialization is available.
Also replace #include "tcpip_adapter.h" with #include "esp_netif.h".
Espressif Systems
*esp_netif_config)
Simply replace tcpip_adapter_init() with esp_netif_init(). Please
210
Submit Document Feedback
wifi_if,
esp_netif_inherent_config_t
esp_netif_t **p_netif_ap)
**p_netif_sta,
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Table of Contents

Save PDF