EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #1526 background imageLoading...
Page #1526 background image
Chapter 4. API Guides
4.33.4 ESP32-S2 Wi-Fi API Parameter Initialization
When initializing struct parameters for the API, one of two approaches should be followed:
explicitly set all fields of the parameter
use get API to get current configuration first, then set application specific fields
Initializing or getting the entire structure is very important because most of the time the value 0 indicates the default
value is used. More fields may be added to the struct in the future and initializing these to zero ensures the application
will still work correctly after IDF is updated to a new release.
4.33.5 ESP32-S2 Wi-Fi Programming Model
The ESP32-S2 Wi-Fi programming model is depicted as follows:
Fig. 39: Wi-Fi Programming Model
The Wi-Fi driver can be considered a black box that knows nothing about high-layer code, such as the TCP/IP stack,
application task, event task, etc. The application task (code) generally calls Wi-Fi driver APIs to initialize Wi-Fi
and handles Wi-Fi events when necessary. Wi-Fi driver receives API calls, handles them, and post events to the
application.
Wi-Fi event handling is based on the esp_event library. Events are sent by the Wi-Fi driver to the default event loop.
Application may handle these events in callbacks registered using esp_event_handler_register(). Wi-Fi
events are also handled by esp_netif component to provide a set of default behaviors. For example, when Wi-Fi station
connects to an AP, esp_netif will automatically start the DHCP client (by default).
4.33.6 ESP32-S2 Wi-Fi Event Description
WIFI_EVENT_WIFI_READY
The Wi-Fi driver will never generate this event, which, as a result, can be ignored by the application event callback.
This event may be removed in future releases.
WIFI_EVENT_SCAN_DONE
The scan-done event is triggered by esp_wifi_scan_start() and will arise in the following scenarios:
The scan is completed, e.g., the target AP is found successfully, or all channels have been scanned.
The scan is stopped by esp_wifi_scan_stop().
Espressif Systems 1515
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish