Wi-Fi Peripheral¶
The Wi-Fi Peripheral is used to configure Wi-Fi connections, provide APIs to control Wi-Fi connection configuration, as well as monitor the status of Wi-Fi networks.
Application Example¶
Implementation of this API is demonstrated in player/pipeline_http_mp3 example.
API Reference¶
Header File¶
Functions¶
-
esp_periph_handle_t
periph_wifi_init(periph_wifi_cfg_t *config)¶ Create the wifi peripheral handle for esp_peripherals.
- Note
- The handle was created by this function automatically destroy when
esp_periph_destroyis called - Return
- The esp peripheral handle
- Parameters
config: The configuration
-
esp_err_t
periph_wifi_wait_for_connected(esp_periph_handle_t periph, TickType_t tick_to_wait)¶ This function will block current thread (in
tick_to_waittick) and wait until ESP32 connected to the Wi-Fi network, and got ip.- Return
- ESP_OK
- ESP_FAIL
- Parameters
periph: The periphtick_to_wait: The tick to wait
-
periph_wifi_state_t
periph_wifi_is_connected(esp_periph_handle_t periph)¶ Check the Wi-Fi connection status.
- Return
- Wi-Fi network status
- Parameters
periph: The periph
-
esp_err_t
periph_wifi_config_start(esp_periph_handle_t periph, periph_wifi_config_mode_t mode)¶ Start Wi-Fi network setup in
mode- Return
- ESP_OK
- ESP_FAIL
- Parameters
periph: The periphmode: The mode
-
esp_err_t
periph_wifi_config_wait_done(esp_periph_handle_t periph, TickType_t tick_to_wait)¶ Wait for Wi-Fi setup done.
- Return
- ESP_OK
- ESP_FAIL
- Parameters
periph: The periphtick_to_wait: The tick to wait
Enumerations¶
-
enum
periph_wifi_state_t¶ Peripheral Wi-Fi event id.
Values:
-
PERIPH_WIFI_UNCHANGE= 0¶
-
PERIPH_WIFI_CONNECTING¶
-
PERIPH_WIFI_CONNECTED¶
-
PERIPH_WIFI_DISCONNECTED¶
-
PERIPH_WIFI_SETTING¶
-
PERIPH_WIFI_CONFIG_DONE¶
-
PERIPH_WIFI_CONFIG_ERROR¶
-
PERIPH_WIFI_ERROR¶
-
-
enum
periph_wifi_config_mode_t¶ Wi-Fi setup mode type.
Values:
-
WIFI_CONFIG_ESPTOUCH¶ Using smartconfig with ESPTOUCH protocol
-
WIFI_CONFIG_AIRKISS¶ Using smartconfig with AIRKISS protocol
-
WIFI_CONFIG_ESPTOUCH_AIRKISS¶ Using smartconfig with ESPTOUCH_AIRKISS protocol
-
WIFI_CONFIG_WPS¶ Using WPS (not support)
-
WIFI_CONFIG_BLUEFI¶ Using BLUEFI
-
WIFI_CONFIG_WEB¶ Using HTTP Server (not support)
-