6#include "net/wifi_client.hpp"
51 static void EventHandler(
void* arg, esp_event_base_t event_base, int32_t event_id,
56 static inline esp_netif_t*
netif_ =
nullptr;
ESP32 平台的 WiFi 客户端实现 / WiFi client implementation for ESP32.
MACAddressRaw GetMACAddress() const override
获取当前 MAC 地址 / Get MAC address
static bool is_initialized_
ESP 网络是否已初始化 / Netif initialized.
bool connected_
是否连接 / Whether WiFi is connected
IPAddressRaw GetIPAddress() const override
获取当前 IP 地址 / Get current IP address
LibXR::Semaphore semaphore_
状态同步信号量 / Event wait semaphore
WifiError Connect(const Config &config) override
连接到指定 WiFi 网络 / Connect to a WiFi network
uint8_t mac_[6]
当前 MAC 缓存 / Cached MAC address
void Disable() override
禁用网络接口(WiFi) / Disable the network interface
static esp_netif_t * netif_
ESP 默认 netif 对象 / Default netif.
bool enabled_
是否启用 / Whether WiFi is enabled
int GetRSSI() const override
获取当前 WiFi 信号强度(RSSI) / Get current signal strength
bool got_ip_
是否获取 IP / Whether IP is acquired
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
static void EventHandler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data)
事件处理回调 / Event handler callback
WifiError Scan(ScanResult *out_list, size_t max_count, size_t &out_found) override
扫描可用网络 / Scan for available WiFi networks
char ip_str_[16]
当前 IP 字符串 / Current IP string
信号量类,实现线程同步机制 Semaphore class implementing thread synchronization
WiFi 客户端接口 / WiFi Client Interface.
WifiError
WiFi 错误码 / Enumeration of WiFi error codes.
原始 IPv4 地址 / Raw IPv4 address
原始 MAC 地址 / Raw MAC address
WiFi 连接配置 / WiFi connection configuration.
WiFi 扫描结果 / WiFi scan result.