7#include "net/wifi_client.hpp"
42 bool RegisterHandlers();
43 void UnregisterHandlers();
44 void ResetConnectionState();
54 static void EventHandler(
void* arg, esp_event_base_t event_base, int32_t event_id,
57 static inline bool is_initialized_ =
59 static inline esp_netif_t* netif_ =
nullptr;
61 bool init_ok_ =
false;
62 bool enabled_ =
false;
63 bool handlers_registered_ =
false;
64 bool connected_ =
false;
66 char ip_str_[16] = {};
67 esp_event_handler_instance_t wifi_connected_handler_ =
nullptr;
68 esp_event_handler_instance_t wifi_disconnected_handler_ =
nullptr;
69 esp_event_handler_instance_t got_ip_handler_ =
nullptr;
70 esp_event_handler_instance_t lost_ip_handler_ =
nullptr;
ESP32 Wi-Fi 客户端实现 / ESP32 Wi-Fi client implementation.
MACAddressRaw GetMACAddress() const override
获取当前 MAC 地址 / Get MAC address
IPAddressRaw GetIPAddress() const override
获取当前 IP 地址 / Get current IP address
WifiError Connect(const Config &config) override
连接到指定 WiFi 网络 / Connect to a WiFi network
void Disable() override
禁用网络接口(WiFi) / Disable the network interface
int GetRSSI() const override
获取当前 WiFi 信号强度(RSSI) / Get current signal strength
bool Enable() override
启用网络接口(WiFi) / Enable the network interface
WifiError Disconnect() override
断开当前 WiFi 连接 / Disconnect from the WiFi network
bool IsConnected() const override
检查是否已连接 / Check if currently connected
WifiError Scan(ScanResult *out_list, size_t max_count, size_t &out_found) override
扫描可用网络 / Scan for available WiFi networks
信号量类,实现线程同步机制 Semaphore class implementing thread synchronization
WiFi 客户端接口 / WiFi Client Interface.
WifiError
WiFi 错误码 / Enumeration of WiFi error codes.
LibXR 命名空间 / LibXR namespace.
原始 IPv4 地址 / Raw IPv4 address
原始 MAC 地址 / Raw MAC address
WiFi 连接配置 / WiFi connection configuration.
WiFi 扫描结果 / WiFi scan result.