blob: 3cba081ad1d6b304ad8f42e42ba4f2a8fe1e0f38 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/**
2* @file Wifi_msg.h
3* @brief ÌṩwifiÉèÖõÄÏûÏ¢½Ó¿Ú
4*
5* Copyright (C) 2017 Sanechips Technology Co., Ltd.
6* @author Linxu Gebin
7*
8* This program is free software; you can redistribute it and/or modify
9* it under the terms of the GNU General Public License version 2 as
10* published by the Free Software Foundation.
11*
12************************************************************************
13*/
14
15#ifndef __WIFI_MSG_H__
16#define __WIFI_MSG_H__
17
18#include "message.h"
19#include "wifi.h"
20
21
22/**
23* @brief ¶¨ÒåwifiÏûÏ¢
24 * @param MSG_CMD_WIFI_BASE ÉèÖÃÖ÷ssidµÄ»ù±¾²ÎÊýÏûÏ¢
25 * @param MSG_CMD_WIFI_SSID_M ÉèÖø±ssidµÄ»ù±¾²ÎÊýÏûÏ¢
26 * @param MSG_CMD_WIFI_CLOSE ¹Ø±ÕwifiÏûÏ¢
27 * @param MSG_CMD_WIFI_OPEN ¿ªÆôwifiÏûÏ¢
28 * @param MSG_CMD_WIFI_RESTART ÖØÆôwifiÏûÏ¢
29 * @param MSG_CMD_WIFI_ADVANCED wifiµÄ¸ß¼¶²ÎÊýÉèÖÃÏûÏ¢
30 * @param MSG_CMD_WIFI_WPS ¿ªÆôWPS¹¦ÄÜÏûÏ¢
31 * @param MSG_CMD_WIFI_WPS_UP WPSÄ£¿é·¢À´µÄWPSÆô¶¯ÏûÏ¢
32 * @param MSG_CMD_WIFI_WPS_DOWN WPSÄ£¿é·¢À´µÄWPS ¹Ø±ÕÏûÏ¢
33 * @param MSG_CMD_WIFI_SLEEP WEBUIÉèÖÃ˯Ãßʱ³¤ÏûÏ¢
34 * @param MSG_CMD_CAPTURE_STATION ²éѯstaµÄÁ¬½ÓÇé¿öÏûÏ¢
35 * @param MSG_CMD_WIFI_COVERAGE ÉèÖÃwifiµÄ¸²¸Ç·¶Î§ÏûÏ¢
36 * @param MSG_CMD_WIFI_MAC ÉèÖÃmac¹ýÂ˹¦ÄÜÏûÏ¢
37 * @param MSG_CMD_USB_CHARGING_CHANGED Çý¶¯¼ì²âµ½usb³äµç״̬±ä»¯Éϱ¨ÏûÏ¢
38 * @param MSG_CMD_WIFI_STATION_OPEN ´ò¿ªapsta¹¦ÄÜÏûÏ¢
39 * @param MSG_CMD_WIFI_STATION_CLOSE ¹Ø±Õapsta¹¦ÄÜÏûÏ¢
40 * @param MSG_CMD_WIFI_STATION_CLOSE_OPEN_MSSID ´ò¿ªapsta£¬¹Ø±Õ¶àssidÏûÏ¢
41 * @param MSG_CMD_WIFI_STATION_SCAN ɨÃèÈȵãÏûÏ¢
42 * @param MSG_CMD_WIFI_STATION_CONNECT Á¬½ÓÈȵãÏûÏ¢
43 * @param MSG_CMD_WIFI_STATION_CONNECT_TIMEOUT Á¬½Ó³¬Ê±µÄ´¦ÀíÏûÏ¢
44 * @param MSG_CMD_WIFI_STATION_SIM_INIT_TIMER_PROCESS ²éѯsim¿¨ÓÐÎÞÆôÓõĶ¨Ê±Æ÷ÏûÏ¢
45 * @param MSG_CMD_WIFI_STATION_GET_SCAN_RESULTS_TIMER_PROCESS wpa_supplicantÖ÷¶¯É¨ÃèÏûÏ¢
46 * @param MSG_CMD_WIFI_STATION_DISCONNECT Ö÷¶¯¶Ï¿ªÕýÔÚÁ¬½ÓµÄÈȵãÏûÏ¢
47 * @param MSG_CMD_WIFI_STATION_SPOT_UPDATE ¸üÐÂÈȵãÁбíÏûÏ¢
48 * @param MSG_CMD_WIFI_STATION_EVENT_CONNECTING wpa_supplicantÕýÔÚ³¢ÊÔÁ¬½ÓʼþÏûÏ¢
49 * @param MSG_CMD_WIFI_STATION_EVENT_CONNECTED apstaÓëÈȵãÁ¬½Ó³É¹¦Í¨ÖªÏûÏ¢
50 * @param MSG_CMD_WIFI_STATION_EVENT_DISCONNECTED apstaÓëÈȵã¶Ï¿ªÁ¬½Ó֪ͨÏûÏ¢
51 * @param MSG_CMD_BLC_OPEN_WIFISTATION_ACCESS blc·¢Ë͵ÄÁ¬½Ó³É¹¦£¬stationµÄipÒÑ·ÖÅäµ½ÏûÏ¢
52 * @param MSG_CMD_BLC_OPEN_WIFISTATION_ACCESS blc·¢À´ÏûÏ¢´ò¿ªapstaÁ¬½ÓÏûÏ¢
53 * @param MSG_CMD_BLC_CLOSE_WIFISTATION_ACCESS blc·¢À´ÏûÏ¢¶Ï¿ªapstaÁ¬½ÓÏûÏ¢
54 * @param MSG_CMD_WIFI_STATION_NO_AVAILABLE_AP apstaÎÞЧÏûÏ¢
55 * @param MSG_CMD_WIFI_STATION_END apstationµÄÏûÏ¢·¶Î§end
56 * @param MSG_CMD_WIFI_TSW_SET ÉèÖö¨Ê±Ë¯Ãß»½ÐѵÄÏûÏ¢
57 * @param MSG_CMD_WIFI_TSW_CLOSE ¹Ø±Õ¶¨Ê±Ë¯Ãß»½Ðѹ¦ÄܵÄÏûÏ¢
58 * @param MSG_CMD_RTC_TIME_UPDATE ¸üÐÂÐèÖØÐÂÉèÖö¨Ê±Ë¯Ãß»½ÐÑÏûÏ¢
59 * @param MSG_CMD_WIFI_RESET_TIMER mmi°´¼üÖØÐÂÉèÖÃ˯Ãßtimer
60*/
61enum wifi_msg_cmd {
62 MSG_CMD_WIFI_CFG_AP = MSG_CMD_WIFI_BASE, //ÉèÖÃÖ÷ssidµÄ»ù±¾²ÎÊýµÄÏûÏ¢4001
63 MSG_CMD_WIFI_CFG_AP2, //ÉèÖø±ssidµÄ»ù±¾²ÎÊýµÄÏûÏ¢
64 //³ýMMIÆäËûÄ£¿é²»Ó¦¸Ã´¦Àí¼Ù¹Ø»úµÄÂß¼­£¬ÓÉMMIÌṩ1¸ö¹Ø»ú²»±£´æNV£¬ÐèÒªµÄÄ£¿é¶ÁÈ¡ÅжÏÊÇ·ñ¼Ù¹Ø»ú¼´¿É
65 //MSG_CMD_WIFI_CLOSE_FAST, //ÉèÖÿìËٹػúµÄÏûÏ¢
66 MSG_CMD_WIFI_CLOSE, //¹Ø±ÕwifiµÄÏûÏ¢
67 MSG_CMD_WIFI_OPEN, //¿ªÆôwifiµÄÏûÏ¢
68 MSG_CMD_WIFI_FORCE_RESTART, //CrashºóÇ¿ÖÆÖØÆôwifiµÄÏûÏ¢
69 MSG_CMD_WIFI_ADVANCED, //wifiµÄ¸ß¼¶²ÎÊýÉèÖÃÏûÏ¢
70 MSG_CMD_WIFI_WPS, //¿ªÆôWPS¹¦ÄÜ£¬2·ÖÖÓ×Ô¶¯¹Ø£¬¹Ê²»ÐèÒª¹Ø±ÕÏûÏ¢
71 MSG_CMD_WIFI_WPS_UP, //WPSÄ£¿é·¢À´µÄWPSÆô¶¯µÄÏûÏ¢
72 MSG_CMD_WIFI_WPS_DOWN, //WPSÄ£¿é·¢À´µÄWPS ¹Ø±ÕµÄÏûÏ¢
73 MSG_CMD_WIFI_SLEEP, //WEBUIÉèÖÃ˯Ãßʱ³¤µÄÏûÏ¢
74 MSG_CMD_CAPTURE_STATION, //²éѯstaµÄÁ¬½ÓÇé¿ö
75 MSG_CMD_WIFI_COVERAGE, //ÉèÖÃwifiµÄ¸²¸Ç·¶Î§
76 MSG_CMD_WIFI_MAC, //ÉèÖÃmac¹ýÂ˹¦ÄÜ
77 MSG_CMD_WIFI_CHANNEL_FOLLOW, //ÉèÖÃwifi APÐŵÀ¸úËæSTA
78
79 MSG_CMD_USB_CHARGING_CHANGED, //Çý¶¯¼ì²âµ½usb³äµç״̬±ä»¯Éϱ¨ÏûÏ¢
80
81 //for apstation
82 MSG_CMD_WIFI_STATION_OPEN, //´ò¿ªapsta¹¦ÄÜ
83 MSG_CMD_WIFI_STATION_OPEN_SUCCESS, //0x4010
84 MSG_CMD_WIFI_STATION_OPEN_FAIL,
85 MSG_CMD_WIFI_STATION_CLOSE, //¹Ø±Õapsta¹¦ÄÜ
86 MSG_CMD_WIFI_STATION_CLOSE_SUCCESS,
87 MSG_CMD_WIFI_STATION_CLOSE_OPEN_MSSID, //´ò¿ªapsta£¬¹Ø±Õ¶àssid
88 MSG_CMD_WIFI_STATION_SCAN, //ɨÃèÈȵã
89 MSG_CMD_WIFI_STATION_CONNECT, //Á¬½ÓÈȵã
90 MSG_CMD_WIFI_STATION_CONNECT_TIMEOUT, //Á¬½Ó³¬Ê±µÄ´¦ÀíÏûÏ¢
91
92 MSG_CMD_WIFI_STATION_SIM_INIT_TIMER_PROCESS, //eap-sim/aka¹¦ÄÜ£¬²éѯsim¿¨ÓÐÎÞÆôÓõĶ¨Ê±Æ÷ÏûÏ¢
93 MSG_CMD_WIFI_STATION_GET_SCAN_RESULTS, // wpa_supplicantÖ÷¶¯É¨Ãè8sÒ»´Î
94 MSG_CMD_WIFI_STATION_DISCONNECT, //Ö÷¶¯¶Ï¿ªÕýÔÚÁ¬½ÓµÄÈȵã
95 MSG_CMD_WIFI_STATION_SPOT_UPDATE, //¸üÐÂÈȵãÁбí
96 MSG_CMD_WIFI_STATION_EVENT_CONNECTING, //wpa_supplicantÕýÔÚ³¢ÊÔÁ¬½ÓʼþÏûÏ¢
97 MSG_CMD_WIFI_STATION_EVENT_CONNECTED, //apstaÓëÈȵãÁ¬½Ó³É¹¦Í¨ÖªÏûÏ¢
98 MSG_CMD_WIFI_STATION_EVENT_DISCONNECTED, //apstaÓëÈȵã¶Ï¿ªÁ¬½Ó֪ͨÏûÏ¢
99 MSG_CMD_WIFI_STATION_BLC_CONNECTED, //blc·¢Ë͵ÄÁ¬½Ó³É¹¦£¬stationµÄipÒÑ·ÖÅäµ½
100 MSG_CMD_BLC_OPEN_WIFISTATION_ACCESS, //blc·¢À´ÏûÏ¢´ò¿ªapstaÁ¬½Ó//0x4020
101 MSG_CMD_BLC_CLOSE_WIFISTATION_ACCESS, //blc·¢À´ÏûÏ¢¶Ï¿ªapstaÁ¬½Ó
102 MSG_CMD_WIFI_STATION_NO_AVAILABLE_AP,
103 MSG_CMD_WIFI_STATION_FORGET, //
104 MSG_CMD_WIFI_STATION_INDICATE_SCAN_RESULTS,
105 MSG_CMD_WIFI_STATION_CONNECT_FAIL,
106 MSG_CMD_WIFI_STATION_SUPPLICANT_EVT, //
107 MSG_CMD_WIFI_STATION_TEMP_DISABLED, //apstaδ³É¹¦Á¬½ÓÉÏÈȵãµÄ¹ý¶Éʼþ£¬Ö®ºó»á×Ô¶¯ÖØÁ¬
108 MSG_CMD_WIFI_STATION_FAILED_SET, //apstaδ³É¹¦Á¬½ÓÉÏÈȵãµÄ¼øÈ¨Ê§°Üʼþ£¬Ö®ºó²»ÖØÁ¬
109
110 MSG_CMD_WIFI_STATION_DEBUG_DUMP,
111 MSG_CMD_WIFI_STATION_WPA_CMD,
112 MSG_CMD_WIFI_STATION_CONNECTED_ENABLE_AP_CMD, //apstaÁ¬½ÓÈȵã³É¹¦Æô¶¯ap
113 MSG_CMD_WIFI_STATION_END, //apstationµÄÏûÏ¢·¶Î§end
114
115 //timing of sleep wake up
116 MSG_CMD_WIFI_TSW_SET, //ÉèÖö¨Ê±Ë¯Ãß»½ÐѵÄÏûÏ¢
117 MSG_CMD_WIFI_TSW_CLOSE, //¹Ø±Õ¶¨Ê±Ë¯Ãß»½Ðѹ¦ÄܵÄÏûÏ¢
118 MSG_CMD_RTC_TIME_UPDATE, //rtcʱ¼ä ¸üÐÂÐèÖØÐÂÉèÖö¨Ê±Ë¯Ãß»½ÐÑ
119 MSG_CMD_WIFI_RESET_TIMER, //mmi°´¼üÖØÐÂÉèÖÃ˯Ãßtimer
120
121
122 /***************wifi OPENCPUÏûÏ¢****************/
123 MSG_CMD_WIFI_SWITCH_REQ,
124 MSG_CMD_WIFI_SWITCH_RSP,
125 MSG_CMD_WIFI_CFG_SSID_REQ, //0x4030
126 MSG_CMD_WIFI_CFG_SSID_RSP,
127 MSG_CMD_WIFI_CFG_PWD_REQ,
128 MSG_CMD_WIFI_CFG_PWD_RSP,
129 /***************wifi OPENCPUÏûÏ¢****************/
130 MSG_CMD_AP_STA_CONNECTED,
131 MSG_CMD_AP_STA_DISCONNECTED,
132
133};
134
135
136#define WIFI_SSID_LEN 33
137#define WLAN_PSK_LEN 65
138#define WLAN_SECURITY_LEN 20
139#define WLAN_ENCRYPT_LEN 10
140#define WLAN_DEFAULTID_LEN 4
141#define WLAN_WEPKEY_LEN 32
142#define WLAN_ENCODE_PSK_LEN 100
143#define WLAN_MAX_ACCESS_NUM_LEN 4
144#define WLAN_HIDESSID_LEN 4
145#define WF_AUTH_OPEN "OPEN"
146#define WF_AUTH_SHARE "SHARED"
147#define WF_AUTH_WEPAUTO "WEPAUTO"
148#define WF_AUTH_WPA "WPAPSK"
149#define WF_AUTH_WPA2 "WPA2PSK"
150#define WF_AUTH_WPA_WPA2 "WPAPSKWPA2PSK"
151#define WF_AUTH_WAPIPSK "WAPIPSK"
152#define WF_ENCRP_NONE "NONE" //encrypt
153#define WF_ENCRP_WEP "WEP"
154#define WF_ENCRP_TKIP "TKIP"
155#define WF_ENCRP_CCMP "CCMP"
156#define WF_ENCRP_AES "AES"
157#define WF_ENCRP_TKIP_CCMP "TKIPCCMP"
158#define WF_ENCRP_TKIP_AES "TKIPAES"
159
160/**
161* @brief ¶¨ÒåMSG_CMD_WIFI_CFG_AP ,MSG_CMD_WIFI_CFG_AP2 ÏûÏ¢¸½´øÊý¾Ý½á¹¹Ìå
162*
163*
164*
165*/
166typedef struct wlan_cfg_basic {
167 char ssid[WIFI_SSID_LEN]; //ssid should be less than 32 bytes
168 char pwd[WLAN_PSK_LEN]; //pwd len should be in 8~64 bytes
169 char authmode[WLAN_SECURITY_LEN];
170 char encrypt[WLAN_ENCRYPT_LEN];
171 char max_access_num[WLAN_MAX_ACCESS_NUM_LEN];
172 char hidessid[WLAN_HIDESSID_LEN];
173} wlan_basic_info;
174
175typedef struct _wlan_mac_info{
176 char hostname[32];
177 char mac[20];
178}wlan_mac_info;
179
180typedef struct _wlan_mac_info_list{
181 wlan_mac_info mac_info[MAX_NUMBER_OF_MAC];
182 int access_count;
183}wlan_mac_info_list;
184
185/**
186* @brief ¶¨Òåwifi״̬ÃüÁî
187 * @param WIFI_ADVANCED_CLOSE ¹Ø±ÕwifiµÄÏûÏ¢
188 * @param WIFI_ADVANCED_OPEN ¿ªÆôwifiµÄÏûÏ¢
189 * @param WIFI_ADVANCED_OPEN_VA01 ͬʱ¿ªÆôÖ÷¡¢¸±ssidµÄÏûÏ¢
190 * @param WIFI_ADVANCED_CLOSE_MSSID ¹Ø±Õ¸±ssidµÄÏûÏ¢
191 * @param WIFI_ADVANCED_OPEN_VA1 ´ò¿ª¸±ssidµÄÏûÏ¢
192 * @param WIFI_ADVANCED_RF ÉèÖÃÉ䯵²ÎÊýµÄÏûÏ¢
193 * @param WIFI_ADVANCED_RESTART Ð¾Æ¬ÖØÆôµÄÏûÏ¢
194*/
195enum {
196 WIFI_ADVANCED_CLOSE = 0, // 0 ¹Ø±Õwifi
197 WIFI_ADVANCED_OPEN, // 1 ¿ªÆôva0
198 WIFI_ADVANCED_OPEN_VA01, // 2 ͬʱ¿ªÆôÖ÷¡¢¸±ssid
199 WIFI_ADVANCED_CLOSE_MSSID, // 3¹Ø±Õ¸±ssid
200 WIFI_ADVANCED_OPEN_VA1, // 4 ´ò¿ª¸±ssid
201 WIFI_ADVANCED_RF, // 5 ÉèÖÃÉ䯵²ÎÊý
202 WIFI_ADVANCED_RESTART, // 6 Ð¾Æ¬ÖØÆô
203};
204
205/**********wlan atate***************/
206#define WIFI_OPENED "1" //ÒÑ»½ÐÑ
207#define WIFI_CLOSED "0" //ÒѹرÕ
208
209#define WLAN_ON 1 //ÒÑ»½ÐÑ
210#define WLAN_OFF 0
211
212/**
213* @brief ¶¨Òåwifi apstation SIM¿¨×´Ì¬
214 * @param CARD_MODE_NO_SIM ûÓÐSIMµÄÏûÏ¢
215 * @param WCARD_MODE_SIM ´æÔÚSIMµÄÏûÏ¢
216 * @param CARD_MODE_USIM ´æÔÚUSIMµÄÏûÏ¢
217*/
218//ÓÃÓÚapsta¹¦ÄÜÀïʶ±ðsim¿¨
219enum CardMode_Def {
220 /*T_zUfi_CardMode*/
221 CARD_MODE_NO_SIM = 0x1b00,
222 CARD_MODE_SIM,
223 CARD_MODE_USIM,
224 /*--------------------*/
225};
226
227
228/**
229* @brief ¶¨Òåwifi PIN״̬
230 * @param PIN_STATUS_NO_PIN ûÓÐPINÂëµÄÏûÏ¢
231 * @param PIN_STATUS_PIN1 PIN1ÂëµÄÏûÏ¢
232 * @param PIN_STATUS_PIN2 PIN2ÂëµÄÏûÏ¢
233 * @param PIN_STATUS_PUK1 PUK1ÂëµÄÏûÏ¢
234 * @param PIN_STATUS_PUK2 PUK2ÂëµÄÏûÏ¢
235*/
236enum PinStatus_Def {
237 /*T_zUfi_PinStatus*/
238 PIN_STATUS_NO_PIN = 0x1c00,
239 PIN_STATUS_PIN1,
240 PIN_STATUS_PIN2,
241 PIN_STATUS_PUK1,
242 PIN_STATUS_PUK2,
243 /*--------------------*/
244};
245
246/*********************station begin****************/
247
248//#ifndef __REALTEK_8192_CHIP__
249#if !(defined(__REALTEK_8192_CHIP__) || defined(__SSV_6X5X_CHIP__) || defined(__AIC_8800DW_CHIP__))
250
251
252#define WIFI_STATION_MAC_LEN 20
253#define WIFI_STATION_SSID_LEN 128
254#define WIFI_STATION_AUTH_MODE_LEN 20
255#define WIFI_STATION_ENCRYPT_TYPE_LEN 20
256#define WIFI_STATION_SPOT_PASSWORD_LEN 128
257
258typedef struct scan_result {
259 char mac[WIFI_STATION_MAC_LEN];
260 char ssid[WIFI_STATION_SSID_LEN];
261 char auth_mode[WIFI_STATION_AUTH_MODE_LEN];
262 char encrypt_type[WIFI_STATION_ENCRYPT_TYPE_LEN];
263 short connect_status;
264 short channel;
265 short signal;
266 short network_id;
267} scan_result_t;
268
269typedef struct spot {
270 char mac[WIFI_STATION_MAC_LEN];
271 char ssid[WIFI_STATION_SSID_LEN];
272 char auth_mode[WIFI_STATION_AUTH_MODE_LEN];
273 char encrypt_type[WIFI_STATION_ENCRYPT_TYPE_LEN];
274 char password[WIFI_STATION_SPOT_PASSWORD_LEN];
275 short network_id;
276} spot_t;
277
278typedef enum{
279 SAVE_ACTION,
280 DEL_ACTION,
281 CONNECTING_ACTION,
282 DHCPING_ACTION,
283 CONNECTED_ACTION,
284 DISCONNECT_ACTION,
285
286 //kw 3
287 ACTION_MAX
288}spot_action_t;
289
290typedef struct msg_act_spot {
291 spot_action_t act;
292 char mac[WIFI_STATION_MAC_LEN];
293 char ssid[WIFI_STATION_SSID_LEN];
294 int network_id;
295} msg_act_spot_t;
296
297typedef enum scan_content {
298 WIFI_STATION_AP_CONTENT_UNDEFINED,
299 WIFI_STATION_AP_MAC,
300 WIFI_STATION_AP_SSID,
301 WIFI_STATION_AP_AUTH_MODE,
302 WIFI_STATION_AP_ENCRYPT_TYPE,
303 WIFI_STATION_AP_CHANNEL,
304 WIFI_STATION_AP_SIGNAL,
305 WIFI_STATION_AP_CONNECT_STATUS,
306 WIFI_STATION_AP_NETWORK_ID,
307} scan_content_t;
308
309typedef enum{
310 DISCONNECT_STATUS,
311 CONNECTING_STATUS,
312 DHCPING_STATUS,
313 CONNECTED_STATUS,
314}connect_status_t;
315
316typedef enum {
317 WIFI_STATION_WRONG_KEY,
318 WIFI_STATION_IP_FAIL,
319 WIFI_STATION_AUTH_FAIL,
320 WIFI_STATION_OTHER,
321}conn_fail_reason_t;
322
323#else
324
325#define WIFI_STATION_SPOT_ACTION_LEN 32
326#define WIFI_STATION_SPOT_LEN 256
327#define WIFI_STATION_SPOT_LIST_NUM 10
328#define WIFI_STATION_SPOT_PROFILE_NAME_LEN 30
329#define WIFI_STATION_SPOT_PASSWORD_LEN 128
330#define WIFI_STATION_SPOT_KEY_ID_LEN 10
331#define WIFI_STATION_PROFILE_NV_NAME_LEN 20
332
333#define WIFI_STATION_WPA_STATUS_LEN 30
334#define WIFI_STATION_MAC_LEN 20
335#define WIFI_STATION_SSID_LEN 128
336#define WIFI_STATION_AUTH_MODE_LEN 20
337#define WIFI_STATION_ENCRYPT_TYPE_LEN 20
338#define WIFI_STATION_FLAGS_LEN 128
339
340typedef struct update_spot_info {
341 char spot[WIFI_STATION_SPOT_LEN];
342 char action[WIFI_STATION_SPOT_ACTION_LEN];
343} updateinfo_t;
344
345typedef enum wifi_profile_content {
346 WIFI_STATION_CONTENT_UNDEFINED,
347 WIFI_STATION_PROFILE_NAME,
348 WIFI_STATION_FROM_PROVIDER,
349 WIFI_STATION_CONNECT_STATUS,
350 WIFI_STATION_SIGNAL,
351 WIFI_STATION_SSID,
352 WIFI_STATION_AUTH_MODE,
353 WIFI_STATION_ENCRYPT_TYPE,
354 WIFI_STATION_PASSWORD,
355 WIFI_STATION_KEY_ID,
356 WIFI_STATION_AP_MAC
357} wifi_profile_content_t;
358
359typedef struct scan_result {
360 char mac[WIFI_STATION_MAC_LEN];
361 char ssid[WIFI_STATION_SSID_LEN];
362 char auth_mode[WIFI_STATION_AUTH_MODE_LEN];
363 char encrypt_type[WIFI_STATION_ENCRYPT_TYPE_LEN];
364 short from_provider;//0:·ÇÔËÓªÉÌ£¬1:ÔËÓªÉÌ
365 short connect_status;
366 short channel;
367 short signal;
368} scan_result_t;
369
370
371typedef struct spot {
372 char profile_name[WIFI_STATION_SPOT_PROFILE_NAME_LEN];
373 short from_provider;//0:·ÇÔËÓªÉÌ£¬1:ÔËÓªÉÌ
374 short connect_status;
375 short signal;
376 char ssid[WIFI_STATION_SSID_LEN];
377 char auth_mode[WIFI_STATION_AUTH_MODE_LEN];
378 char encrypt_type[WIFI_STATION_ENCRYPT_TYPE_LEN];
379 char password[WIFI_STATION_SPOT_PASSWORD_LEN];
380 short keyID;
381 char mac[WIFI_STATION_MAC_LEN];
382 BOOL is_tried_connect;
383 short network_id;
384} spot_t;
385
386
387typedef struct spot_ssid_id {
388 int id;
389 char ssid[WIFI_STATION_SSID_LEN];
390} spot_ssid_id_t;
391#endif
392
393/*********************station end****************/
394
395/*nv set flags */
396
397//wifi
398
399#define NVIO_WIFI_MAX_LEN 200 /*write or read nv length*/
400#define WIFI_PSW_DEFAULT_LENGTH 65
401#define WIFI_STATUS_LEN 2
402#define WIFI_PSW_MIN_LEN 1
403#define WIFI_PSW_MAN_LEN 64
404#define WIFI_CONFIG_DEFAULT_LENGTH 128
405#define WF_WPS_KEY_INDEX_LEN 2
406#define WF_KEY_MODE_LEN 3
407#define WF_WEP_KEY_MAX_LEN 27
408#define WF_WPA_KEY_MAX_LEN 65
409#define WF_ENCRY_TYPE_LEN 16
410#define WF_AU_MODE_LEN 16
411#define WPS_MODE_PIN "PIN" //wps mode
412#define WPS_MODE_PBC "PBC"
413#define WPS_MODE_AP_PIN "APPIN"
414#define WF_AU_OPEN "OPEN" //wifi auth mode?
415#define WF_AU_SHARE "SHARED"
416#define WF_AU_WEPAUTO "WEPAUTO"
417#define WF_AU_WPA "WPAPSK"
418#define WF_AU_WPA2 "WPA2PSK"
419#define WF_AU_WPA_WPA2 "WPAPSKWPA2PSK"
420#define WF_AU_WPA3 "WPA3Personal"
421#define WF_AU_WPA2_WPA3 "WPA2WPA3"
422#define WF_AU_WAPIPSK "WAPIPSK"
423#define WF_ENCRY_NONE "NONE" //encrypt
424#define WF_ENCRY_WEP "WEP"
425#define WF_ENCRY_TKIP "TKIP"
426#define WF_ENCRY_CCMP "CCMP"
427#define WF_ENCRY_AES "AES"
428#define WF_ENCRY_TKIP_CCMP "TKIPCCMP"
429#define WF_ENCRY_TKIP_AES "TKIPAES"
430#define WIFI_SSID_INDEX "ssid_index"
431#define WIFI_STATION_MAC "mac_addr"
432#define WIFI_STATION_HOSTNAME "hostname"
433#define WIFI_STATION_IPADDR "ip_addr"
434#define WIFI_STATION_CONNECTTIME "connect_time"
435#define WIFI_STATION_VALIDTIME "valid_time"
436#define WIFI_STATION_IPTYPE "ip_type"
437#define WIFI_STATION_DEVTYPE "dev_type"
438#define WIFI_NV_ITEM_WIFI_SET_FLAGS "wifi_set_flags"
439#define NV_WIFI_SCAN_FINISH "scan_finish"
440
441#define NV_WIFI_WPA_PASS "WPAPSK1"
442#define NV_WIFI_WPA_PASS_ENCODE "WPAPSK1_encode"
443#define NV_WIFI_WPA_PASS_M "m_WPAPSK1"
444#define NV_WIFI_WPA_PASS_M_ENCODE "m_WPAPSK1_encode"
445#define NV_WIFI_COVERAGE "wifi_coverage"
446#define NV_WIFI_WPS_STATE "WscModeOption"
447#define NV_WIFI_WPS_MODE "wps_mode"
448#define NV_WIFI_WPS_SSID "WPS_SSID"
449#define NV_WIFI_WPS_INDEX "wifi_wps_index"
450#define NV_WIFI_WPS_PIN "wps_pin"
451#define NV_WIFI_WPS_AP_PIN "wifi_ap_pin"
452#define NV_WIFI_WPS_DEF_PIN "wifi_def_pin"
453#define CMD_WIFI_STATION_LIST "station_list"
454#define CMD_HOSTNAME_LIST "hostNameList"
455#define CMD_WIFI_WPS_AP_PIN "wifi_ap_pin"
456#define CMD_WIFI_WPS_AP_DEF_PIN "wifi_def_pin"
457
458typedef enum {
459 ZTE_WLAN_SSID_SET = 0x1,
460 ZTE_WLAN_BROADCAST_SET = 0x2,
461 ZTE_WLAN_BASIC_SECURITY_SET = 0x4,
462 ZTE_WLAN_MAX_ACCESS_NUM_SET = 0x8,
463
464
465 ZTE_WLAN_ON_OFF_SET = 0x10,
466 ZTE_WLAN_WIRELESS_MODE_SET = 0x20,
467 ZTE_WLAN_CHANNEL_SET = 0x40,
468 ZTE_WLAN_COUNTRY_SET = 0x80,
469 ZTE_WLAN_WIFI_BAND_SET = 0x100,
470
471 ZTE_WLAN_POWER_SET = 0x1000,
472 ZTE_WLAN_ACL_SET = 0x2000,
473 ZTE_WLAN_WPS_SET = 0x4000,
474 ZTE_WLAN_SET_AP_SLEEPTIMER = 0x8000,
475
476
477 ZTE_WLAN_SET_AP_MSSID = 0x10000,
478
479} zte_wlan_set_e_flags;
480
481#endif