Class WiFi¶
Defined in File WiFi.h
Class Documentation¶
-
class
network
::
WiFi
¶ Wi-Fi manager class.
Public Functions
-
esp_err_t
init
()¶ Initialize Wi-Fi.
- Return
ESP_OK: succeed
(others): failed
-
esp_err_t
setMode
(wifi_mode_t mode)¶ Set Wi-Fi operation mode.
- Return
ESP_OK: succeed
(others): failed
- Parameters
mode
: operation mode
-
esp_err_t
getMode
(wifi_mode_t &mode)¶ Get the Wi-Fi operation mode.
- Return
ESP_OK: succeed
(others): failed
- Parameters
mode
: return value
-
esp_err_t
setApConfig
(wifi_config_t &ap_config)¶ Set the AP configuration.
- Return
ESP_OK: succeed
(others): failed
- Parameters
ap_config
: AP mode configuration
-
esp_err_t
getApConfig
(wifi_config_t &ap_config)¶ Get the AP configuration.
- Return
ESP_OK: succeed
(others): failed
- Parameters
[out] ap_config
: return value
-
esp_err_t
setStaConfig
(wifi_config_t &sta_config)¶ Set the STA configuration.
- Return
ESP_OK: succeed
(others): failed
- Parameters
sta_config
: ST mode configuration
-
esp_err_t
getStaConfig
(wifi_config_t &sta_config)¶ Get the STA configuration.
- Return
ESP_OK: succeed
(others): failed
- Parameters
[out] sta_config
: return value
-
bool
isAp
()¶ Checks if the Wi-Fi mode is AP.
- Return
true: is AP
- Return
false: isn’t AP
-
bool
isSta
()¶ Checks if the Wi-Fi mode is STA.
- Return
true: is AP
- Return
false: is STA
-
esp_err_t
start
()¶ Start Wi-Fi operation mode.
- Attention
1. WiFi::init must have been called
- Return
ESP_OK: succeed
(others): failed
-
esp_err_t
connect
()¶ - Attention
1. WiF::init must have been called
- Return
ESP_OK: succeed -(others) : failed
-
void
setEventHandler
(std::unique_ptr<WiFiEventHandler> &&event_handler)¶ Set callback handler to catch WiFi events outside of class itself.
-
esp_err_t