7 #ifndef LINUX_LIBV2_SOURCE_WIFI_LIB_WIFI_H_ 8 #define LINUX_LIBV2_SOURCE_WIFI_LIB_WIFI_H_ 14 #include <sys/ioctl.h> 15 #include <netinet/in.h> 19 #define WIFI_API extern "C" WIFI_API int get_wifi_status_value(struct wpa_ctrl *ctrl, char *key, char *dest, int dest_size)
通过"STATUS"指令,获取所需参数。
WIFI_API int disconnect_wifi(struct wpa_ctrl *ctrl)
关闭WIFI使能
WIFI_API int scan_result(struct wpa_ctrl *ctrl, struct WIFI *wifi, int index)
获取WIFI扫描结果
WIFI_API struct WIFI * init_wifi()
初始化WIFI结构体
WIFI_API int scan(struct wpa_ctrl *ctrl)
扫描WIFI列表
WIFI_API int reconnect_wifi(struct wpa_ctrl *ctrl)
开启WIFI使能
WIFI_API void display_wifi(struct WIFI *wifi)
WIFI_API int get_wifi_rssi(struct wpa_ctrl *ctrl)
获取已连接的wifi的信号强度
WIFI_API int connect_wifi(struct wpa_ctrl *ctrl, char *ssid, char *passwork)
连接wifi
WIFI_API int send_command(struct wpa_ctrl *ctrl, char *cmd)
用于发送只返回OK,FAIL的指令
WIFI_API int Extract_information(char *src, char *dest, char *key, int dest_size)
提取特定类型的字符串
WIFI_API void release_wifi(struct WIFI *wifi)
释放WIFI指针