luat_soc_sdk_2024 V1.0
luat_wlan.h
浏览该文件的文档.
1#ifndef LUAT_WLAN_H
2#define LUAT_WLAN_H
3
4#include "luat_base.h"
5#ifdef __LUATOS__
6#include "luat_msgbus.h"
7#include "luat_mem.h"
8#endif
9typedef struct luat_wlan_config
10{
11 uint32_t mode;
13
23
24typedef struct luat_wlan_apinfo
25{
26 char ssid[36];
27 char password[64];
28 uint8_t gateway[4];
29 uint8_t netmask[4];
30 uint8_t channel;
31 uint8_t encrypt;
32 uint8_t hidden;
33 uint8_t max_conn;
35
43
44
51
53{
54 char ssid[33];
55 char bssid[6];
56 int16_t rssi;
57 uint8_t ch;
59
67
68
76
78
79// 配网相关
80// --- smartconfig 配网
88
91
92// 数据类
93int luat_wlan_get_mac(int id, char* mac);
94int luat_wlan_set_mac(int id, const char* mac);
95int luat_wlan_get_ip(int type, char* data);
96const char* luat_wlan_get_hostname(int id);
97int luat_wlan_set_hostname(int id, const char* hostname);
98
99// 设置和获取省电模式
100int luat_wlan_set_ps(int mode);
102
106
107// AP类
110
111
112
117#define Luat_MAX_CHANNEL_NUM 14
124
127{
128 int maxTimeOut; //ms, 最大执行时间 取值范围4000~255000
129 uint8_t round; //wifiscan total round 取值范围1~3
130 uint8_t maxBssidNum; //wifiscan max report num 取值范围4~40
131 uint8_t scanTimeOut; //s, max time of each round executed by RRC 取值范围1~255
132 uint8_t wifiPriority; //CmiWifiScanPriority
133 uint8_t channelCount; //channel count; if count is 1 and all channelId are 0, UE will scan all frequecny channel
134 uint8_t rsvd[3];
135 uint16_t channelRecLen; //ms, max scantime of each channel
136 uint8_t channelId[Luat_MAX_CHANNEL_NUM]; //channel id 1-14: scan a specific channel
138
139
140#define LUAT_MAX_WIFI_BSSID_NUM 40
141#define LUAT_MAX_SSID_HEX_LENGTH 32
142
154
162
170#endif
#define LUAT_MAX_SSID_HEX_LENGTH
SSID 的最大长度
int32_t luat_get_wifiscan_cell_info(luat_wifiscan_set_info_t *set_info, luat_wifisacn_get_info_t *get_info)
获取wifiscan 的信息
struct luat_wifisacn_get_info luat_wifisacn_get_info_t
wifiscan 扫描结果
#define LUAT_MAX_WIFI_BSSID_NUM
bssid 的最大数量
struct luat_wifiscan_set_info luat_wifiscan_set_info_t
wifiscan 控制参数结构体
#define Luat_MAX_CHANNEL_NUM
enum luat_wifiscan_set_priority luat_wifiscan_set_priority_t
wifiscan 扫描的优先级
int luat_wlan_scan_nonblock(luat_wifiscan_set_info_t *set_info)
获取wifiscan 的信息
luat_wifiscan_set_priority
wifiscan 扫描的优先级
@ LUAT_WIFISCAN_WIFI_PERFERRD
@ LUAT_WIFISCAN_DATA_PERFERRD
int luat_wlan_get_ip(int type, char *data)
int luat_wlan_ap_start(luat_wlan_apinfo_t *apinfo)
int luat_wlan_set_station_ip(luat_wlan_station_info_t *info)
LUAT_WLAN_MODE
@ LUAT_WLAN_MODE_APSTA
@ LUAT_WLAN_MODE_STA
@ LUAT_WLAN_MODE_NULL
@ LUAT_WLAN_MODE_MAX
@ LUAT_WLAN_MODE_AP
int luat_wlan_ap_stop(void)
int luat_wlan_set_mac(int id, const char *mac)
struct luat_wlan_apinfo luat_wlan_apinfo_t
int luat_wlan_get_ap_gateway(char *buff)
LUAT_WLAN_ENCRYPT_MODE
@ LUAT_WLAN_ENCRYPT_NONE
@ LUAT_WLAN_ENCRYPT_WPA2
@ LUAT_WLAN_ENCRYPT_WPA
@ LUAT_WLAN_ENCRYPT_AUTO
struct luat_wlan_scan_result luat_wlan_scan_result_t
int luat_wlan_set_ps(int mode)
LUAT_WLAN_SC_TYPE
@ LUAT_SC_TYPE_AIRKISS
@ LUAT_SC_TYPE_ESPTOUCH_V2
@ LUAT_SC_TYPE_ESPTOUCH
@ LUAT_SC_TYPE_STOP
@ LUAT_SC_TYPE_ESPTOUCH_AIRKISS
int luat_wlan_scan_get_result(luat_wlan_scan_result_t *results, size_t ap_limit)
int luat_wlan_smartconfig_stop(void)
const char * luat_wlan_get_hostname(int id)
int luat_wlan_connect(luat_wlan_conninfo_t *info)
struct luat_wlan_station_info luat_wlan_station_info_t
int luat_wlan_set_hostname(int id, const char *hostname)
struct luat_wlan_conninfo luat_wlan_conninfo_t
int luat_wlan_init(luat_wlan_config_t *conf)
int luat_wlan_mode(luat_wlan_config_t *conf)
int luat_wlan_disconnect(void)
int luat_wlan_smartconfig_start(int tp)
int luat_wlan_get_ap_bssid(char *buff)
int luat_wlan_get_ap_rssi(void)
int luat_wlan_get_mac(int id, char *mac)
int luat_wlan_scan(void)
struct luat_wlan_config luat_wlan_config_t
int luat_wlan_get_ps(void)
int luat_wlan_ready(void)
wifiscan 扫描结果
int8_t rssi[LUAT_MAX_WIFI_BSSID_NUM]
uint8_t channel[LUAT_MAX_WIFI_BSSID_NUM]
uint8_t ssidHex[LUAT_MAX_WIFI_BSSID_NUM][LUAT_MAX_SSID_HEX_LENGTH]
uint8_t bssid[LUAT_MAX_WIFI_BSSID_NUM][6]
uint8_t ssidHexLen[LUAT_MAX_WIFI_BSSID_NUM]
wifiscan 控制参数结构体
uint8_t channelId[Luat_MAX_CHANNEL_NUM]
uint32_t auto_reconnection_delay_sec