6#include "libxr_def.hpp"
提供一个通用的回调包装,支持动态参数传递。 Provides a generic callback wrapper, supporting dynamic argument passing.
Wifi 客户端接口类 / Interface class for WiFi client management.
virtual bool IsConnected() const =0
检查是否已连接 / Check if currently connected
virtual WifiError Connect(const Config &config)=0
连接到 WiFi 网络 / Connect to a WiFi network
virtual WifiError Disable()=0
禁用 WiFi 模块 / Disable the WiFi module
Security
WiFi 安全类型 / WiFi security types.
@ WPA2_PSK
WPA2-PSK / WPA2-PSK.
@ OPEN
开放网络 / Open network
@ WPA2_ENTERPRISE
WPA2 企业认证 / WPA2 Enterprise.
virtual WifiError Enable()=0
启用 WiFi 模块 / Enable the WiFi module
WifiError
WiFi 错误码枚举 / Enumeration of WiFi error codes.
@ DHCP_FAILED
DHCP 获取失败 / DHCP acquisition failed.
@ INVALID_CONFIG
配置无效 / Invalid configuration
@ AUTHENTICATION_FAILED
身份验证失败 / Authentication failed
@ UNKNOWN
未知错误 / Unknown error
@ HARDWARE_FAILURE
硬件故障 / Hardware failure
@ SCAN_FAILED
扫描失败 / Scan failed
@ ALREADY_ENABLED
已启用 / Already enabled
@ NOT_ENABLED
未启用 / Not enabled
@ CONNECTION_TIMEOUT
连接超时 / Connection timeout
@ SSID_NOT_FOUND
找不到 SSID / SSID not found
virtual WifiError Disconnect()=0
断开当前 WiFi 连接 / Disconnect from the current WiFi connection
virtual const char * GetIPAddress() const =0
获取当前 IP 地址 / Get the current IP address
virtual WifiError Scan(std::vector< ScanResult > &results)=0
扫描可用 WiFi 网络 / Scan for available WiFi networks
virtual int GetRSSI() const =0
获取当前 WiFi 信号强度 / Get the current WiFi signal strength
LibXR Color Control Library / LibXR终端颜色控制库
constexpr auto min(T1 a, T2 b) -> typename std::common_type< T1, T2 >::type
计算两个数的最小值
WiFi 连接配置 / WiFi connection configuration.
bool use_dhcp
是否使用 DHCP / Whether to use DHCP
std::string password
密码 / Password
std::string ssid
SSID 名称 / SSID name.
Security security
安全类型 / Security type
StaticIPConfig * static_ip_config
静态 IP 配置(可选) / Static IP config (optional)
EnterpriseConfig * enterprise_config
企业认证配置(可选) / Enterprise authentication config (optional)
企业 WiFi 配置 / Enterprise WiFi configuration
std::string identity
EAP 身份标识 / EAP identity.
std::string client_key
客户端密钥路径 / Client key path
std::string ca_cert
CA 证书路径 / CA certificate path.
std::string username
用户名 / Username
std::string password
密码 / Password
std::string client_cert
客户端证书路径 / Client certificate path
WiFi 扫描结果 / WiFi scan result.
std::string ssid
发现的 SSID / Detected SSID
int rssi
信号强度 / Signal strength (RSSI)
Security security
安全类型 / Security type
静态 IP 配置 / Static IP configuration
std::string gateway
网关地址 / Gateway address
std::string netmask
子网掩码 / Netmask
std::string ip
IP 地址 / IP address.
std::string dns
DNS 服务器 / DNS server.