Api Reference; Networking Apis; Wi-Fi - Espressif ESP32-S2 Programming Manual

Table of Contents

Advertisement

Chapter 2

API Reference

2.1 Networking APIs

2.1.1 Wi-Fi

Wi-Fi
Introduction
The Wi-Fi libraries provide support for configuring and monitoring the ESP32-S2 Wi-Fi networking
functionality. This includes configuration for:
• Station mode (aka STA mode or Wi-Fi client mode). ESP32-S2 connects to an access point.
• AP mode (aka Soft-AP mode or Access Point mode). Stations connect to the ESP32-S2.
• Combined AP-STA mode (ESP32-S2 is concurrently an access point and a station connected to another access
point).
• Various security modes for the above (WPA, WPA2, WEP, etc.)
• Scanning for access points (active & passive scanning).
• Promiscuous mode for monitoring of IEEE802.11 Wi-Fi packets.
Application Examples
Code examples for Wi-Fi are provided in the
In addition, there is a simple
API Reference
Header File
components/esp_wifi/include/esp_wifi.h
Functions
esp_err_t
esp_wifi_init(const
Initialize WiFi Allocate resource for WiFi driver, such as WiFi control structure, RX/TX buffer, WiFi NVS
structure etc. This WiFi also starts WiFi task.
Attention 1. This API must be called before all other WiFi API can be called
Attention 2. Always use WIFI_INIT_CONFIG_DEFAULT macro to initialize the configuration to default
values, this can guarantee all the fields get correct value when more fields are added into
in future release. If you want to set your own initial values, overwrite the default values which are set
by WIFI_INIT_CONFIG_DEFAULT. Please be notified that the field 'magic'of
should always be WIFI_INIT_CONFIG_MAGIC!
The
wifi
directory of ESP-IDF examples contains the following applications:
wifi
directory of ESP-IDF examples.
esp-idf-template
application to demonstrate a minimal IDF project structure.
wifi_init_config_t
*config)
wifi_init_config_t
wifi_init_config_t
87

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