libxr 1.0
Want to be the best embedded framework
|
Public Member Functions | |
WifiError | Enable () override |
启用 WiFi 模块 / Enable the WiFi module | |
WifiError | Disable () override |
禁用 WiFi 模块 / Disable the WiFi module | |
WifiError | Connect (const Config &config) override |
连接到 WiFi 网络 / Connect to a WiFi network | |
WifiError | Disconnect () override |
断开当前 WiFi 连接 / Disconnect from the current WiFi connection | |
bool | IsConnected () const override |
检查是否已连接 / Check if currently connected | |
const char * | GetIPAddress () const override |
获取当前 IP 地址 / Get the current IP address | |
WifiError | Scan (std::vector< ScanResult > &results) override |
扫描可用 WiFi 网络 / Scan for available WiFi networks | |
int | GetRSSI () const override |
获取当前 WiFi 信号强度 / Get the current WiFi signal strength | |
Static Private Member Functions | |
static void | EventHandler (void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data) |
Private Attributes | |
bool | enabled_ = false |
bool | connected_ = false |
bool | got_ip_ = false |
char | ip_str_ [IP4ADDR_STRLEN_MAX] = {} |
LibXR::Semaphore | semaphore_ |
Static Private Attributes | |
static bool | is_initialized_ = false |
static esp_netif_t * | netif_ = nullptr |
Additional Inherited Members | |
![]() | |
enum class | WifiError { NONE , ALREADY_ENABLED , NOT_ENABLED , CONNECTION_TIMEOUT , AUTHENTICATION_FAILED , DHCP_FAILED , SSID_NOT_FOUND , INVALID_CONFIG , HARDWARE_FAILURE , SCAN_FAILED , UNKNOWN } |
WiFi 错误码枚举 / Enumeration of WiFi error codes. More... | |
enum class | Security { OPEN , WPA2_PSK , WPA2_ENTERPRISE , UNKNOWN } |
WiFi 安全类型 / WiFi security types. More... | |
using | WifiCallback = LibXR::Callback< WifiError > |
WiFi 状态回调 / Callback type for WiFi status. | |
Definition at line 11 of file esp_wifi_client.hpp.
LibXR::ESP32WifiClient::ESP32WifiClient | ( | ) |
Definition at line 15 of file esp_wifi_client.cpp.
|
override |
Definition at line 30 of file esp_wifi_client.cpp.
|
overridevirtual |
连接到 WiFi 网络 / Connect to a WiFi network
config | 配置参数 / Configuration parameters |
Implements LibXR::WifiClient.
Definition at line 64 of file esp_wifi_client.cpp.
|
overridevirtual |
禁用 WiFi 模块 / Disable the WiFi module
Implements LibXR::WifiClient.
Definition at line 54 of file esp_wifi_client.cpp.
|
overridevirtual |
断开当前 WiFi 连接 / Disconnect from the current WiFi connection
Implements LibXR::WifiClient.
Definition at line 95 of file esp_wifi_client.cpp.
|
overridevirtual |
启用 WiFi 模块 / Enable the WiFi module
Implements LibXR::WifiClient.
Definition at line 38 of file esp_wifi_client.cpp.
|
staticprivate |
Definition at line 149 of file esp_wifi_client.cpp.
获取当前 IP 地址 / Get the current IP address
Implements LibXR::WifiClient.
Definition at line 115 of file esp_wifi_client.cpp.
|
overridevirtual |
获取当前 WiFi 信号强度 / Get the current WiFi signal strength
Implements LibXR::WifiClient.
Definition at line 192 of file esp_wifi_client.cpp.
|
overridevirtual |
检查是否已连接 / Check if currently connected
Implements LibXR::WifiClient.
Definition at line 113 of file esp_wifi_client.cpp.
|
overridevirtual |
扫描可用 WiFi 网络 / Scan for available WiFi networks
results | 扫描结果列表 / Output list of scan results |
Implements LibXR::WifiClient.
Definition at line 117 of file esp_wifi_client.cpp.
Definition at line 34 of file esp_wifi_client.hpp.
Definition at line 33 of file esp_wifi_client.hpp.
Definition at line 35 of file esp_wifi_client.hpp.
|
private |
Definition at line 36 of file esp_wifi_client.hpp.
Definition at line 30 of file esp_wifi_client.hpp.
|
inlinestaticprivate |
Definition at line 31 of file esp_wifi_client.hpp.
|
private |
Definition at line 38 of file esp_wifi_client.hpp.