blob: df25cfdbad02cc160c9def4c1af3847405baccf6 [file] [log] [blame]
zw.wangcbf6f772025-04-08 16:16:24 +08001/**
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 MSG_CMD_WIFI_TESTMODE_REQ,
134 MSG_CMD_WIFI_TESTMODE_RSP,
135};
136
137
138#define WIFI_SSID_LEN 33
139#define WLAN_PSK_LEN 65
140#define WLAN_SECURITY_LEN 20
141#define WLAN_ENCRYPT_LEN 10
142#define WLAN_DEFAULTID_LEN 4
143#define WLAN_WEPKEY_LEN 32
144#define WLAN_ENCODE_PSK_LEN 100
145#define WLAN_MAX_ACCESS_NUM_LEN 4
146#define WLAN_HIDESSID_LEN 4
147#define WF_AUTH_OPEN "OPEN"
148#define WF_AUTH_SHARE "SHARED"
149#define WF_AUTH_WEPAUTO "WEPAUTO"
150#define WF_AUTH_WPA "WPAPSK"
151#define WF_AUTH_WPA2 "WPA2PSK"
152#define WF_AUTH_WPA_WPA2 "WPAPSKWPA2PSK"
153#define WF_AUTH_WAPIPSK "WAPIPSK"
154#define WF_ENCRP_NONE "NONE" //encrypt
155#define WF_ENCRP_WEP "WEP"
156#define WF_ENCRP_TKIP "TKIP"
157#define WF_ENCRP_CCMP "CCMP"
158#define WF_ENCRP_AES "AES"
159#define WF_ENCRP_TKIP_CCMP "TKIPCCMP"
160#define WF_ENCRP_TKIP_AES "TKIPAES"
161
162/**
163* @brief ¶¨ÒåMSG_CMD_WIFI_CFG_AP ,MSG_CMD_WIFI_CFG_AP2 ÏûÏ¢¸½´øÊý¾Ý½á¹¹Ìå
164*
165*
166*
167*/
168typedef struct wlan_cfg_basic {
169 char ssid[WIFI_SSID_LEN]; //ssid should be less than 32 bytes
170 char pwd[WLAN_PSK_LEN]; //pwd len should be in 8~64 bytes
171 char authmode[WLAN_SECURITY_LEN];
172 char encrypt[WLAN_ENCRYPT_LEN];
173 char max_access_num[WLAN_MAX_ACCESS_NUM_LEN];
174 char hidessid[WLAN_HIDESSID_LEN];
175} wlan_basic_info;
176
177typedef struct _wlan_mac_info{
178 char hostname[32];
179 char mac[20];
180}wlan_mac_info;
181
182typedef struct _wlan_mac_info_list{
183 wlan_mac_info mac_info[MAX_NUMBER_OF_MAC];
184 int access_count;
185}wlan_mac_info_list;
186
187/**
188* @brief ¶¨Òåwifi״̬ÃüÁî
189 * @param WIFI_ADVANCED_CLOSE ¹Ø±ÕwifiµÄÏûÏ¢
190 * @param WIFI_ADVANCED_OPEN ¿ªÆôwifiµÄÏûÏ¢
191 * @param WIFI_ADVANCED_OPEN_VA01 ͬʱ¿ªÆôÖ÷¡¢¸±ssidµÄÏûÏ¢
192 * @param WIFI_ADVANCED_CLOSE_MSSID ¹Ø±Õ¸±ssidµÄÏûÏ¢
193 * @param WIFI_ADVANCED_OPEN_VA1 ´ò¿ª¸±ssidµÄÏûÏ¢
194 * @param WIFI_ADVANCED_RF ÉèÖÃÉ䯵²ÎÊýµÄÏûÏ¢
195 * @param WIFI_ADVANCED_RESTART Ð¾Æ¬ÖØÆôµÄÏûÏ¢
196*/
197enum {
198 WIFI_ADVANCED_CLOSE = 0, // 0 ¹Ø±Õwifi
199 WIFI_ADVANCED_OPEN, // 1 ¿ªÆôva0
200 WIFI_ADVANCED_OPEN_VA01, // 2 ͬʱ¿ªÆôÖ÷¡¢¸±ssid
201 WIFI_ADVANCED_CLOSE_MSSID, // 3¹Ø±Õ¸±ssid
202 WIFI_ADVANCED_OPEN_VA1, // 4 ´ò¿ª¸±ssid
203 WIFI_ADVANCED_RF, // 5 ÉèÖÃÉ䯵²ÎÊý
204 WIFI_ADVANCED_RESTART, // 6 Ð¾Æ¬ÖØÆô
205 WIFI_ADVANCED_BAND_SWITCH, // 7 ap 2.4G/5GÇл»
206};
207
208/**********wlan atate***************/
209#define WIFI_OPENED "1" //ÒÑ»½ÐÑ
210#define WIFI_CLOSED "0" //ÒѹرÕ
211
212#define WLAN_ON 1 //ÒÑ»½ÐÑ
213#define WLAN_OFF 0
214
215/**
216* @brief ¶¨Òåwifi apstation SIM¿¨×´Ì¬
217 * @param CARD_MODE_NO_SIM ûÓÐSIMµÄÏûÏ¢
218 * @param WCARD_MODE_SIM ´æÔÚSIMµÄÏûÏ¢
219 * @param CARD_MODE_USIM ´æÔÚUSIMµÄÏûÏ¢
220*/
221//ÓÃÓÚapsta¹¦ÄÜÀïʶ±ðsim¿¨
222enum CardMode_Def {
223 /*T_zUfi_CardMode*/
224 CARD_MODE_NO_SIM = 0x1b00,
225 CARD_MODE_SIM,
226 CARD_MODE_USIM,
227 /*--------------------*/
228};
229
230
231/**
232* @brief ¶¨Òåwifi PIN״̬
233 * @param PIN_STATUS_NO_PIN ûÓÐPINÂëµÄÏûÏ¢
234 * @param PIN_STATUS_PIN1 PIN1ÂëµÄÏûÏ¢
235 * @param PIN_STATUS_PIN2 PIN2ÂëµÄÏûÏ¢
236 * @param PIN_STATUS_PUK1 PUK1ÂëµÄÏûÏ¢
237 * @param PIN_STATUS_PUK2 PUK2ÂëµÄÏûÏ¢
238*/
239enum PinStatus_Def {
240 /*T_zUfi_PinStatus*/
241 PIN_STATUS_NO_PIN = 0x1c00,
242 PIN_STATUS_PIN1,
243 PIN_STATUS_PIN2,
244 PIN_STATUS_PUK1,
245 PIN_STATUS_PUK2,
246 /*--------------------*/
247};
248
249/*********************station begin****************/
250
251//#ifndef __REALTEK_8192_CHIP__
252#if !(defined(__REALTEK_8192_CHIP__) || defined(__SSV_6X5X_CHIP__) || defined(__AIC_8800DW_CHIP__))
253
254
255#define WIFI_STATION_MAC_LEN 20
256#define WIFI_STATION_SSID_LEN 128
257#define WIFI_STATION_AUTH_MODE_LEN 20
258#define WIFI_STATION_ENCRYPT_TYPE_LEN 20
259#define WIFI_STATION_SPOT_PASSWORD_LEN 128
260
261typedef struct scan_result {
262 char mac[WIFI_STATION_MAC_LEN];
263 char ssid[WIFI_STATION_SSID_LEN];
264 char auth_mode[WIFI_STATION_AUTH_MODE_LEN];
265 char encrypt_type[WIFI_STATION_ENCRYPT_TYPE_LEN];
266 short connect_status;
267 short channel;
268 short signal;
269 short network_id;
270} scan_result_t;
271
272typedef struct spot {
273 char mac[WIFI_STATION_MAC_LEN];
274 char ssid[WIFI_STATION_SSID_LEN];
275 char auth_mode[WIFI_STATION_AUTH_MODE_LEN];
276 char encrypt_type[WIFI_STATION_ENCRYPT_TYPE_LEN];
277 char password[WIFI_STATION_SPOT_PASSWORD_LEN];
278 short network_id;
279} spot_t;
280
281typedef enum{
282 SAVE_ACTION,
283 DEL_ACTION,
284 CONNECTING_ACTION,
285 DHCPING_ACTION,
286 CONNECTED_ACTION,
287 DISCONNECT_ACTION,
288
289 //kw 3
290 ACTION_MAX
291}spot_action_t;
292
293typedef struct msg_act_spot {
294 spot_action_t act;
295 char mac[WIFI_STATION_MAC_LEN];
296 char ssid[WIFI_STATION_SSID_LEN];
297 int network_id;
298} msg_act_spot_t;
299
300typedef enum scan_content {
301 WIFI_STATION_AP_CONTENT_UNDEFINED,
302 WIFI_STATION_AP_MAC,
303 WIFI_STATION_AP_SSID,
304 WIFI_STATION_AP_AUTH_MODE,
305 WIFI_STATION_AP_ENCRYPT_TYPE,
306 WIFI_STATION_AP_CHANNEL,
307 WIFI_STATION_AP_SIGNAL,
308 WIFI_STATION_AP_CONNECT_STATUS,
309 WIFI_STATION_AP_NETWORK_ID,
310} scan_content_t;
311
312typedef enum{
313 DISCONNECT_STATUS,
314 CONNECTING_STATUS,
315 DHCPING_STATUS,
316 CONNECTED_STATUS,
317}connect_status_t;
318
319typedef enum {
320 WIFI_STATION_WRONG_KEY,
321 WIFI_STATION_IP_FAIL,
322 WIFI_STATION_AUTH_FAIL,
323 WIFI_STATION_OTHER,
324}conn_fail_reason_t;
325
326#else
327
328#define WIFI_STATION_SPOT_ACTION_LEN 32
329#define WIFI_STATION_SPOT_LEN 256
330#define WIFI_STATION_SPOT_LIST_NUM 10
331#define WIFI_STATION_SPOT_PROFILE_NAME_LEN 30
332#define WIFI_STATION_SPOT_PASSWORD_LEN 128
333#define WIFI_STATION_SPOT_KEY_ID_LEN 10
334#define WIFI_STATION_PROFILE_NV_NAME_LEN 20
335
336#define WIFI_STATION_WPA_STATUS_LEN 30
337#define WIFI_STATION_MAC_LEN 20
338#define WIFI_STATION_SSID_LEN 128
339#define WIFI_STATION_AUTH_MODE_LEN 20
340#define WIFI_STATION_ENCRYPT_TYPE_LEN 20
341#define WIFI_STATION_FLAGS_LEN 128
342
343typedef struct update_spot_info {
344 char spot[WIFI_STATION_SPOT_LEN];
345 char action[WIFI_STATION_SPOT_ACTION_LEN];
346} updateinfo_t;
347
348typedef enum wifi_profile_content {
349 WIFI_STATION_CONTENT_UNDEFINED,
350 WIFI_STATION_PROFILE_NAME,
351 WIFI_STATION_FROM_PROVIDER,
352 WIFI_STATION_CONNECT_STATUS,
353 WIFI_STATION_SIGNAL,
354 WIFI_STATION_SSID,
355 WIFI_STATION_AUTH_MODE,
356 WIFI_STATION_ENCRYPT_TYPE,
357 WIFI_STATION_PASSWORD,
358 WIFI_STATION_KEY_ID,
359 WIFI_STATION_AP_MAC
360} wifi_profile_content_t;
361
362typedef struct scan_result {
363 char mac[WIFI_STATION_MAC_LEN];
364 char ssid[WIFI_STATION_SSID_LEN];
365 char auth_mode[WIFI_STATION_AUTH_MODE_LEN];
366 char encrypt_type[WIFI_STATION_ENCRYPT_TYPE_LEN];
367 short from_provider;//0:·ÇÔËÓªÉÌ£¬1:ÔËÓªÉÌ
368 short connect_status;
369 short channel;
370 short signal;
371} scan_result_t;
372
373
374typedef struct spot {
375 char profile_name[WIFI_STATION_SPOT_PROFILE_NAME_LEN];
376 short from_provider;//0:·ÇÔËÓªÉÌ£¬1:ÔËÓªÉÌ
377 short connect_status;
378 short signal;
379 char ssid[WIFI_STATION_SSID_LEN];
380 char auth_mode[WIFI_STATION_AUTH_MODE_LEN];
381 char encrypt_type[WIFI_STATION_ENCRYPT_TYPE_LEN];
382 char password[WIFI_STATION_SPOT_PASSWORD_LEN];
383 short keyID;
384 char mac[WIFI_STATION_MAC_LEN];
385 BOOL is_tried_connect;
386 short network_id;
387} spot_t;
388
389
390typedef struct spot_ssid_id {
391 int id;
392 char ssid[WIFI_STATION_SSID_LEN];
393} spot_ssid_id_t;
394#endif
395
396/*********************station end****************/
397
398/*nv set flags */
399
400//wifi
401
402#define NVIO_WIFI_MAX_LEN 200 /*write or read nv length*/
403#define WIFI_PSW_DEFAULT_LENGTH 65
404#define WIFI_STATUS_LEN 2
405#define WIFI_PSW_MIN_LEN 1
406#define WIFI_PSW_MAN_LEN 64
407#define WIFI_CONFIG_DEFAULT_LENGTH 128
408#define WF_WPS_KEY_INDEX_LEN 2
409#define WF_KEY_MODE_LEN 3
410#define WF_WEP_KEY_MAX_LEN 27
411#define WF_WPA_KEY_MAX_LEN 65
412#define WF_ENCRY_TYPE_LEN 16
413#define WF_AU_MODE_LEN 16
414#define WPS_MODE_PIN "PIN" //wps mode
415#define WPS_MODE_PBC "PBC"
416#define WPS_MODE_AP_PIN "APPIN"
417#define WF_AU_OPEN "OPEN" //wifi auth mode?
418#define WF_AU_SHARE "SHARED"
419#define WF_AU_WEPAUTO "WEPAUTO"
420#define WF_AU_WPA "WPAPSK"
421#define WF_AU_WPA2 "WPA2PSK"
422#define WF_AU_WPA_WPA2 "WPAPSKWPA2PSK"
423#define WF_AU_WPA3 "WPA3Personal"
424#define WF_AU_WPA2_WPA3 "WPA2WPA3"
425#define WF_AU_WAPIPSK "WAPIPSK"
426#define WF_ENCRY_NONE "NONE" //encrypt
427#define WF_ENCRY_WEP "WEP"
428#define WF_ENCRY_TKIP "TKIP"
429#define WF_ENCRY_CCMP "CCMP"
430#define WF_ENCRY_AES "AES"
431#define WF_ENCRY_TKIP_CCMP "TKIPCCMP"
432#define WF_ENCRY_TKIP_AES "TKIPAES"
433#define WIFI_SSID_INDEX "ssid_index"
434#define WIFI_STATION_MAC "mac_addr"
435#define WIFI_STATION_HOSTNAME "hostname"
436#define WIFI_STATION_IPADDR "ip_addr"
437#define WIFI_STATION_CONNECTTIME "connect_time"
438#define WIFI_STATION_VALIDTIME "valid_time"
439#define WIFI_STATION_IPTYPE "ip_type"
440#define WIFI_STATION_DEVTYPE "dev_type"
441#define WIFI_NV_ITEM_WIFI_SET_FLAGS "wifi_set_flags"
442#define NV_WIFI_SCAN_FINISH "scan_finish"
443
444#define NV_WIFI_WPA_PASS "WPAPSK1"
445#define NV_WIFI_WPA_PASS_ENCODE "WPAPSK1_encode"
446#define NV_WIFI_WPA_PASS_M "m_WPAPSK1"
447#define NV_WIFI_WPA_PASS_M_ENCODE "m_WPAPSK1_encode"
448#define NV_WIFI_COVERAGE "wifi_coverage"
449#define NV_WIFI_WPS_STATE "WscModeOption"
450#define NV_WIFI_WPS_MODE "wps_mode"
451#define NV_WIFI_WPS_SSID "WPS_SSID"
452#define NV_WIFI_WPS_INDEX "wifi_wps_index"
453#define NV_WIFI_WPS_PIN "wps_pin"
454#define NV_WIFI_WPS_AP_PIN "wifi_ap_pin"
455#define NV_WIFI_WPS_DEF_PIN "wifi_def_pin"
456#define CMD_WIFI_STATION_LIST "station_list"
457#define CMD_HOSTNAME_LIST "hostNameList"
458#define CMD_WIFI_WPS_AP_PIN "wifi_ap_pin"
459#define CMD_WIFI_WPS_AP_DEF_PIN "wifi_def_pin"
460
461typedef enum {
462 ZTE_WLAN_SSID_SET = 0x1,
463 ZTE_WLAN_BROADCAST_SET = 0x2,
464 ZTE_WLAN_BASIC_SECURITY_SET = 0x4,
465 ZTE_WLAN_MAX_ACCESS_NUM_SET = 0x8,
466
467
468 ZTE_WLAN_ON_OFF_SET = 0x10,
469 ZTE_WLAN_WIRELESS_MODE_SET = 0x20,
470 ZTE_WLAN_CHANNEL_SET = 0x40,
471 ZTE_WLAN_COUNTRY_SET = 0x80,
472 ZTE_WLAN_WIFI_BAND_SET = 0x100,
473
474 ZTE_WLAN_POWER_SET = 0x1000,
475 ZTE_WLAN_ACL_SET = 0x2000,
476 ZTE_WLAN_WPS_SET = 0x4000,
477 ZTE_WLAN_SET_AP_SLEEPTIMER = 0x8000,
478
479
480 ZTE_WLAN_SET_AP_MSSID = 0x10000,
481
482} zte_wlan_set_e_flags;
483
484//same as sc_wifi_work_mode_e to do: hu huan
485typedef enum
486{
487 IN_WIFI_WORK_MODE_MIN = -1,
488 IN_WIFI_WORK_MODE_AP0 = 0, //2.4G single ap / ap+sta
489 IN_WIFI_WORK_MODE_AP1, //5G single ap / ap+sta
490 IN_WIFI_WORK_MODE_STA,
491 IN_WIFI_WORK_MODE_MAX
492} inner_wifi_work_mode_e;
493#endif