11bd4fe43Sopenharmony_ci/** 21bd4fe43Sopenharmony_ci * @file hi_wifi_api.h 31bd4fe43Sopenharmony_ci * 41bd4fe43Sopenharmony_ci * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 51bd4fe43Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 61bd4fe43Sopenharmony_ci * you may not use this file except in compliance with the License. 71bd4fe43Sopenharmony_ci * You may obtain a copy of the License at 81bd4fe43Sopenharmony_ci * 91bd4fe43Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 101bd4fe43Sopenharmony_ci * 111bd4fe43Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 121bd4fe43Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 131bd4fe43Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 141bd4fe43Sopenharmony_ci * See the License for the specific language governing permissions and 151bd4fe43Sopenharmony_ci * limitations under the License. 161bd4fe43Sopenharmony_ci */ 171bd4fe43Sopenharmony_ci 181bd4fe43Sopenharmony_ci/** 191bd4fe43Sopenharmony_ci * @defgroup hi_wifi_basic WiFi Basic Settings 201bd4fe43Sopenharmony_ci * @ingroup hi_wifi 211bd4fe43Sopenharmony_ci */ 221bd4fe43Sopenharmony_ci 231bd4fe43Sopenharmony_ci#ifndef __HI_WIFI_API_H__ 241bd4fe43Sopenharmony_ci#define __HI_WIFI_API_H__ 251bd4fe43Sopenharmony_ci 261bd4fe43Sopenharmony_ci#ifdef __cplusplus 271bd4fe43Sopenharmony_ci#if __cplusplus 281bd4fe43Sopenharmony_ciextern "C" { 291bd4fe43Sopenharmony_ci#endif 301bd4fe43Sopenharmony_ci#endif 311bd4fe43Sopenharmony_ci 321bd4fe43Sopenharmony_ci/** 331bd4fe43Sopenharmony_ci * mac transform string.CNcomment:地址转为字符串.CNend 341bd4fe43Sopenharmony_ci */ 351bd4fe43Sopenharmony_ci#ifndef MACSTR 361bd4fe43Sopenharmony_ci#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" 371bd4fe43Sopenharmony_ci#endif 381bd4fe43Sopenharmony_ci 391bd4fe43Sopenharmony_ci#ifndef MAC2STR 401bd4fe43Sopenharmony_ci#define mac2str(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] 411bd4fe43Sopenharmony_ci#endif 421bd4fe43Sopenharmony_ci 431bd4fe43Sopenharmony_ci#ifndef bit 441bd4fe43Sopenharmony_ci#define bit(x) (1U << (x)) 451bd4fe43Sopenharmony_ci#endif 461bd4fe43Sopenharmony_ci 471bd4fe43Sopenharmony_ci/** 481bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 491bd4fe43Sopenharmony_ci * 501bd4fe43Sopenharmony_ci * TKIP of cipher mode.CNcomment:加密方式为TKIP.CNend 511bd4fe43Sopenharmony_ci */ 521bd4fe43Sopenharmony_ci#define WIFI_CIPHER_TKIP bit(3) 531bd4fe43Sopenharmony_ci 541bd4fe43Sopenharmony_ci/** 551bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 561bd4fe43Sopenharmony_ci * 571bd4fe43Sopenharmony_ci * CCMP of cipher mode.CNcomment:加密方式为CCMP.CNend 581bd4fe43Sopenharmony_ci */ 591bd4fe43Sopenharmony_ci#define WIFI_CIPHER_CCMP bit(4) 601bd4fe43Sopenharmony_ci 611bd4fe43Sopenharmony_ci/** 621bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 631bd4fe43Sopenharmony_ci * 641bd4fe43Sopenharmony_ci * Channel numbers of 2.4G frequency.CNcomment:2.4G频段的信道数量.CNend 651bd4fe43Sopenharmony_ci */ 661bd4fe43Sopenharmony_ci#define WIFI_24G_CHANNEL_NUMS 14 671bd4fe43Sopenharmony_ci 681bd4fe43Sopenharmony_ci/** 691bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 701bd4fe43Sopenharmony_ci * 711bd4fe43Sopenharmony_ci * max interiface name length.CNcomment:网络接口名最大长度.CNend 721bd4fe43Sopenharmony_ci */ 731bd4fe43Sopenharmony_ci#define WIFI_IFNAME_MAX_SIZE 16 741bd4fe43Sopenharmony_ci 751bd4fe43Sopenharmony_ci/** 761bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 771bd4fe43Sopenharmony_ci * 781bd4fe43Sopenharmony_ci * The minimum timeout of a single reconnection.CNcomment:最小单次重连超时时间.CNend 791bd4fe43Sopenharmony_ci */ 801bd4fe43Sopenharmony_ci#define WIFI_MIN_RECONNECT_TIMEOUT 2 811bd4fe43Sopenharmony_ci 821bd4fe43Sopenharmony_ci/** 831bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 841bd4fe43Sopenharmony_ci * 851bd4fe43Sopenharmony_ci * The maximum timeout of a single reconnection, representing an infinite number of loop reconnections. 861bd4fe43Sopenharmony_ci * CNcomment:最大单次重连超时时间,表示无限次循环重连.CNend 871bd4fe43Sopenharmony_ci */ 881bd4fe43Sopenharmony_ci#define WIFI_MAX_RECONNECT_TIMEOUT 65535 891bd4fe43Sopenharmony_ci 901bd4fe43Sopenharmony_ci/** 911bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 921bd4fe43Sopenharmony_ci * 931bd4fe43Sopenharmony_ci * The minimum auto reconnect interval.CNcomment:最小自动重连间隔时间.CNend 941bd4fe43Sopenharmony_ci */ 951bd4fe43Sopenharmony_ci#define WIFI_MIN_RECONNECT_PERIOD 1 961bd4fe43Sopenharmony_ci 971bd4fe43Sopenharmony_ci/** 981bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 991bd4fe43Sopenharmony_ci * 1001bd4fe43Sopenharmony_ci * The maximum auto reconnect interval.CNcomment:最大自动重连间隔时间.CNend 1011bd4fe43Sopenharmony_ci */ 1021bd4fe43Sopenharmony_ci#define WIFI_MAX_RECONNECT_PERIOD 65535 1031bd4fe43Sopenharmony_ci 1041bd4fe43Sopenharmony_ci/** 1051bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 1061bd4fe43Sopenharmony_ci * 1071bd4fe43Sopenharmony_ci * The minmum times of auto reconnect.CNcomment:最小自动重连连接次数.CNend 1081bd4fe43Sopenharmony_ci */ 1091bd4fe43Sopenharmony_ci#define WIFI_MIN_RECONNECT_TIMES 1 1101bd4fe43Sopenharmony_ci 1111bd4fe43Sopenharmony_ci/** 1121bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 1131bd4fe43Sopenharmony_ci * 1141bd4fe43Sopenharmony_ci * The maximum times of auto reconnect.CNcomment:最大自动重连连接次数.CNend 1151bd4fe43Sopenharmony_ci */ 1161bd4fe43Sopenharmony_ci#define WIFI_MAX_RECONNECT_TIMES 65535 1171bd4fe43Sopenharmony_ci 1181bd4fe43Sopenharmony_ci/** 1191bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 1201bd4fe43Sopenharmony_ci * 1211bd4fe43Sopenharmony_ci * max scan number of ap.CNcomment:支持扫描ap的最多数目.CNend 1221bd4fe43Sopenharmony_ci */ 1231bd4fe43Sopenharmony_ci#define WIFI_SCAN_AP_LIMIT 32 1241bd4fe43Sopenharmony_ci 1251bd4fe43Sopenharmony_ci/** 1261bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 1271bd4fe43Sopenharmony_ci * 1281bd4fe43Sopenharmony_ci * length of status buff.CNcomment:获取连接状态字符串的长度.CNend 1291bd4fe43Sopenharmony_ci */ 1301bd4fe43Sopenharmony_ci#define WIFI_STATUS_BUF_LEN_LIMIT 512 1311bd4fe43Sopenharmony_ci 1321bd4fe43Sopenharmony_ci/** 1331bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 1341bd4fe43Sopenharmony_ci * 1351bd4fe43Sopenharmony_ci * Decimal only WPS pin code length.CNcomment:WPS中十进制pin码长度.CNend 1361bd4fe43Sopenharmony_ci */ 1371bd4fe43Sopenharmony_ci#define WIFI_WPS_PIN_LEN 8 1381bd4fe43Sopenharmony_ci 1391bd4fe43Sopenharmony_ci/** 1401bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 1411bd4fe43Sopenharmony_ci * 1421bd4fe43Sopenharmony_ci * default max num of station.CNcomment:默认支持的station最大个数.CNend 1431bd4fe43Sopenharmony_ci */ 1441bd4fe43Sopenharmony_ci#define WIFI_DEFAULT_MAX_NUM_STA 6 1451bd4fe43Sopenharmony_ci 1461bd4fe43Sopenharmony_ci/** 1471bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 1481bd4fe43Sopenharmony_ci * 1491bd4fe43Sopenharmony_ci * return success value.CNcomment:返回成功标识.CNend 1501bd4fe43Sopenharmony_ci */ 1511bd4fe43Sopenharmony_ci#define HISI_OK 0 1521bd4fe43Sopenharmony_ci 1531bd4fe43Sopenharmony_ci/** 1541bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 1551bd4fe43Sopenharmony_ci * 1561bd4fe43Sopenharmony_ci * return failed value.CNcomment:返回值错误标识.CNend 1571bd4fe43Sopenharmony_ci */ 1581bd4fe43Sopenharmony_ci#define HISI_FAIL (-1) 1591bd4fe43Sopenharmony_ci 1601bd4fe43Sopenharmony_ci/** 1611bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 1621bd4fe43Sopenharmony_ci * 1631bd4fe43Sopenharmony_ci * Max length of SSID.CNcomment:SSID最大长度定义.CNend 1641bd4fe43Sopenharmony_ci */ 1651bd4fe43Sopenharmony_ci#define HI_WIFI_MAX_SSID_LEN 32 1661bd4fe43Sopenharmony_ci 1671bd4fe43Sopenharmony_ci/** 1681bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 1691bd4fe43Sopenharmony_ci * 1701bd4fe43Sopenharmony_ci * Length of MAC address.CNcomment:MAC地址长度定义.CNend 1711bd4fe43Sopenharmony_ci */ 1721bd4fe43Sopenharmony_ci#define HI_WIFI_MAC_LEN 6 1731bd4fe43Sopenharmony_ci 1741bd4fe43Sopenharmony_ci/** 1751bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 1761bd4fe43Sopenharmony_ci * 1771bd4fe43Sopenharmony_ci * String length of bssid, eg. 00:00:00:00:00:00.CNcomment:bssid字符串长度定义(00:00:00:00:00:00).CNend 1781bd4fe43Sopenharmony_ci */ 1791bd4fe43Sopenharmony_ci#define HI_WIFI_TXT_ADDR_LEN 17 1801bd4fe43Sopenharmony_ci 1811bd4fe43Sopenharmony_ci/** 1821bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 1831bd4fe43Sopenharmony_ci * 1841bd4fe43Sopenharmony_ci * Length of Key.CNcomment:KEY 密码长度定义.CNend 1851bd4fe43Sopenharmony_ci */ 1861bd4fe43Sopenharmony_ci#define HI_WIFI_AP_KEY_LEN 64 1871bd4fe43Sopenharmony_ci 1881bd4fe43Sopenharmony_ci/** 1891bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 1901bd4fe43Sopenharmony_ci * 1911bd4fe43Sopenharmony_ci * Maximum length of Key.CNcomment:KEY 最大密码长度.CNend 1921bd4fe43Sopenharmony_ci */ 1931bd4fe43Sopenharmony_ci#define HI_WIFI_MAX_KEY_LEN 64 1941bd4fe43Sopenharmony_ci 1951bd4fe43Sopenharmony_ci/** 1961bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 1971bd4fe43Sopenharmony_ci * 1981bd4fe43Sopenharmony_ci * Return value of invalid channel.CNcomment:无效信道返回值.CNend 1991bd4fe43Sopenharmony_ci */ 2001bd4fe43Sopenharmony_ci#define HI_WIFI_INVALID_CHANNEL 0xFF 2011bd4fe43Sopenharmony_ci 2021bd4fe43Sopenharmony_ci/** 2031bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 2041bd4fe43Sopenharmony_ci * 2051bd4fe43Sopenharmony_ci * Index of Vendor IE.CNcomment:Vendor IE 最大索引.CNend 2061bd4fe43Sopenharmony_ci */ 2071bd4fe43Sopenharmony_ci#define HI_WIFI_VENDOR_IE_MAX_IDX 1 2081bd4fe43Sopenharmony_ci 2091bd4fe43Sopenharmony_ci/** 2101bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 2111bd4fe43Sopenharmony_ci * 2121bd4fe43Sopenharmony_ci * Max length of Vendor IE.CNcomment:Vendor IE 最大长度.CNend 2131bd4fe43Sopenharmony_ci */ 2141bd4fe43Sopenharmony_ci#define HI_WIFI_VENDOR_IE_MAX_LEN 255 2151bd4fe43Sopenharmony_ci 2161bd4fe43Sopenharmony_ci/** 2171bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 2181bd4fe43Sopenharmony_ci * 2191bd4fe43Sopenharmony_ci * Minimum length of custom's frame.CNcomment:用户定制报文最小长度值.CNend 2201bd4fe43Sopenharmony_ci */ 2211bd4fe43Sopenharmony_ci#define HI_WIFI_CUSTOM_PKT_MIN_LEN 24 2221bd4fe43Sopenharmony_ci 2231bd4fe43Sopenharmony_ci/** 2241bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 2251bd4fe43Sopenharmony_ci * 2261bd4fe43Sopenharmony_ci * Max length of custom's frame.CNcomment:用户定制报文最大长度值.CNend 2271bd4fe43Sopenharmony_ci */ 2281bd4fe43Sopenharmony_ci#define HI_WIFI_CUSTOM_PKT_MAX_LEN 1400 2291bd4fe43Sopenharmony_ci 2301bd4fe43Sopenharmony_ci/** 2311bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 2321bd4fe43Sopenharmony_ci * 2331bd4fe43Sopenharmony_ci * Length of wpa psk.CNcomment:wpa psk的长度.CNend 2341bd4fe43Sopenharmony_ci */ 2351bd4fe43Sopenharmony_ci#define HI_WIFI_STA_PSK_LEN 32 2361bd4fe43Sopenharmony_ci 2371bd4fe43Sopenharmony_ci/** 2381bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 2391bd4fe43Sopenharmony_ci * 2401bd4fe43Sopenharmony_ci * Max num of retry.CNcomment:软件重传的最大次数.CNend 2411bd4fe43Sopenharmony_ci */ 2421bd4fe43Sopenharmony_ci#define HI_WIFI_RETRY_MAX_NUM 15 2431bd4fe43Sopenharmony_ci 2441bd4fe43Sopenharmony_ci/** 2451bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 2461bd4fe43Sopenharmony_ci * 2471bd4fe43Sopenharmony_ci * Max time of retry.CNcomment:软件重传的最大时间.CNend 2481bd4fe43Sopenharmony_ci */ 2491bd4fe43Sopenharmony_ci#define HI_WIFI_RETRY_MAX_TIME 200 2501bd4fe43Sopenharmony_ci 2511bd4fe43Sopenharmony_ci/** 2521bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 2531bd4fe43Sopenharmony_ci * 2541bd4fe43Sopenharmony_ci * Minimum priority of callback task.CNcomment:事件回调task的最小优先级.CNend 2551bd4fe43Sopenharmony_ci */ 2561bd4fe43Sopenharmony_ci#define HI_WIFI_CB_MIN_PRIO 10 2571bd4fe43Sopenharmony_ci 2581bd4fe43Sopenharmony_ci/** 2591bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 2601bd4fe43Sopenharmony_ci * 2611bd4fe43Sopenharmony_ci * Max priority of callback task.CNcomment:事件回调task的最大优先级.CNend 2621bd4fe43Sopenharmony_ci */ 2631bd4fe43Sopenharmony_ci#define HI_WIFI_CB_MAX_PRIO 50 2641bd4fe43Sopenharmony_ci 2651bd4fe43Sopenharmony_ci/** 2661bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 2671bd4fe43Sopenharmony_ci * 2681bd4fe43Sopenharmony_ci * Minimum stack size of callback task.CNcomment:最小的回调线程栈大小.CNend 2691bd4fe43Sopenharmony_ci */ 2701bd4fe43Sopenharmony_ci#define HI_WIFI_CB_MIN_STACK 1024 2711bd4fe43Sopenharmony_ci 2721bd4fe43Sopenharmony_ci/** 2731bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 2741bd4fe43Sopenharmony_ci * 2751bd4fe43Sopenharmony_ci * max usr ie length.CNcomment:用户IE字段最大长度CNend 2761bd4fe43Sopenharmony_ci */ 2771bd4fe43Sopenharmony_ci#define HI_WIFI_USR_IE_MAX_SIZE 128 2781bd4fe43Sopenharmony_ci 2791bd4fe43Sopenharmony_ci/** 2801bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 2811bd4fe43Sopenharmony_ci * 2821bd4fe43Sopenharmony_ci * Reporting data type of monitor mode.CNcomment:混杂模式上报的数据类型.CNend 2831bd4fe43Sopenharmony_ci */ 2841bd4fe43Sopenharmony_citypedef enum { 2851bd4fe43Sopenharmony_ci HI_WIFI_MONITOR_OFF, /**< close monitor mode. CNcomment: 关闭混杂模式.CNend */ 2861bd4fe43Sopenharmony_ci HI_WIFI_MONITOR_MCAST_DATA, /**< report multi-cast data frame. CNcomment: 上报组播(广播)数据包.CNend */ 2871bd4fe43Sopenharmony_ci HI_WIFI_MONITOR_UCAST_DATA, /**< report single-cast data frame. CNcomment: 上报单播数据包.CNend */ 2881bd4fe43Sopenharmony_ci HI_WIFI_MONITOR_MCAST_MANAGEMENT, /**< report multi-cast mgmt frame. CNcomment: 上报组播(广播)管理包.CNend */ 2891bd4fe43Sopenharmony_ci HI_WIFI_MONITOR_UCAST_MANAGEMENT, /**< report sigle-cast mgmt frame. CNcomment: 上报单播管理包.CNend */ 2901bd4fe43Sopenharmony_ci HI_WIFI_MONITOR_BUTT 2911bd4fe43Sopenharmony_ci} hi_wifi_monitor_mode; 2921bd4fe43Sopenharmony_ci 2931bd4fe43Sopenharmony_ci/** 2941bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 2951bd4fe43Sopenharmony_ci * 2961bd4fe43Sopenharmony_ci * Definition of protocol frame type.CNcomment:协议报文类型定义.CNend 2971bd4fe43Sopenharmony_ci */ 2981bd4fe43Sopenharmony_citypedef enum { 2991bd4fe43Sopenharmony_ci HI_WIFI_PKT_TYPE_BEACON, /**< Beacon packet. CNcomment: Beacon包.CNend */ 3001bd4fe43Sopenharmony_ci HI_WIFI_PKT_TYPE_PROBE_REQ, /**< Probe Request packet. CNcomment: Probe Request包.CNend */ 3011bd4fe43Sopenharmony_ci HI_WIFI_PKT_TYPE_PROBE_RESP, /**< Probe Response packet. CNcomment: Probe Response包.CNend */ 3021bd4fe43Sopenharmony_ci HI_WIFI_PKT_TYPE_ASSOC_REQ, /**< Assoc Request packet. CNcomment: Assoc Request包.CNend */ 3031bd4fe43Sopenharmony_ci HI_WIFI_PKT_TYPE_ASSOC_RESP, /**< Assoc Response packet. CNcomment: Assoc Response包.CNend */ 3041bd4fe43Sopenharmony_ci HI_WIFI_PKT_TYPE_BUTT 3051bd4fe43Sopenharmony_ci}hi_wifi_pkt_type; 3061bd4fe43Sopenharmony_ci 3071bd4fe43Sopenharmony_ci/** 3081bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 3091bd4fe43Sopenharmony_ci * 3101bd4fe43Sopenharmony_ci * Interface type of wifi.CNcomment:wifi 接口类型.CNend 3111bd4fe43Sopenharmony_ci */ 3121bd4fe43Sopenharmony_citypedef enum { 3131bd4fe43Sopenharmony_ci HI_WIFI_IFTYPE_UNSPECIFIED, 3141bd4fe43Sopenharmony_ci HI_WIFI_IFTYPE_ADHOC, 3151bd4fe43Sopenharmony_ci HI_WIFI_IFTYPE_STATION = 2, /**< Station. CNcomment: STA类型.CNend */ 3161bd4fe43Sopenharmony_ci HI_WIFI_IFTYPE_AP = 3, /**< SoftAp. CNcomment: SoftAp类型.CNend */ 3171bd4fe43Sopenharmony_ci HI_WIFI_IFTYPE_AP_VLAN, 3181bd4fe43Sopenharmony_ci HI_WIFI_IFTYPE_WDS, 3191bd4fe43Sopenharmony_ci HI_WIFI_IFTYPE_MONITOR, 3201bd4fe43Sopenharmony_ci HI_WIFI_IFTYPE_MESH_POINT = 7, /**< Mesh. CNcomment: Mesh类型.CNend */ 3211bd4fe43Sopenharmony_ci HI_WIFI_IFTYPE_P2P_CLIENT, 3221bd4fe43Sopenharmony_ci HI_WIFI_IFTYPE_P2P_GO, 3231bd4fe43Sopenharmony_ci HI_WIFI_IFTYPE_P2P_DEVICE, 3241bd4fe43Sopenharmony_ci 3251bd4fe43Sopenharmony_ci HI_WIFI_IFTYPES_BUTT 3261bd4fe43Sopenharmony_ci} hi_wifi_iftype; 3271bd4fe43Sopenharmony_ci 3281bd4fe43Sopenharmony_ci/** 3291bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 3301bd4fe43Sopenharmony_ci * 3311bd4fe43Sopenharmony_ci * Definition of bandwith type.CNcomment:接口带宽定义.CNend 3321bd4fe43Sopenharmony_ci */ 3331bd4fe43Sopenharmony_citypedef enum { 3341bd4fe43Sopenharmony_ci HI_WIFI_BW_HIEX_5M, /**< 5M bandwidth. CNcomment: 窄带5M带宽.CNend */ 3351bd4fe43Sopenharmony_ci HI_WIFI_BW_HIEX_10M, /**< 10M bandwidth. CNcomment: 窄带10M带宽.CNend */ 3361bd4fe43Sopenharmony_ci HI_WIFI_BW_LEGACY_20M, /**< 20M bandwidth. CNcomment: 20M带宽.CNend */ 3371bd4fe43Sopenharmony_ci HI_WIFI_BW_BUTT 3381bd4fe43Sopenharmony_ci} hi_wifi_bw; 3391bd4fe43Sopenharmony_ci 3401bd4fe43Sopenharmony_ci/** 3411bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 3421bd4fe43Sopenharmony_ci * 3431bd4fe43Sopenharmony_ci * The protocol mode of softap and station interfaces.CNcomment:softap和station接口的protocol模式.CNend 3441bd4fe43Sopenharmony_ci */ 3451bd4fe43Sopenharmony_citypedef enum { 3461bd4fe43Sopenharmony_ci HI_WIFI_PHY_MODE_11BGN, /**< 802.11BGN mode. CNcomment: 802.11BGN 模式.CNend */ 3471bd4fe43Sopenharmony_ci HI_WIFI_PHY_MODE_11BG, /**< 802.11BG mode. CNcomment: 802.11BG 模式.CNend */ 3481bd4fe43Sopenharmony_ci HI_WIFI_PHY_MODE_11B, /**< 802.11B mode. CNcomment: 802.11B 模式.CNend */ 3491bd4fe43Sopenharmony_ci HI_WIFI_PHY_MODE_BUTT 3501bd4fe43Sopenharmony_ci} hi_wifi_protocol_mode; 3511bd4fe43Sopenharmony_ci 3521bd4fe43Sopenharmony_ci/** 3531bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 3541bd4fe43Sopenharmony_ci * 3551bd4fe43Sopenharmony_ci * Authentification type enum.CNcomment:认证类型(连接网络不支持HI_WIFI_SECURITY_WPAPSK).CNend 3561bd4fe43Sopenharmony_ci */ 3571bd4fe43Sopenharmony_citypedef enum { 3581bd4fe43Sopenharmony_ci HI_WIFI_SECURITY_OPEN, /**< OPEN. CNcomment: 认证类型:开放.CNend */ 3591bd4fe43Sopenharmony_ci HI_WIFI_SECURITY_WEP, /**< WEP. CNcomment: 认证类型:WEP.CNend */ 3601bd4fe43Sopenharmony_ci HI_WIFI_SECURITY_WPA2PSK, /**< WPA-PSK. CNcomment: 认证类型:WPA2-PSK.CNend */ 3611bd4fe43Sopenharmony_ci HI_WIFI_SECURITY_WPAPSK_WPA2PSK_MIX, /**< WPA/WPA2-PSK MIX. CNcomment: 认证类型:WPA-PSK/WPA2-PSK混合.CNend */ 3621bd4fe43Sopenharmony_ci HI_WIFI_SECURITY_WPAPSK, /**< WPA-PSK. CNcomment: 认证类型:WPA-PSK.CNend */ 3631bd4fe43Sopenharmony_ci HI_WIFI_SECURITY_WPA, /**< WPA. CNcomment: 认证类型:WPA.CNend */ 3641bd4fe43Sopenharmony_ci HI_WIFI_SECURITY_WPA2, /**< WPA2. CNcomment: 认证类型:WPA2.CNend */ 3651bd4fe43Sopenharmony_ci HI_WIFI_SECURITY_SAE, /**< SAE. CNcomment: 认证类型:SAE.CNend */ 3661bd4fe43Sopenharmony_ci HI_WIFI_SECURITY_WPA3_WPA2_PSK_MIX, /**< WPA3/WPA2-PSK MIX. CNcomment: 认证类型:WPA3/WPA2-PSK混合.CNend */ 3671bd4fe43Sopenharmony_ci HI_WIFI_SECURITY_UNKNOWN /**< UNKNOWN. CNcomment: 其他认证类型:UNKNOWN.CNend */ 3681bd4fe43Sopenharmony_ci} hi_wifi_auth_mode; 3691bd4fe43Sopenharmony_ci 3701bd4fe43Sopenharmony_ci/** 3711bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 3721bd4fe43Sopenharmony_ci * 3731bd4fe43Sopenharmony_ci * Encryption type enum.CNcoment:加密类型.CNend 3741bd4fe43Sopenharmony_ci * 3751bd4fe43Sopenharmony_ci */ 3761bd4fe43Sopenharmony_citypedef enum { 3771bd4fe43Sopenharmony_ci HI_WIFI_PARIWISE_UNKNOWN, /**< UNKNOWN. CNcomment: 加密类型:UNKNOWN.CNend */ 3781bd4fe43Sopenharmony_ci HI_WIFI_PAIRWISE_AES, /**< AES. CNcomment: 加密类型:AES.CNend */ 3791bd4fe43Sopenharmony_ci HI_WIFI_PAIRWISE_TKIP, /**< TKIP. CNcomment: 加密类型:TKIP.CNend */ 3801bd4fe43Sopenharmony_ci HI_WIFI_PAIRWISE_TKIP_AES_MIX /**< TKIP/AES MIX. CNcomment: 加密类型:TKIP AES混合.CNend */ 3811bd4fe43Sopenharmony_ci} hi_wifi_pairwise; 3821bd4fe43Sopenharmony_ci 3831bd4fe43Sopenharmony_ci/** 3841bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 3851bd4fe43Sopenharmony_ci * 3861bd4fe43Sopenharmony_ci * PMF type enum.CNcomment:PMF管理帧保护模式类型.CNend 3871bd4fe43Sopenharmony_ci */ 3881bd4fe43Sopenharmony_citypedef enum { 3891bd4fe43Sopenharmony_ci HI_WIFI_MGMT_FRAME_PROTECTION_CLOSE, /**< Disable. CNcomment: 管理帧保护模式:关闭.CNend */ 3901bd4fe43Sopenharmony_ci HI_WIFI_MGMT_FRAME_PROTECTION_OPTIONAL, /**< Optional. CNcomment: 管理帧保护模式:可选.CNend */ 3911bd4fe43Sopenharmony_ci HI_WIFI_MGMT_FRAME_PROTECTION_REQUIRED /**< Required. CNcomment: 管理帧保护模式:必须.CNend */ 3921bd4fe43Sopenharmony_ci} hi_wifi_pmf_options; 3931bd4fe43Sopenharmony_ci 3941bd4fe43Sopenharmony_ci/** 3951bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 3961bd4fe43Sopenharmony_ci * 3971bd4fe43Sopenharmony_ci * Type of connect's status.CNcomment:连接状态.CNend 3981bd4fe43Sopenharmony_ci */ 3991bd4fe43Sopenharmony_citypedef enum { 4001bd4fe43Sopenharmony_ci HI_WIFI_DISCONNECTED, /**< Disconnected. CNcomment: 连接状态:未连接.CNend */ 4011bd4fe43Sopenharmony_ci HI_WIFI_CONNECTED, /**< Connected. CNcomment: 连接状态:已连接.CNend */ 4021bd4fe43Sopenharmony_ci} hi_wifi_conn_status; 4031bd4fe43Sopenharmony_ci 4041bd4fe43Sopenharmony_ci/** 4051bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 4061bd4fe43Sopenharmony_ci * 4071bd4fe43Sopenharmony_ci * Frame type that usr ies will insert into.CNcomment: 待插入ie字段的帧类型.CNend 4081bd4fe43Sopenharmony_ci */ 4091bd4fe43Sopenharmony_citypedef enum { 4101bd4fe43Sopenharmony_ci HI_WIFI_FRAME_TYPE_BEACON = bit(0), 4111bd4fe43Sopenharmony_ci HI_WIFI_FRAME_TYPE_PROBE_REQ = bit(1), 4121bd4fe43Sopenharmony_ci HI_WIFI_FRAME_TYPE_PROBE_RSP = bit(2), 4131bd4fe43Sopenharmony_ci HI_WIFI_FRAME_TYPE_BUTT 4141bd4fe43Sopenharmony_ci} hi_wifi_frame_type; 4151bd4fe43Sopenharmony_ci 4161bd4fe43Sopenharmony_ci/** 4171bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 4181bd4fe43Sopenharmony_ci * 4191bd4fe43Sopenharmony_ci * Usr ie type to be inserted.CNcomment: 待插入ie字段类型.CNend 4201bd4fe43Sopenharmony_ci */ 4211bd4fe43Sopenharmony_citypedef enum { 4221bd4fe43Sopenharmony_ci HI_WIFI_USR_IE_TYPE_DEFAULT = 0, 4231bd4fe43Sopenharmony_ci HI_WIFI_USR_IE_BUTT 4241bd4fe43Sopenharmony_ci} hi_wifi_usr_ie_type; 4251bd4fe43Sopenharmony_ci 4261bd4fe43Sopenharmony_ci/** 4271bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 4281bd4fe43Sopenharmony_ci * 4291bd4fe43Sopenharmony_ci * Event type of WiFi event.CNcomment:锚点功能上报的事件类型.CNend 4301bd4fe43Sopenharmony_ci */ 4311bd4fe43Sopenharmony_citypedef enum { 4321bd4fe43Sopenharmony_ci HI_WIFI_ANCHOR_UNKNOWN, /**< UNKNWON. CNcomment: UNKNOWN.CNend */ 4331bd4fe43Sopenharmony_ci HI_WIFI_ANCHOR_SCAN_DONE, /**< Scan finish. CNcomment: 锚点扫描完成.CNend */ 4341bd4fe43Sopenharmony_ci HI_WIFI_ANCHOR_SCAN_NO_BSS, /**< Scan no bss. CNcomment: 锚点未扫描到对应bss.CNend */ 4351bd4fe43Sopenharmony_ci HI_WIFI_ANCHOR_CONNECTED, /**< Connected. CNcomment: 锚点已连接.CNend */ 4361bd4fe43Sopenharmony_ci HI_WIFI_ANCHOR_DISCONNECTED, /**< Disconnected. CNcomment: 锚点断开连接.CNend */ 4371bd4fe43Sopenharmony_ci HI_WIFI_ANCHOR_REPORT_BCN, /**< REPORT_BCN. CNcomment: 锚点上报BEACON包.CNend */ 4381bd4fe43Sopenharmony_ci HI_WIFI_ANCHOR_BUTT 4391bd4fe43Sopenharmony_ci} hi_anchor_event_type; 4401bd4fe43Sopenharmony_ci 4411bd4fe43Sopenharmony_ci/** 4421bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 4431bd4fe43Sopenharmony_ci * 4441bd4fe43Sopenharmony_ci * Event type of WiFi event.CNcomment:WiFi的事件类型.CNend 4451bd4fe43Sopenharmony_ci */ 4461bd4fe43Sopenharmony_citypedef enum { 4471bd4fe43Sopenharmony_ci HI_WIFI_EVT_UNKNOWN, /**< UNKNWON. CNcomment: UNKNOWN.CNend */ 4481bd4fe43Sopenharmony_ci HI_WIFI_EVT_SCAN_DONE, /**< Scan finish. CNcomment: STA扫描完成.CNend */ 4491bd4fe43Sopenharmony_ci HI_WIFI_EVT_CONNECTED, /**< Connected. CNcomment: 已连接.CNend */ 4501bd4fe43Sopenharmony_ci HI_WIFI_EVT_DISCONNECTED, /**< Disconnected. CNcomment: 断开连接.CNend */ 4511bd4fe43Sopenharmony_ci HI_WIFI_EVT_WPS_TIMEOUT, /**< WPS timeout. CNcomment: WPS事件超时.CNend */ 4521bd4fe43Sopenharmony_ci HI_WIFI_EVT_MESH_CONNECTED, /**< MESH connected. CNcomment: MESH已连接.CNend */ 4531bd4fe43Sopenharmony_ci HI_WIFI_EVT_MESH_DISCONNECTED, /**< MESH disconnected. CNcomment: MESH断开连接.CNend */ 4541bd4fe43Sopenharmony_ci HI_WIFI_EVT_AP_START, /**< AP start. CNcomment: AP开启.CNend */ 4551bd4fe43Sopenharmony_ci HI_WIFI_EVT_STA_CONNECTED, /**< STA connected with ap. CNcomment: AP和STA已连接.CNend */ 4561bd4fe43Sopenharmony_ci HI_WIFI_EVT_STA_DISCONNECTED, /**< STA disconnected from ap. CNcomment: AP和STA断开连接.CNend */ 4571bd4fe43Sopenharmony_ci HI_WIFI_EVT_STA_FCON_NO_NETWORK, /**< STA connect, but can't find network. CNcomment: STA连接时扫描不到网络.CNend */ 4581bd4fe43Sopenharmony_ci HI_WIFI_EVT_MESH_CANNOT_FOUND, /**< MESH can't find network. CNcomment: MESH关联扫不到对端.CNend */ 4591bd4fe43Sopenharmony_ci HI_WIFI_EVT_MESH_SCAN_DONE, /**< MESH AP scan finish. CNcomment: MESH AP扫描完成.CNend */ 4601bd4fe43Sopenharmony_ci HI_WIFI_EVT_MESH_STA_SCAN_DONE, /**< MESH STA scan finish. CNcomment: MESH STA扫描完成.CNend */ 4611bd4fe43Sopenharmony_ci HI_WIFI_EVT_AP_SCAN_DONE, /**< AP scan finish. CNcomment: AP扫描完成.CNend */ 4621bd4fe43Sopenharmony_ci HI_WIFI_EVT_BUTT 4631bd4fe43Sopenharmony_ci} hi_wifi_event_type; 4641bd4fe43Sopenharmony_ci 4651bd4fe43Sopenharmony_ci/** 4661bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 4671bd4fe43Sopenharmony_ci * 4681bd4fe43Sopenharmony_ci * Scan type enum.CNcomment:扫描类型.CNend 4691bd4fe43Sopenharmony_ci */ 4701bd4fe43Sopenharmony_citypedef enum { 4711bd4fe43Sopenharmony_ci HI_WIFI_BASIC_SCAN, /**< Common and all channel scan. CNcomment: 普通扫描.CNend */ 4721bd4fe43Sopenharmony_ci HI_WIFI_CHANNEL_SCAN, /**< Specified channel scan. CNcomment: 指定信道扫描.CNend */ 4731bd4fe43Sopenharmony_ci HI_WIFI_SSID_SCAN, /**< Specified SSID scan. CNcomment: 指定SSID扫描.CNend */ 4741bd4fe43Sopenharmony_ci HI_WIFI_SSID_PREFIX_SCAN, /**< Prefix SSID scan. CNcomment: SSID前缀扫描.CNend */ 4751bd4fe43Sopenharmony_ci HI_WIFI_BSSID_SCAN, /**< Specified BSSID scan. CNcomment: 指定BSSID扫描.CNend */ 4761bd4fe43Sopenharmony_ci} hi_wifi_scan_type; 4771bd4fe43Sopenharmony_ci 4781bd4fe43Sopenharmony_ci/** 4791bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 4801bd4fe43Sopenharmony_ci * 4811bd4fe43Sopenharmony_ci * WPA PSK usage type.CNcomment: WPA PSK使用策略.CNend 4821bd4fe43Sopenharmony_ci */ 4831bd4fe43Sopenharmony_citypedef enum { 4841bd4fe43Sopenharmony_ci HI_WIFI_WPA_PSK_NOT_USE, /**< Not use. CNcomment: 不使用.CNend */ 4851bd4fe43Sopenharmony_ci HI_WIFI_WPA_PSK_USE_INNER, /**< Inner PSK. CNcomment: 使用内部PSK.CNend */ 4861bd4fe43Sopenharmony_ci HI_WIFI_WPA_PSK_USE_OUTER, /**< Outer PSK. CNcomment: 使用外部PSK.CNend */ 4871bd4fe43Sopenharmony_ci} hi_wifi_wpa_psk_usage_type; 4881bd4fe43Sopenharmony_ci 4891bd4fe43Sopenharmony_ci/** 4901bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 4911bd4fe43Sopenharmony_ci * 4921bd4fe43Sopenharmony_ci * XLDO voltage.CNcomment: XLDO控制电压.CNend 4931bd4fe43Sopenharmony_ci */ 4941bd4fe43Sopenharmony_citypedef enum { 4951bd4fe43Sopenharmony_ci HI_WIFI_XLDO_VOLTAGE_0 = 0x00, /**< 1.5V. CNcomment: 1.5V.CNend */ 4961bd4fe43Sopenharmony_ci HI_WIFI_XLDO_VOLTAGE_1 = 0x11, /**< 1.8V. CNcomment: 1.8V.CNend */ 4971bd4fe43Sopenharmony_ci HI_WIFI_XLDO_VOLTAGE_2 = 0x22, /**< 2.1V. CNcomment: 2.1V.CNend */ 4981bd4fe43Sopenharmony_ci HI_WIFI_XLDO_VOLTAGE_3 = 0x33, /**< 2.4V. CNcomment: 2.4V.CNend */ 4991bd4fe43Sopenharmony_ci} hi_wifi_xldo_voltage; 5001bd4fe43Sopenharmony_ci 5011bd4fe43Sopenharmony_ci/** 5021bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 5031bd4fe43Sopenharmony_ci * 5041bd4fe43Sopenharmony_ci * parameters of scan.CNcomment:station和mesh接口scan参数.CNend 5051bd4fe43Sopenharmony_ci */ 5061bd4fe43Sopenharmony_citypedef struct { 5071bd4fe43Sopenharmony_ci char ssid[HI_WIFI_MAX_SSID_LEN + 1]; /**< SSID. CNcomment: SSID 只支持ASCII字符.CNend */ 5081bd4fe43Sopenharmony_ci unsigned char bssid[HI_WIFI_MAC_LEN]; /**< BSSID. CNcomment: BSSID.CNend */ 5091bd4fe43Sopenharmony_ci unsigned char ssid_len; /**< SSID length. CNcomment: SSID长度.CNend */ 5101bd4fe43Sopenharmony_ci unsigned char channel; /**< Channel number. CNcomment: 信道号,范围1-14,不同区域有差异.CNend */ 5111bd4fe43Sopenharmony_ci hi_wifi_scan_type scan_type; /**< Scan type. CNcomment: 扫描类型.CNend */ 5121bd4fe43Sopenharmony_ci} hi_wifi_scan_params; 5131bd4fe43Sopenharmony_ci 5141bd4fe43Sopenharmony_ci/** 5151bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 5161bd4fe43Sopenharmony_ci * 5171bd4fe43Sopenharmony_ci * Struct of scan result.CNcomment:扫描结果结构体.CNend 5181bd4fe43Sopenharmony_ci */ 5191bd4fe43Sopenharmony_citypedef struct { 5201bd4fe43Sopenharmony_ci char ssid[HI_WIFI_MAX_SSID_LEN + 1]; /**< SSID. CNcomment: SSID 只支持ASCII字符.CNend */ 5211bd4fe43Sopenharmony_ci unsigned char bssid[HI_WIFI_MAC_LEN]; /**< BSSID. CNcomment: BSSID.CNend */ 5221bd4fe43Sopenharmony_ci unsigned int channel; /**< Channel number. CNcomment: 信道号,范围1-14,不同区域有差异.CNend */ 5231bd4fe43Sopenharmony_ci hi_wifi_auth_mode auth; /**< Authentication type. CNcomment: 认证类型.CNend */ 5241bd4fe43Sopenharmony_ci int rssi; /**< Signal Strength. CNcomment: 信号强度.CNend */ 5251bd4fe43Sopenharmony_ci unsigned char wps_flag : 1; /**< WPS flag. CNcomment: WPS标识.CNend */ 5261bd4fe43Sopenharmony_ci unsigned char wps_session : 1; /**< WPS session:PBC-0/PIN-1. CNcomment: WPS会话类型,PBC-0/PIN-1.CNend */ 5271bd4fe43Sopenharmony_ci unsigned char wmm : 1; /**< WMM flag. CNcomment: WMM标识.CNend */ 5281bd4fe43Sopenharmony_ci unsigned char resv : 1; /**< Reserved. CNcomment: 预留.CNend */ 5291bd4fe43Sopenharmony_ci unsigned char hisi_mesh_flag : 1; /**< MESH flag. CNcomment: MESH标识.CNend */ 5301bd4fe43Sopenharmony_ci} hi_wifi_ap_info; 5311bd4fe43Sopenharmony_ci 5321bd4fe43Sopenharmony_ci/** 5331bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 5341bd4fe43Sopenharmony_ci * 5351bd4fe43Sopenharmony_ci * Struct of connect parameters.CNcomment:station连接结构体.CNend 5361bd4fe43Sopenharmony_ci */ 5371bd4fe43Sopenharmony_citypedef struct { 5381bd4fe43Sopenharmony_ci char ssid[HI_WIFI_MAX_SSID_LEN + 1]; /**< SSID. CNcomment: SSID 只支持ASCII字符.CNend */ 5391bd4fe43Sopenharmony_ci hi_wifi_auth_mode auth; /**< Authentication mode. CNcomment: 认证类型.CNend */ 5401bd4fe43Sopenharmony_ci char key[HI_WIFI_MAX_KEY_LEN + 1]; /**< Secret key. CNcomment: 秘钥.CNend */ 5411bd4fe43Sopenharmony_ci unsigned char bssid[HI_WIFI_MAC_LEN]; /**< BSSID. CNcomment: BSSID.CNend */ 5421bd4fe43Sopenharmony_ci hi_wifi_pairwise pairwise; /**< Encryption type. CNcomment: 加密方式,不需指定时置0.CNend */ 5431bd4fe43Sopenharmony_ci} hi_wifi_assoc_request; 5441bd4fe43Sopenharmony_ci 5451bd4fe43Sopenharmony_ci/** 5461bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 5471bd4fe43Sopenharmony_ci * 5481bd4fe43Sopenharmony_ci * Struct of fast connect parameters.CNcomment:station快速连接结构体.CNend 5491bd4fe43Sopenharmony_ci */ 5501bd4fe43Sopenharmony_citypedef struct { 5511bd4fe43Sopenharmony_ci hi_wifi_assoc_request req; /**< Association request. CNcomment: 关联请求.CNend */ 5521bd4fe43Sopenharmony_ci unsigned char channel; /**< Channel number. CNcomment: 信道号,范围1-14,不同区域有差异.CNend */ 5531bd4fe43Sopenharmony_ci unsigned char psk[HI_WIFI_STA_PSK_LEN]; /**< PSK. CNcomment: PSL.CNend */ 5541bd4fe43Sopenharmony_ci hi_wifi_wpa_psk_usage_type psk_flag; /**< PSK TYPE. CNcomment: psk的标志,不需指定时置0.CNend */ 5551bd4fe43Sopenharmony_ci} hi_wifi_fast_assoc_request; 5561bd4fe43Sopenharmony_ci 5571bd4fe43Sopenharmony_ci/** 5581bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 5591bd4fe43Sopenharmony_ci * 5601bd4fe43Sopenharmony_ci * Status of sta's connection.CNcomment:获取station连接状态.CNend 5611bd4fe43Sopenharmony_ci */ 5621bd4fe43Sopenharmony_citypedef struct { 5631bd4fe43Sopenharmony_ci char ssid[HI_WIFI_MAX_SSID_LEN + 1]; /**< SSID. CNcomment: SSID 只支持ASCII字符.CNend */ 5641bd4fe43Sopenharmony_ci unsigned char bssid[HI_WIFI_MAC_LEN]; /**< BSSID. CNcomment: BSSID.CNend */ 5651bd4fe43Sopenharmony_ci unsigned int channel; /**< Channel number. CNcomment: 信道号,范围1-14,不同区域有差异.CNend */ 5661bd4fe43Sopenharmony_ci hi_wifi_conn_status status; /**< Connect status. CNcomment: 连接状态.CNend */ 5671bd4fe43Sopenharmony_ci} hi_wifi_status; 5681bd4fe43Sopenharmony_ci 5691bd4fe43Sopenharmony_ci/** 5701bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 5711bd4fe43Sopenharmony_ci * 5721bd4fe43Sopenharmony_ci * Event type of wifi scan done.CNcomment:扫描完成事件.CNend 5731bd4fe43Sopenharmony_ci */ 5741bd4fe43Sopenharmony_citypedef struct { 5751bd4fe43Sopenharmony_ci unsigned short bss_num; /**< numbers of scan result. CNcomment: 扫描到的ap数目.CNend */ 5761bd4fe43Sopenharmony_ci} event_wifi_scan_done; 5771bd4fe43Sopenharmony_ci 5781bd4fe43Sopenharmony_ci/** 5791bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 5801bd4fe43Sopenharmony_ci * 5811bd4fe43Sopenharmony_ci * Event type of wifi connected CNcomment:wifi的connect事件信息.CNend 5821bd4fe43Sopenharmony_ci */ 5831bd4fe43Sopenharmony_citypedef struct { 5841bd4fe43Sopenharmony_ci char ssid[HI_WIFI_MAX_SSID_LEN + 1]; /**< SSID. CNcomment: SSID 只支持ASCII字符.CNend */ 5851bd4fe43Sopenharmony_ci unsigned char bssid[HI_WIFI_MAC_LEN]; /**< BSSID. CNcomment: BSSID.CNend */ 5861bd4fe43Sopenharmony_ci unsigned char ssid_len; /**< SSID length. CNcomment: SSID长度.CNend */ 5871bd4fe43Sopenharmony_ci char ifname[WIFI_IFNAME_MAX_SIZE + 1]; /**< Iftype name. CNcomment: 接口名称.CNend */ 5881bd4fe43Sopenharmony_ci} event_wifi_connected; 5891bd4fe43Sopenharmony_ci 5901bd4fe43Sopenharmony_ci/** 5911bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 5921bd4fe43Sopenharmony_ci * 5931bd4fe43Sopenharmony_ci * Event type of wifi disconnected.CNcomment:wifi的断开事件信息.CNend 5941bd4fe43Sopenharmony_ci */ 5951bd4fe43Sopenharmony_citypedef struct { 5961bd4fe43Sopenharmony_ci unsigned char bssid[HI_WIFI_MAC_LEN]; /**< BSSID. CNcomment: BSSID.CNend */ 5971bd4fe43Sopenharmony_ci unsigned short reason_code; /**< reason code. CNcomment: 断开原因.CNend */ 5981bd4fe43Sopenharmony_ci char ifname[WIFI_IFNAME_MAX_SIZE + 1]; /**< Iftype name. CNcomment: 接口名称.CNend */ 5991bd4fe43Sopenharmony_ci} event_wifi_disconnected; 6001bd4fe43Sopenharmony_ci 6011bd4fe43Sopenharmony_ci/** 6021bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 6031bd4fe43Sopenharmony_ci * 6041bd4fe43Sopenharmony_ci * Event type of ap connected sta.CNcomment:ap连接sta事件信息.CNend 6051bd4fe43Sopenharmony_ci */ 6061bd4fe43Sopenharmony_citypedef struct { 6071bd4fe43Sopenharmony_ci char addr[HI_WIFI_MAC_LEN]; /**< user's mac address of SoftAp. CNcomment: 连接AP的sta地址.CNend */ 6081bd4fe43Sopenharmony_ci} event_ap_sta_connected; 6091bd4fe43Sopenharmony_ci 6101bd4fe43Sopenharmony_ci/** 6111bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 6121bd4fe43Sopenharmony_ci * 6131bd4fe43Sopenharmony_ci * Event type of ap disconnected sta.CNcomment:ap断开sta事件信息.CNend 6141bd4fe43Sopenharmony_ci */ 6151bd4fe43Sopenharmony_citypedef struct { 6161bd4fe43Sopenharmony_ci unsigned char addr[HI_WIFI_MAC_LEN]; /**< User's mac address of SoftAp. CNcomment: AP断开STA的MAC地址.CNend */ 6171bd4fe43Sopenharmony_ci unsigned short reason_code; /**< Reason code. CNcomment: AP断开连接的原因值.CNend */ 6181bd4fe43Sopenharmony_ci} event_ap_sta_disconnected; 6191bd4fe43Sopenharmony_ci 6201bd4fe43Sopenharmony_ci/** 6211bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 6221bd4fe43Sopenharmony_ci * 6231bd4fe43Sopenharmony_ci * Event type of mesh connected.CNcomment:mesh的connect事件信息.CNend 6241bd4fe43Sopenharmony_ci */ 6251bd4fe43Sopenharmony_citypedef struct { 6261bd4fe43Sopenharmony_ci unsigned char addr[HI_WIFI_MAC_LEN]; /**< User's mac address of MESH. CNcomment: MESH连接的peer MAC地址.CNend */ 6271bd4fe43Sopenharmony_ci} event_mesh_connected; 6281bd4fe43Sopenharmony_ci 6291bd4fe43Sopenharmony_ci/** 6301bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 6311bd4fe43Sopenharmony_ci * 6321bd4fe43Sopenharmony_ci * Event type of mesh disconnected.CNcomment:mesh的disconnect事件信息.CNend 6331bd4fe43Sopenharmony_ci */ 6341bd4fe43Sopenharmony_citypedef struct { 6351bd4fe43Sopenharmony_ci unsigned char addr[HI_WIFI_MAC_LEN]; /**< User's mac address of MESH. CNcomment: 断开连接的peer MAC地址.CNend */ 6361bd4fe43Sopenharmony_ci unsigned short reason_code; /**< Reason code. CNcomment: MESH断开连接的原因.CNend */ 6371bd4fe43Sopenharmony_ci} event_mesh_disconnected; 6381bd4fe43Sopenharmony_ci 6391bd4fe43Sopenharmony_ci/** 6401bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 6411bd4fe43Sopenharmony_ci * 6421bd4fe43Sopenharmony_ci * Event type wifi information.CNcomment:wifi的事件信息体.CNend 6431bd4fe43Sopenharmony_ci */ 6441bd4fe43Sopenharmony_citypedef union { 6451bd4fe43Sopenharmony_ci event_wifi_scan_done wifi_scan_done; /**< Scan finish event. CNcomment: WIFI扫描完成事件信息.CNend */ 6461bd4fe43Sopenharmony_ci event_wifi_connected wifi_connected; /**< STA's connected event. CNcomment: STA的连接事件信息.CNend */ 6471bd4fe43Sopenharmony_ci event_wifi_disconnected wifi_disconnected; /**< STA's dsiconnected event. CNcomment: STA的断连事件信息.CNend */ 6481bd4fe43Sopenharmony_ci event_ap_sta_connected ap_sta_connected; /**< AP's connected event . CNcomment: AP的连接事件信息.CNend */ 6491bd4fe43Sopenharmony_ci event_ap_sta_disconnected ap_sta_disconnected; /**< AP's disconnected event. CNcomment: AP的断连事件信息.CNend */ 6501bd4fe43Sopenharmony_ci event_mesh_connected mesh_connected; /**< MESH's connected event. CNcomment: MESH连接事件信息.CNend */ 6511bd4fe43Sopenharmony_ci event_mesh_disconnected mesh_disconnected; /**< MESH's disconnected event. CNcomment: MESH断连事件信息.CNend */ 6521bd4fe43Sopenharmony_ci} hi_wifi_event_info; 6531bd4fe43Sopenharmony_ci 6541bd4fe43Sopenharmony_ci/** 6551bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 6561bd4fe43Sopenharmony_ci * 6571bd4fe43Sopenharmony_ci * Struct of WiFi event.CNcomment:WiFi事件结构体.CNend 6581bd4fe43Sopenharmony_ci * 6591bd4fe43Sopenharmony_ci */ 6601bd4fe43Sopenharmony_citypedef struct { 6611bd4fe43Sopenharmony_ci hi_wifi_event_type event; /**< Event type. CNcomment: 事件类型.CNend */ 6621bd4fe43Sopenharmony_ci hi_wifi_event_info info; /**< Event information. CNcomment: 事件信息.CNend */ 6631bd4fe43Sopenharmony_ci} hi_wifi_event; 6641bd4fe43Sopenharmony_ci 6651bd4fe43Sopenharmony_ci/** 6661bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 6671bd4fe43Sopenharmony_ci * 6681bd4fe43Sopenharmony_ci * Struct of softap's basic config.CNcomment:softap基本配置.CNend 6691bd4fe43Sopenharmony_ci * 6701bd4fe43Sopenharmony_ci */ 6711bd4fe43Sopenharmony_citypedef struct { 6721bd4fe43Sopenharmony_ci char ssid[HI_WIFI_MAX_SSID_LEN + 1]; /**< SSID. CNcomment: SSID 只支持ASCII字符.CNend */ 6731bd4fe43Sopenharmony_ci char key[HI_WIFI_AP_KEY_LEN + 1]; /**< Secret key. CNcomment: 秘钥.CNend */ 6741bd4fe43Sopenharmony_ci unsigned char channel_num; /**< Channel number. CNcomment: 信道号,范围1-14,不同区域有差异.CNend */ 6751bd4fe43Sopenharmony_ci int ssid_hidden; /**< Hidden ssid. CNcomment: 是否隐藏SSID.CNend */ 6761bd4fe43Sopenharmony_ci hi_wifi_auth_mode authmode; /**< Authentication mode. CNcomment: 认证方式.CNend */ 6771bd4fe43Sopenharmony_ci hi_wifi_pairwise pairwise; /**< Encryption type. CNcomment: 加密方式,不需指定时置0.CNend */ 6781bd4fe43Sopenharmony_ci} hi_wifi_softap_config; 6791bd4fe43Sopenharmony_ci 6801bd4fe43Sopenharmony_ci/** 6811bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 6821bd4fe43Sopenharmony_ci * 6831bd4fe43Sopenharmony_ci * mac address of softap's user.CNcomment:与softap相连的station mac地址.CNend 6841bd4fe43Sopenharmony_ci * 6851bd4fe43Sopenharmony_ci */ 6861bd4fe43Sopenharmony_citypedef struct { 6871bd4fe43Sopenharmony_ci unsigned char mac[HI_WIFI_MAC_LEN]; /**< MAC address.CNcomment:与softap相连的station mac地址.CNend */ 6881bd4fe43Sopenharmony_ci} hi_wifi_ap_sta_info; 6891bd4fe43Sopenharmony_ci 6901bd4fe43Sopenharmony_ci/** 6911bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 6921bd4fe43Sopenharmony_ci * 6931bd4fe43Sopenharmony_ci * Struct of frame filter config in monitor mode.CNcomment:混杂模式报文接收过滤设置.CNend 6941bd4fe43Sopenharmony_ci */ 6951bd4fe43Sopenharmony_citypedef struct { 6961bd4fe43Sopenharmony_ci char mdata_en : 1; /**< get multi-cast data frame flag. CNcomment: 使能接收组播(广播)数据包.CNend */ 6971bd4fe43Sopenharmony_ci char udata_en : 1; /**< get single-cast data frame flag. CNcomment: 使能接收单播数据包.CNend */ 6981bd4fe43Sopenharmony_ci char mmngt_en : 1; /**< get multi-cast mgmt frame flag. CNcomment: 使能接收组播(广播)管理包.CNend */ 6991bd4fe43Sopenharmony_ci char umngt_en : 1; /**< get single-cast mgmt frame flag. CNcomment: 使能接收单播管理包.CNend */ 7001bd4fe43Sopenharmony_ci char custom_en : 1; /**< get beacon/probe response flag. CNcomment: 使能STA接收beacon/probe response包.CNend */ 7011bd4fe43Sopenharmony_ci char resvd : 3; /**< reserved bits. CNcomment: 保留字段.CNend */ 7021bd4fe43Sopenharmony_ci} hi_wifi_ptype_filter; 7031bd4fe43Sopenharmony_ci 7041bd4fe43Sopenharmony_ci/** 7051bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 7061bd4fe43Sopenharmony_ci * 7071bd4fe43Sopenharmony_ci * Struct of WPA psk calc config.CNcomment:计算WPA psk需要设置的参数.CNend 7081bd4fe43Sopenharmony_ci */ 7091bd4fe43Sopenharmony_citypedef struct { 7101bd4fe43Sopenharmony_ci unsigned char ssid[HI_WIFI_MAX_SSID_LEN + 1]; /**< SSID. CNcomment: SSID 只支持ASCII字符.CNend */ 7111bd4fe43Sopenharmony_ci char key[HI_WIFI_AP_KEY_LEN + 1]; /**< Secret key. CNcomment: 秘钥.CNend */ 7121bd4fe43Sopenharmony_ci} hi_wifi_sta_psk_config; 7131bd4fe43Sopenharmony_ci 7141bd4fe43Sopenharmony_ci/** 7151bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 7161bd4fe43Sopenharmony_ci * 7171bd4fe43Sopenharmony_ci * callback function definition of monitor mode.CNcommment:混杂模式收包回调接口定义.CNend 7181bd4fe43Sopenharmony_ci */ 7191bd4fe43Sopenharmony_citypedef int (*hi_wifi_promis_cb)(void* recv_buf, int frame_len, signed char rssi); 7201bd4fe43Sopenharmony_ci 7211bd4fe43Sopenharmony_ci/** 7221bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 7231bd4fe43Sopenharmony_ci * 7241bd4fe43Sopenharmony_ci * callback function definition of wifi event.CNcommment:wifi事件回调接口定义.CNend 7251bd4fe43Sopenharmony_ci */ 7261bd4fe43Sopenharmony_citypedef void (*hi_wifi_event_cb)(const hi_wifi_event *event); 7271bd4fe43Sopenharmony_ci 7281bd4fe43Sopenharmony_ci/** 7291bd4fe43Sopenharmony_ci * @ingroup hi_wifi_basic 7301bd4fe43Sopenharmony_ci * 7311bd4fe43Sopenharmony_ci * callback function definition of anchor.CNcommment:锚点功能回调接口定义.CNend 7321bd4fe43Sopenharmony_ci */ 7331bd4fe43Sopenharmony_citypedef void (*hi_wifi_anchor_cb)(hi_anchor_event_type event, const unsigned char *info, unsigned int len); 7341bd4fe43Sopenharmony_ci 7351bd4fe43Sopenharmony_ci/** 7361bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 7371bd4fe43Sopenharmony_ci* @brief Wifi initialize.CNcomment:wifi初始化.CNend 7381bd4fe43Sopenharmony_ci* 7391bd4fe43Sopenharmony_ci* @par Description: 7401bd4fe43Sopenharmony_ci Wifi driver initialize.CNcomment:wifi驱动初始化,不创建wifi设备.CNend 7411bd4fe43Sopenharmony_ci* 7421bd4fe43Sopenharmony_ci* @attention NULL 7431bd4fe43Sopenharmony_ci* @param vap_res_num [IN] Type #const unsigned char, vap num[rang: 1-3].CNcomment:vap资源个数,取值[1-3].CNend 7441bd4fe43Sopenharmony_ci* @param user_res_num [IN] Type #const unsigned char, user resource num[1-7]. 7451bd4fe43Sopenharmony_ci* CNcomment:用户资源个数,多vap时共享,取值[1-7].CNend 7461bd4fe43Sopenharmony_ci* 7471bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 7481bd4fe43Sopenharmony_ci* @retval #Other Error code 7491bd4fe43Sopenharmony_ci* @par Dependency: 7501bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 7511bd4fe43Sopenharmony_ci* @see NULL 7521bd4fe43Sopenharmony_ci*/ 7531bd4fe43Sopenharmony_ciint hi_wifi_init(const unsigned char vap_res_num, const unsigned char user_res_num); 7541bd4fe43Sopenharmony_ci 7551bd4fe43Sopenharmony_ci/** 7561bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 7571bd4fe43Sopenharmony_ci* @brief Wifi de-initialize.CNcomment:wifi去初始化.CNend 7581bd4fe43Sopenharmony_ci* 7591bd4fe43Sopenharmony_ci* @par Description: 7601bd4fe43Sopenharmony_ci* Wifi driver de-initialize.CNcomment:wifi驱动去初始化.CNend 7611bd4fe43Sopenharmony_ci* 7621bd4fe43Sopenharmony_ci* @attention NULL 7631bd4fe43Sopenharmony_ci* @param NULL 7641bd4fe43Sopenharmony_ci* 7651bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 7661bd4fe43Sopenharmony_ci* @retval #Other Error code 7671bd4fe43Sopenharmony_ci* @par Dependency: 7681bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 7691bd4fe43Sopenharmony_ci* @see NULL 7701bd4fe43Sopenharmony_ci*/ 7711bd4fe43Sopenharmony_ciint hi_wifi_deinit(void); 7721bd4fe43Sopenharmony_ci 7731bd4fe43Sopenharmony_ci/** 7741bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 7751bd4fe43Sopenharmony_ci* @brief Get wifi initialize status.CNcomment:获取wifi初始化状态.CNend 7761bd4fe43Sopenharmony_ci* 7771bd4fe43Sopenharmony_ci* @par Description: 7781bd4fe43Sopenharmony_ci Get wifi initialize status.CNcomment:获取wifi初始化状态.CNend 7791bd4fe43Sopenharmony_ci* 7801bd4fe43Sopenharmony_ci* @attention NULL 7811bd4fe43Sopenharmony_ci* @param NULL 7821bd4fe43Sopenharmony_ci* 7831bd4fe43Sopenharmony_ci* @retval #1 Wifi is initialized.CNcoment:Wifi已经初始化.CNend 7841bd4fe43Sopenharmony_ci* @retval #0 Wifi is not initialized.CNcoment:Wifi没有初始化.CNend 7851bd4fe43Sopenharmony_ci* @par Dependency: 7861bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 7871bd4fe43Sopenharmony_ci* @see NULL 7881bd4fe43Sopenharmony_ci*/ 7891bd4fe43Sopenharmony_ciunsigned char hi_wifi_get_init_status(void); 7901bd4fe43Sopenharmony_ci 7911bd4fe43Sopenharmony_ci/** 7921bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 7931bd4fe43Sopenharmony_ci* @brief Set protocol mode of sta.CNcomment:设置station接口的protocol模式.CNend 7941bd4fe43Sopenharmony_ci* 7951bd4fe43Sopenharmony_ci* @par Description: 7961bd4fe43Sopenharmony_ci* Set protocol mode of sta, set before calling hi_wifi_sta_start().\n 7971bd4fe43Sopenharmony_ci* CNcomment:配置station接口的protocol模式, 在sta start之前调用.CNend 7981bd4fe43Sopenharmony_ci* 7991bd4fe43Sopenharmony_ci* @attention Default mode 802.11BGN CNcomment:默认模式 802.11BGN.CNend 8001bd4fe43Sopenharmony_ci* @param mode [IN] Type #hi_wifi_protocol_mode, protocol mode. 8011bd4fe43Sopenharmony_ci* 8021bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 8031bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 8041bd4fe43Sopenharmony_ci* @par Dependency: 8051bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 8061bd4fe43Sopenharmony_ci* @see NULL 8071bd4fe43Sopenharmony_ci*/ 8081bd4fe43Sopenharmony_ciint hi_wifi_sta_set_protocol_mode(hi_wifi_protocol_mode mode); 8091bd4fe43Sopenharmony_ci 8101bd4fe43Sopenharmony_ci/** 8111bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 8121bd4fe43Sopenharmony_ci* @brief Get protocol mode of.CNcomment:获取station接口的protocol模式.CNend 8131bd4fe43Sopenharmony_ci* 8141bd4fe43Sopenharmony_ci* @par Description: 8151bd4fe43Sopenharmony_ci* Get protocol mode of station.CNcomment:获取station接口的protocol模式.CNend 8161bd4fe43Sopenharmony_ci* 8171bd4fe43Sopenharmony_ci* @attention NULL 8181bd4fe43Sopenharmony_ci* @param NULL 8191bd4fe43Sopenharmony_ci* 8201bd4fe43Sopenharmony_ci* @retval #hi_wifi_protocol_mode protocol mode. 8211bd4fe43Sopenharmony_ci* @par Dependency: 8221bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 8231bd4fe43Sopenharmony_ci* @see NULL 8241bd4fe43Sopenharmony_ci*/ 8251bd4fe43Sopenharmony_cihi_wifi_protocol_mode hi_wifi_sta_get_protocol_mode(void); 8261bd4fe43Sopenharmony_ci 8271bd4fe43Sopenharmony_ci/** 8281bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 8291bd4fe43Sopenharmony_ci* @brief Config pmf settings of sta.CNcomment:配置station的pmf.CNend 8301bd4fe43Sopenharmony_ci* 8311bd4fe43Sopenharmony_ci* @par Description: 8321bd4fe43Sopenharmony_ci* Config pmf settings of sta, set before sta start.CNcomment:配置station的pmf, 在sta start之前调用.CNend 8331bd4fe43Sopenharmony_ci* 8341bd4fe43Sopenharmony_ci* @attention Default pmf enum value 1. CNcomment:默认pmf枚举值1.CNend 8351bd4fe43Sopenharmony_ci* @param pmf [IN] Type #hi_wifi_pmf_options, pmf enum value.CNcoment:pmf枚举值.CNend 8361bd4fe43Sopenharmony_ci* 8371bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 8381bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 8391bd4fe43Sopenharmony_ci* @par Dependency: 8401bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 8411bd4fe43Sopenharmony_ci* @see NULL 8421bd4fe43Sopenharmony_ci*/ 8431bd4fe43Sopenharmony_ciint hi_wifi_set_pmf(hi_wifi_pmf_options pmf); 8441bd4fe43Sopenharmony_ci 8451bd4fe43Sopenharmony_ci/** 8461bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 8471bd4fe43Sopenharmony_ci* @brief Get pmf settings of sta.CNcomment:获取station的pmf设置.CNend 8481bd4fe43Sopenharmony_ci* 8491bd4fe43Sopenharmony_ci* @par Description: 8501bd4fe43Sopenharmony_ci* Get pmf settings of sta.CNcomment:获取station的pmf设置.CNend 8511bd4fe43Sopenharmony_ci* 8521bd4fe43Sopenharmony_ci* @attention NULL 8531bd4fe43Sopenharmony_ci* @param NULL 8541bd4fe43Sopenharmony_ci* 8551bd4fe43Sopenharmony_ci* @retval #hi_wifi_pmf_options pmf enum value. 8561bd4fe43Sopenharmony_ci* @par Dependency: 8571bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 8581bd4fe43Sopenharmony_ci* @see NULL 8591bd4fe43Sopenharmony_ci*/ 8601bd4fe43Sopenharmony_cihi_wifi_pmf_options hi_wifi_get_pmf(void); 8611bd4fe43Sopenharmony_ci 8621bd4fe43Sopenharmony_ci/** 8631bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 8641bd4fe43Sopenharmony_ci* @brief Start wifi station.CNcomment:开启STA.CNend 8651bd4fe43Sopenharmony_ci* 8661bd4fe43Sopenharmony_ci* @par Description: 8671bd4fe43Sopenharmony_ci* Start wifi station.CNcomment:开启STA.CNend 8681bd4fe43Sopenharmony_ci* 8691bd4fe43Sopenharmony_ci* @attention 1. Multiple interfaces of the same type are not supported.CNcomment:1. 不支持使用多个同类型接口.CNend\n 8701bd4fe43Sopenharmony_ci* 2. Dual interface coexistence support: STA + AP or STA + MESH. 8711bd4fe43Sopenharmony_ci* CNcomment:2. 双接口共存支持:STA + AP or STA + MESH.CNend\n 8721bd4fe43Sopenharmony_ci* 3. Start timeout 5s.CNcomment:3. 启动超时时间5s.CNend\n 8731bd4fe43Sopenharmony_ci* 4. The memories of <ifname> and <len> should be requested by the caller, 8741bd4fe43Sopenharmony_ci* the input value of len must be the same as the length of ifname(the recommended length is 17Bytes).\n 8751bd4fe43Sopenharmony_ci* CNcomment:4. <ifname>和<len>由调用者申请内存,用户写入len的值必须与ifname长度一致(建议长度为17Bytes).CNend \n 8761bd4fe43Sopenharmony_ci* 5. This is a blocking function.CNcomment:5.此函数为阻塞函数.CNend 8771bd4fe43Sopenharmony_ci* @param ifname [IN/OUT] Type #char *, device name.CNcomment:接口名.CNend 8781bd4fe43Sopenharmony_ci* @param len [IN/OUT] Type #int *, length of device name.CNcomment:接口名长度.CNend 8791bd4fe43Sopenharmony_ci* 8801bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 8811bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 8821bd4fe43Sopenharmony_ci* @par Dependency: 8831bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 8841bd4fe43Sopenharmony_ci* @see NULL 8851bd4fe43Sopenharmony_ci*/ 8861bd4fe43Sopenharmony_ciint hi_wifi_sta_start(char *ifname, int *len); 8871bd4fe43Sopenharmony_ci 8881bd4fe43Sopenharmony_ci/** 8891bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 8901bd4fe43Sopenharmony_ci* @brief Close wifi station.CNcomment:关闭STA.CNend 8911bd4fe43Sopenharmony_ci* 8921bd4fe43Sopenharmony_ci* @par Description: 8931bd4fe43Sopenharmony_ci* Close wifi station.CNcomment:关闭STA.CNend 8941bd4fe43Sopenharmony_ci* 8951bd4fe43Sopenharmony_ci* @attention 1. This is a blocking function.CNcomment:1.此函数为阻塞函数.CNend 8961bd4fe43Sopenharmony_ci* @param NULL 8971bd4fe43Sopenharmony_ci* 8981bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 8991bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 9001bd4fe43Sopenharmony_ci* @par Dependency: 9011bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 9021bd4fe43Sopenharmony_ci* @see NULL 9031bd4fe43Sopenharmony_ci*/ 9041bd4fe43Sopenharmony_ciint hi_wifi_sta_stop(void); 9051bd4fe43Sopenharmony_ci 9061bd4fe43Sopenharmony_ci/** 9071bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 9081bd4fe43Sopenharmony_ci* @brief Start sta basic scanning in all channels.CNcomment:station进行全信道基础扫描.CNend 9091bd4fe43Sopenharmony_ci* 9101bd4fe43Sopenharmony_ci* @par Description: 9111bd4fe43Sopenharmony_ci* Start sta basic scanning in all channels.CNcomment:启动station全信道基础扫描.CNend 9121bd4fe43Sopenharmony_ci* 9131bd4fe43Sopenharmony_ci* @attention NULL 9141bd4fe43Sopenharmony_ci* @param NULL 9151bd4fe43Sopenharmony_ci* 9161bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 9171bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 9181bd4fe43Sopenharmony_ci* @par Dependency: 9191bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 9201bd4fe43Sopenharmony_ci* @see NULL 9211bd4fe43Sopenharmony_ci*/ 9221bd4fe43Sopenharmony_ciint hi_wifi_sta_scan(void); 9231bd4fe43Sopenharmony_ci 9241bd4fe43Sopenharmony_ci/** 9251bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 9261bd4fe43Sopenharmony_ci* @brief Start station scanning with specified parameter.CNcomment:station执行带特定参数的扫描.CNend 9271bd4fe43Sopenharmony_ci* 9281bd4fe43Sopenharmony_ci* @par Description: 9291bd4fe43Sopenharmony_ci* Start station scanning with specified parameter.CNcomment:station执行带特定参数的扫描.CNend 9301bd4fe43Sopenharmony_ci* 9311bd4fe43Sopenharmony_ci* @attention 1. advance scan can scan with ssid only,channel only,bssid only,prefix_ssid only, 9321bd4fe43Sopenharmony_ci* and the combination parameters scanning does not support.\n 9331bd4fe43Sopenharmony_ci* CNcomment:1. 高级扫描分别单独支持 ssid扫描,信道扫描,bssid扫描,ssid前缀扫描, 不支持组合参数扫描方式.CNend\n 9341bd4fe43Sopenharmony_ci* 2. Scanning mode, subject to the type set by scan_type. 9351bd4fe43Sopenharmony_ci* CNcomment:2 .扫描方式,以scan_type传入的类型为准。CNend \n 9361bd4fe43Sopenharmony_ci* 3. SSID only supports ASCII characters. 9371bd4fe43Sopenharmony_ci* CNcomment:3. SSID 只支持ASCII字符.CNend 9381bd4fe43Sopenharmony_ci* @param sp [IN] Type #hi_wifi_scan_params * parameters of scan.CNcomment:扫描网络参数设置.CNend 9391bd4fe43Sopenharmony_ci* 9401bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 9411bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 9421bd4fe43Sopenharmony_ci* @par Dependency: 9431bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 9441bd4fe43Sopenharmony_ci* @see NULL 9451bd4fe43Sopenharmony_ci*/ 9461bd4fe43Sopenharmony_ciint hi_wifi_sta_advance_scan(hi_wifi_scan_params *sp); 9471bd4fe43Sopenharmony_ci 9481bd4fe43Sopenharmony_ci/** 9491bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 9501bd4fe43Sopenharmony_ci* @brief sta start scan.CNcomment:station进行扫描.CNend 9511bd4fe43Sopenharmony_ci* 9521bd4fe43Sopenharmony_ci* @par Description: 9531bd4fe43Sopenharmony_ci* Get station scan result.CNcomment:获取station扫描结果.CNend 9541bd4fe43Sopenharmony_ci* @attention 1. The memories of <ap_list> and <ap_num> memories are requested by the caller. \n 9551bd4fe43Sopenharmony_ci* The <ap_list> size up to : sizeof(hi_wifi_ap_info ap_list) * 32. \n 9561bd4fe43Sopenharmony_ci* CNcomment:1. <ap_list>和<ap_num>由调用者申请内存, 9571bd4fe43Sopenharmony_ci* <ap_list>size最大为:sizeof(hi_wifi_ap_info ap_list) * 32.CNend \n 9581bd4fe43Sopenharmony_ci* 2. ap_num: parameters can be passed in to specify the number of scanned results.The maximum is 32. \n 9591bd4fe43Sopenharmony_ci* CNcomment:2. ap_num: 可以传入参数,指定获取扫描到的结果数量,最大为32。CNend \n 9601bd4fe43Sopenharmony_ci* 3. If the user callback function is used, ap num refers to bss_num in event_wifi_scan_done. \n 9611bd4fe43Sopenharmony_ci* CNcomment:3. 如果使用上报用户的回调函数,ap_num参考event_wifi_scan_done中的bss_num。CNend \n 9621bd4fe43Sopenharmony_ci* 4. ap_num should be same with number of hi_wifi_ap_info structures applied, 9631bd4fe43Sopenharmony_ci* Otherwise, it will cause memory overflow. \n 9641bd4fe43Sopenharmony_ci* CNcomment:4. ap_num和申请的hi_wifi_ap_info结构体数量一致,否则可能造成内存溢出。CNend \n 9651bd4fe43Sopenharmony_ci* 5. SSID only supports ASCII characters. \n 9661bd4fe43Sopenharmony_ci* CNcomment:5. SSID 只支持ASCII字符.CNend \n 9671bd4fe43Sopenharmony_ci* 6. The rssi in the scan results needs to be divided by 100 to get the actual rssi.\n 9681bd4fe43Sopenharmony_ci* CNcomment:6. 扫描结果中的rssi需要除以100才能获得实际的rssi.CNend 9691bd4fe43Sopenharmony_ci* @param ap_list [IN/OUT] Type #hi_wifi_ap_info * scan result.CNcomment:扫描的结果.CNend 9701bd4fe43Sopenharmony_ci* @param ap_num [IN/OUT] Type #unsigned int *, number of scan result.CNcomment:扫描到的网络数目.CNend 9711bd4fe43Sopenharmony_ci* 9721bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 9731bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 9741bd4fe43Sopenharmony_ci* @par Dependency: 9751bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 9761bd4fe43Sopenharmony_ci* @see NULL 9771bd4fe43Sopenharmony_ci*/ 9781bd4fe43Sopenharmony_ciint hi_wifi_sta_scan_results(hi_wifi_ap_info *ap_list, unsigned int *ap_num); 9791bd4fe43Sopenharmony_ci 9801bd4fe43Sopenharmony_ci/** 9811bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 9821bd4fe43Sopenharmony_ci* @brief sta start connect.CNcomment:station进行连接网络.CNend 9831bd4fe43Sopenharmony_ci* 9841bd4fe43Sopenharmony_ci* @par Description: 9851bd4fe43Sopenharmony_ci* sta start connect.CNcomment:station进行连接网络.CNend 9861bd4fe43Sopenharmony_ci* 9871bd4fe43Sopenharmony_ci* @attention 1.<ssid> and <bssid> cannot be empty at the same time. CNcomment:1. <ssid>与<bssid>不能同时为空.CNend\n 9881bd4fe43Sopenharmony_ci* 2. When <auth_type> is set to OPEN, the <passwd> parameter is not required. 9891bd4fe43Sopenharmony_ci* CNcomment:2. <auth_type>设置为OPEN时,无需<passwd>参数.CNend\n 9901bd4fe43Sopenharmony_ci* 3. This function is non-blocking.CNcomment:3. 此函数为非阻塞式.CNend\n 9911bd4fe43Sopenharmony_ci* 4. Pairwise can be set, default is 0.CNcomment:4. pairwise 可设置, 默认为0.CNend\n 9921bd4fe43Sopenharmony_ci* 5. If the station is already connected to a network, disconnect the existing connection and 9931bd4fe43Sopenharmony_ci* then connect to the new network.\n 9941bd4fe43Sopenharmony_ci* CNcomment:5. 若station已接入某个网络,则先断开已有连接,然后连接新网络.CNend\n 9951bd4fe43Sopenharmony_ci* 6. If the wrong SSID, BSSID or key is passed in, the HISI_OK will be returned, 9961bd4fe43Sopenharmony_ci* but sta cannot connect the ap. 9971bd4fe43Sopenharmony_ci* CNcomment:6. 如果传入错误的ssid,bssid或者不正确的密码,返回成功,但连接ap失败。CNend\n 9981bd4fe43Sopenharmony_ci* 7. SSID only supports ASCII characters. 9991bd4fe43Sopenharmony_ci* CNcomment:7. SSID 只支持ASCII字符.CNend \n 10001bd4fe43Sopenharmony_ci* 8. Only support auth mode as bellow: 10011bd4fe43Sopenharmony_ci* HI_WIFI_SECURITY_SAE, 10021bd4fe43Sopenharmony_ci* HI_WIFI_SECURITY_WPA3_WPA2_PSK_MIX, 10031bd4fe43Sopenharmony_ci* HI_WIFI_SECURITY_WPAPSK_WPA2PSK_MIX, 10041bd4fe43Sopenharmony_ci* HI_WIFI_SECURITY_WPA2PSK, 10051bd4fe43Sopenharmony_ci* HI_WIFI_SECURITY_WEP, 10061bd4fe43Sopenharmony_ci* HI_WIFI_SECURITY_OPEN 10071bd4fe43Sopenharmony_ci* CNcomment:8. 只支持以下认证模式: 10081bd4fe43Sopenharmony_ci* HI_WIFI_SECURITY_SAE, 10091bd4fe43Sopenharmony_ci* HI_WIFI_SECURITY_WPA3_WPA2_PSK_MIX, 10101bd4fe43Sopenharmony_ci* HI_WIFI_SECURITY_WPAPSK_WPA2PSK_MIX, 10111bd4fe43Sopenharmony_ci* HI_WIFI_SECURITY_WPA2PSK, 10121bd4fe43Sopenharmony_ci* HI_WIFI_SECURITY_WEP, 10131bd4fe43Sopenharmony_ci* HI_WIFI_SECURITY_OPEN \n 10141bd4fe43Sopenharmony_ci* 9. WEP supports 64 bit and 128 bit encryption. 10151bd4fe43Sopenharmony_ci* for 64 bit encryption, the encryption key is 10 hexadecimal characters or 5 ASCII characters; 10161bd4fe43Sopenharmony_ci* for 128 bit encryption, the encryption key is 26 hexadecimal characters or 13 ASCII characters。\n 10171bd4fe43Sopenharmony_ci* CNcomment:9. WEP支持64位和128位加密,对于64位加密,加密密钥为10个十六进制字符或5个ASCII字符; 10181bd4fe43Sopenharmony_ci* 对于128位加密,加密密钥为26个十六进制字符或13个ASCII字符。CNend\n 10191bd4fe43Sopenharmony_ci* 10. When the key of WEP is in the form of ASCII character, 10201bd4fe43Sopenharmony_ci* the key in the input struct needs to be added with double quotation marks; 10211bd4fe43Sopenharmony_ci* when the key of WEP is in the form of hexadecimal character, 10221bd4fe43Sopenharmony_ci* the key in the input struct does not need to add double quotation marks.\n 10231bd4fe43Sopenharmony_ci* CNcomment:10. WEP的秘钥为ASCIl字符形式时,入参结构体中的key需要添加双引号; 10241bd4fe43Sopenharmony_ci* WEP的秘钥为为十六进制字符时,入参结构体中的key不需要添加双引号。CNend\n 10251bd4fe43Sopenharmony_ci* 11. If the auth type is HI_WIFI_SECURITY_SAE, PMF is temporarily enabled as required.\n 10261bd4fe43Sopenharmony_ci* CNcomment:11. 当使用HI_WIFI_SECURITY_SAE进行认证时,默认临时开启PMF(强制)。CNend\n 10271bd4fe43Sopenharmony_ci* 12. If the auth type is HI_WIFI_SECURITY_WPA3_WPA2_PSK_MIX, PMF is temporarily enabled as optional.\n 10281bd4fe43Sopenharmony_ci* CNcomment:12. 当使用HI_WIFI_SECURITY_WPA3_WPA2_PSK_MIX进行认证时,默认临时开启PMF(可选)。CNend\n 10291bd4fe43Sopenharmony_ci* 10301bd4fe43Sopenharmony_ci* @param req [IN] Type #hi_wifi_assoc_request * connect parameters of network.CNcomment:连接网络参数设置.CNend 10311bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 10321bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 10331bd4fe43Sopenharmony_ci* @par Dependency: 10341bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 10351bd4fe43Sopenharmony_ci* @see NULL 10361bd4fe43Sopenharmony_ci*/ 10371bd4fe43Sopenharmony_ciint hi_wifi_sta_connect(hi_wifi_assoc_request *req); 10381bd4fe43Sopenharmony_ci 10391bd4fe43Sopenharmony_ci/** 10401bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 10411bd4fe43Sopenharmony_ci* @brief Start fast connect.CNcomment:station进行快速连接网络.CNend 10421bd4fe43Sopenharmony_ci* 10431bd4fe43Sopenharmony_ci* @par Description: 10441bd4fe43Sopenharmony_ci* Start fast connect.CNcomment:station进行快速连接网络.CNend 10451bd4fe43Sopenharmony_ci* 10461bd4fe43Sopenharmony_ci* @attention 1. <ssid> and <bssid> cannot be empty at the same time. CNcomment:1.<ssid>与<bssid>不能同时为空.CNend\n 10471bd4fe43Sopenharmony_ci* 2. When <auth_type> is set to OPEN, the <passwd> parameter is not required. 10481bd4fe43Sopenharmony_ci* CNcomment:2.<auth_type>设置为OPEN时,无需<passwd>参数.CNend\n 10491bd4fe43Sopenharmony_ci* 3. <chn> There are differences in the range of values, and China is 1-13. 10501bd4fe43Sopenharmony_ci* CNcomment:3.<chn>取值范围不同区域有差异,中国为1-13.CNend\n 10511bd4fe43Sopenharmony_ci* 4. This is a blocking function.CNcomment:4.此函数为阻塞函数.CNend\n 10521bd4fe43Sopenharmony_ci* 5. Pairwise can be set, set to zero by default.CNcomment:5. pairwise 可设置,默认置零.CNend\n 10531bd4fe43Sopenharmony_ci* 6. <psk> and <psk_flag> are optional parameters, set to zero by default. \n 10541bd4fe43Sopenharmony_ci* CNcomment:6. <psk>和<psk_flag>为可选参数,无需使用时填0.CNend\n 10551bd4fe43Sopenharmony_ci* 7. If the wrong SSID, BSSID or key is passed in, the HISI_FAIL will be returned, 10561bd4fe43Sopenharmony_ci* and sta cannot connect the ap. 10571bd4fe43Sopenharmony_ci* CNcomment:7. 如果传入错误的ssid,bssid或者不正确的密码,返回失败并且连接ap失败。CNend\n 10581bd4fe43Sopenharmony_ci* 8. SSID only supports ASCII characters. 10591bd4fe43Sopenharmony_ci* CNcomment:8. SSID 只支持ASCII字符.CNend \n 10601bd4fe43Sopenharmony_ci* 9. The PSK internal cache calculated in advance will be cleared after the function execution is completed. 10611bd4fe43Sopenharmony_ci* CNcomment:9. 提前计算的PSK内部缓存将在函数执行完成后清除.CNend \n 10621bd4fe43Sopenharmony_ci* 10. The PSK calculated in advance do not support WPA3-PSK. 10631bd4fe43Sopenharmony_ci* CNcomment:10. PSK提前计算不支持WPA3-PSK.CNend 10641bd4fe43Sopenharmony_ci* 11. If the auth type is HI_WIFI_SECURITY_SAE, PMF is temporarily enabled as required.\n 10651bd4fe43Sopenharmony_ci* CNcomment:11. 当使用HI_WIFI_SECURITY_SAE进行认证时,默认临时开启PMF(强制)。CNend\n 10661bd4fe43Sopenharmony_ci* 12. If the auth type is HI_WIFI_SECURITY_WPA3_WPA2_PSK_MIX, PMF is temporarily enabled as optional.\n 10671bd4fe43Sopenharmony_ci* CNcomment:12. 当使用HI_WIFI_SECURITY_WPA3_WPA2_PSK_MIX进行认证时,默认临时开启PMF(可选)。CNend\n 10681bd4fe43Sopenharmony_ci* 10691bd4fe43Sopenharmony_ci* @param fast_request [IN] Type #hi_wifi_fast_assoc_request *,fast connect parameters. CNcomment:快速连接网络参数.CNend 10701bd4fe43Sopenharmony_ci 10711bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 10721bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 10731bd4fe43Sopenharmony_ci* @par Dependency: 10741bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 10751bd4fe43Sopenharmony_ci* @see NULL 10761bd4fe43Sopenharmony_ci*/ 10771bd4fe43Sopenharmony_ciint hi_wifi_sta_fast_connect(hi_wifi_fast_assoc_request *fast_request); 10781bd4fe43Sopenharmony_ci 10791bd4fe43Sopenharmony_ci/** 10801bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 10811bd4fe43Sopenharmony_ci* @brief Disconnect from network.CNcomment:station断开相连的网络.CNend 10821bd4fe43Sopenharmony_ci* 10831bd4fe43Sopenharmony_ci* @par Description: 10841bd4fe43Sopenharmony_ci* Disconnect from network.CNcomment:station断开相连的网络.CNend 10851bd4fe43Sopenharmony_ci* 10861bd4fe43Sopenharmony_ci* @attention NULL 10871bd4fe43Sopenharmony_ci* @param NULL 10881bd4fe43Sopenharmony_ci* 10891bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 10901bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 10911bd4fe43Sopenharmony_ci* @par Dependency: 10921bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 10931bd4fe43Sopenharmony_ci* @see NULL 10941bd4fe43Sopenharmony_ci*/ 10951bd4fe43Sopenharmony_ciint hi_wifi_sta_disconnect(void); 10961bd4fe43Sopenharmony_ci 10971bd4fe43Sopenharmony_ci/** 10981bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 10991bd4fe43Sopenharmony_ci* @brief Set reconnect policy.CNcomment:station设置重新连接网络机制.CNend 11001bd4fe43Sopenharmony_ci* 11011bd4fe43Sopenharmony_ci* @par Description: 11021bd4fe43Sopenharmony_ci* Set reconnect policy.CNcomment:station设置重新连接网络机制.CNend 11031bd4fe43Sopenharmony_ci* 11041bd4fe43Sopenharmony_ci* @attention 1. It is recommended called after STA start or connected successfully. 11051bd4fe43Sopenharmony_ci* CNcomment:1. 在STA启动后或者关联成功后调用该接口.CNend\n 11061bd4fe43Sopenharmony_ci* 2. The reconnection policy will be triggered when the station is disconnected from ap.\n 11071bd4fe43Sopenharmony_ci* CNcomment:2. 重连机制将于station下一次去关联时生效,当前已经去关联设置无效.CNend\n 11081bd4fe43Sopenharmony_ci* 3. The Settings will take effect on the next reconnect timer.\n 11091bd4fe43Sopenharmony_ci* CNcomment:3. 重关联过程中更新重关联配置将于下一次重连计时生效.CNend\n 11101bd4fe43Sopenharmony_ci* 4. After calling station connect/disconnect or station stop, stop reconnecting. 11111bd4fe43Sopenharmony_ci* CNcomment:4. 调用station connect/disconnect或station stop,停止重连.CNend\n 11121bd4fe43Sopenharmony_ci* 5. If the target network cannot be found by scanning, 11131bd4fe43Sopenharmony_ci the reconnection policy cannot trigger to take effect.\n 11141bd4fe43Sopenharmony_ci* CNcomment:5. 若扫描不到目标网络,重连机制无法触发生效.CNend\n 11151bd4fe43Sopenharmony_ci* 6. When the <seconds> value is 65535, it means infinite loop reconnection. 11161bd4fe43Sopenharmony_ci* CNcomment:6. <seconds>取值为65535时,表示无限次循环重连.CNend\n 11171bd4fe43Sopenharmony_ci* 7.Enable reconnect, user and lwip will not receive disconnect event when disconnected from ap until 15 11181bd4fe43Sopenharmony_ci* seconds later and still don't reconnect to ap successfully. 11191bd4fe43Sopenharmony_ci* CNcomment:7. 使能自动重连,wifi将在15s内尝试自动重连并在此期间不上报去关联事件到用户和lwip协议栈, 11201bd4fe43Sopenharmony_ci* 做到15秒内重连成功用户和上层网络不感知.CNend\n 11211bd4fe43Sopenharmony_ci* 8.Must call again if add/down/delete SoftAp or MESH's interface status after last call. 11221bd4fe43Sopenharmony_ci* CNcomment:8. 调用后如果添加/禁用/删除了SoftAp,MESH接口的状态,需要再次调用该接口.CNend\n 11231bd4fe43Sopenharmony_ci 11241bd4fe43Sopenharmony_ci* @param enable [IN] Type #int enable reconnect.0-disable/1-enable.CNcomment:使能重连网络参数.CNend 11251bd4fe43Sopenharmony_ci* @param seconds [IN] Type #unsigned int reconnect timeout in seconds for once, range:[2-65535]. 11261bd4fe43Sopenharmony_ci* CNcomment:单次重连超时时间,取值[2-65535].CNend 11271bd4fe43Sopenharmony_ci* @param period [IN] Type #unsigned int reconnect period in seconds, range:[1-65535]. 11281bd4fe43Sopenharmony_ci CNcomment:重连间隔周期,取值[1-65535].CNend 11291bd4fe43Sopenharmony_ci* @param max_try_count [IN] Type #unsigned int max reconnect try count number,range:[1-65535]. 11301bd4fe43Sopenharmony_ci CNcomment:最大重连次数,取值[1-65535].CNend 11311bd4fe43Sopenharmony_ci* 11321bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 11331bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 11341bd4fe43Sopenharmony_ci* @par Dependency: 11351bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 11361bd4fe43Sopenharmony_ci* @see NULL 11371bd4fe43Sopenharmony_ci*/ 11381bd4fe43Sopenharmony_ciint hi_wifi_sta_set_reconnect_policy(int enable, unsigned int seconds, 11391bd4fe43Sopenharmony_ci unsigned int period, unsigned int max_try_count); 11401bd4fe43Sopenharmony_ci 11411bd4fe43Sopenharmony_ci/** 11421bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 11431bd4fe43Sopenharmony_ci* @brief Get status of sta.CNcomment:获取station连接的网络状态.CNend 11441bd4fe43Sopenharmony_ci* 11451bd4fe43Sopenharmony_ci* @par Description: 11461bd4fe43Sopenharmony_ci* Get status of sta.CNcomment:获取station连接的网络状态.CNend 11471bd4fe43Sopenharmony_ci* 11481bd4fe43Sopenharmony_ci* @attention NULL 11491bd4fe43Sopenharmony_ci* @param connect_status [IN/OUT] Type #hi_wifi_status *, connect status, memory is requested by the caller. 11501bd4fe43Sopenharmony_ci* CNcomment:连接状态, 由调用者申请内存.CNend 11511bd4fe43Sopenharmony_ci* 11521bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 11531bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 11541bd4fe43Sopenharmony_ci* @par Dependency: 11551bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 11561bd4fe43Sopenharmony_ci* @see NULL 11571bd4fe43Sopenharmony_ci*/ 11581bd4fe43Sopenharmony_ciint hi_wifi_sta_get_connect_info(hi_wifi_status *connect_status); 11591bd4fe43Sopenharmony_ci 11601bd4fe43Sopenharmony_ci/** 11611bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 11621bd4fe43Sopenharmony_ci* @brief Start pbc connect in WPS.CNcomment:设置WPS进行pbc连接.CNend 11631bd4fe43Sopenharmony_ci* 11641bd4fe43Sopenharmony_ci* @par Description: 11651bd4fe43Sopenharmony_ci* Start pbc connect in WPS.CNcomment:设置WPS进行pbc连接.CNend 11661bd4fe43Sopenharmony_ci* 11671bd4fe43Sopenharmony_ci* @attention 1. bssid can be NULL or MAC. CNcomment:1. bssid 可以指定mac或者填NULL.CNend 11681bd4fe43Sopenharmony_ci* @param bssid [IN] Type #unsigned char * mac address 11691bd4fe43Sopenharmony_ci* 11701bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 11711bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 11721bd4fe43Sopenharmony_ci* @par Dependency: 11731bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 11741bd4fe43Sopenharmony_ci* @see NULL 11751bd4fe43Sopenharmony_ci*/ 11761bd4fe43Sopenharmony_ciint hi_wifi_sta_wps_pbc(unsigned char *bssid); 11771bd4fe43Sopenharmony_ci 11781bd4fe43Sopenharmony_ci/** 11791bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 11801bd4fe43Sopenharmony_ci* @brief Start pin connect in WPS.CNcomment:WPS通过pin码连接网络.CNend 11811bd4fe43Sopenharmony_ci* 11821bd4fe43Sopenharmony_ci* @par Description: 11831bd4fe43Sopenharmony_ci* Start pin connect in WPS.CNcomment:WPS通过pin码连接网络.CNend 11841bd4fe43Sopenharmony_ci* 11851bd4fe43Sopenharmony_ci* @attention 1. Bssid can be NULL or MAC. CNcomment:1. bssid 可以指定mac或者填NULL.CNend \n 11861bd4fe43Sopenharmony_ci* 2. Decimal only WPS pin code length is 8 Bytes.CNcomment:2. WPS中pin码仅限十进制,长度为8 Bytes.CNend 11871bd4fe43Sopenharmony_ci* @param pin [IN] Type #char * pin code 11881bd4fe43Sopenharmony_ci* @param bssid [IN] Type #unsigned char * mac address 11891bd4fe43Sopenharmony_ci* 11901bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 11911bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 11921bd4fe43Sopenharmony_ci* @par Dependency: 11931bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 11941bd4fe43Sopenharmony_ci* @see NULL 11951bd4fe43Sopenharmony_ci*/ 11961bd4fe43Sopenharmony_ciint hi_wifi_sta_wps_pin(char *pin, unsigned char *bssid); 11971bd4fe43Sopenharmony_ci 11981bd4fe43Sopenharmony_ci/** 11991bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 12001bd4fe43Sopenharmony_ci* @brief Get pin code.CNcomment:WPS获取pin码.CNend 12011bd4fe43Sopenharmony_ci* 12021bd4fe43Sopenharmony_ci* @par Description: 12031bd4fe43Sopenharmony_ci* Get pin code.CNcomment:WPS获取pin码.CNend 12041bd4fe43Sopenharmony_ci* 12051bd4fe43Sopenharmony_ci* @attention Decimal only WPS pin code length is 8 Bytes.CNcomment:WPS中pin码仅限十进制,长度为8 Bytes.CNend 12061bd4fe43Sopenharmony_ci* @param pin [IN/OUT] Type #char *, pin code buffer, should be obtained, length is 9 Bytes. 12071bd4fe43Sopenharmony_ci* The memory is requested by the caller.\n 12081bd4fe43Sopenharmony_ci* CNcomment:待获取pin码,长度为9 Bytes。由调用者申请内存.CNend 12091bd4fe43Sopenharmony_ci* @param len [IN] Type #int, length of pin code。CNcomment:pin码的长度.CNend 12101bd4fe43Sopenharmony_ci* 12111bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 12121bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 12131bd4fe43Sopenharmony_ci* @par Dependency: 12141bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 12151bd4fe43Sopenharmony_ci* @see NULL 12161bd4fe43Sopenharmony_ci*/ 12171bd4fe43Sopenharmony_ciint hi_wifi_sta_wps_pin_get(char* pin, unsigned int len); 12181bd4fe43Sopenharmony_ci 12191bd4fe43Sopenharmony_ci/** 12201bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 12211bd4fe43Sopenharmony_ci* @brief Get rssi value.CNcomment:获取rssi值.CNend 12221bd4fe43Sopenharmony_ci* 12231bd4fe43Sopenharmony_ci* @par Description: 12241bd4fe43Sopenharmony_ci* Get current rssi of ap which sta connected to.CNcomment:获取sta当前关联的ap的rssi值.CNend 12251bd4fe43Sopenharmony_ci* 12261bd4fe43Sopenharmony_ci* @attention The rssi value is derived from latest data frame received.CNcomment:该值从最新收到的数据帧获取.CNend 12271bd4fe43Sopenharmony_ci* @param NULL 12281bd4fe43Sopenharmony_ci* 12291bd4fe43Sopenharmony_ci* @retval #0x7F Invalid value. 12301bd4fe43Sopenharmony_ci* @retval #Other rssi 12311bd4fe43Sopenharmony_ci* @par Dependency: 12321bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 12331bd4fe43Sopenharmony_ci* @see NULL 12341bd4fe43Sopenharmony_ci*/ 12351bd4fe43Sopenharmony_ciint hi_wifi_sta_get_ap_rssi(void); 12361bd4fe43Sopenharmony_ci 12371bd4fe43Sopenharmony_ci/** 12381bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 12391bd4fe43Sopenharmony_ci* @brief Set sta powersave configuration.CNcomment:设置STA的低功耗参数.CNend 12401bd4fe43Sopenharmony_ci* 12411bd4fe43Sopenharmony_ci* @par Description: 12421bd4fe43Sopenharmony_ci* Set sta powersave configuration.CNcomment:设置STA的低功耗参数.CNend 12431bd4fe43Sopenharmony_ci* 12441bd4fe43Sopenharmony_ci* @attention CNcomment:1.参数值越小,功耗越低但性能表现和抗干扰会越差,建议使用默认值或根据流量动态配置.CNend\n 12451bd4fe43Sopenharmony_ci* CNcomment:2.所有参数配置0,表示该参数使用默认值.CNend\n 12461bd4fe43Sopenharmony_ci* CNcomment:3.仅支持设置STA的低功耗参数.CNend\n 12471bd4fe43Sopenharmony_ci* CNcomment:4.需要在关联成功后配置,支持动态配置.CNend\n 12481bd4fe43Sopenharmony_ci* CNcomment:5.定时器首次启动不计数,故实际睡眠时间为配置的重启次数+1乘以周期.CNend\n 12491bd4fe43Sopenharmony_ci* @param timer [IN] Type #unsigned char CNcomment:低功耗定时器周期,默认50ms,取值[0-100]ms.CNend 12501bd4fe43Sopenharmony_ci* @param time_cnt [IN] Type #unsigned char CNcomment:低功耗定时器重启次数,达到该次数后wifi无数据收发则进入休眠, 12511bd4fe43Sopenharmony_ci 默认为4,取值[0-10].CNend 12521bd4fe43Sopenharmony_ci* @param bcn_timeout [IN] Type #unsigned char CNcomment:等待接收beacon的超时时间,默认10ms,取值[0-100]ms.CNend 12531bd4fe43Sopenharmony_ci* @param mcast_timeout [IN] Type #unsigned char CNcomment:等待接收组播/广播帧的超时时间,默认30ms,取值[0-100]ms.CNend 12541bd4fe43Sopenharmony_ci* 12551bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 12561bd4fe43Sopenharmony_ci* @retval #Other Error code 12571bd4fe43Sopenharmony_ci* @par Dependency: 12581bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 12591bd4fe43Sopenharmony_ci* @see NULL 12601bd4fe43Sopenharmony_ci*/ 12611bd4fe43Sopenharmony_ciint hi_wifi_sta_set_pm_param(unsigned char timer, unsigned char time_cnt, unsigned char bcn_timeout, 12621bd4fe43Sopenharmony_ci unsigned char mcast_timeout); 12631bd4fe43Sopenharmony_ci 12641bd4fe43Sopenharmony_ci/** 12651bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 12661bd4fe43Sopenharmony_ci* @brief WPA PSK Calculate.CNcomment:计算WPA PSK.CNend 12671bd4fe43Sopenharmony_ci* 12681bd4fe43Sopenharmony_ci* @par Description: 12691bd4fe43Sopenharmony_ci* PSK Calculate.CNcomment:计算psk.CNend 12701bd4fe43Sopenharmony_ci* 12711bd4fe43Sopenharmony_ci* @attention 1. support only WPA/WPA2 PSK. CNcomment:1. 只支持WPA/WPA2 PSK计算.CNend \n 12721bd4fe43Sopenharmony_ci* 2. SSID only supports ASCII characters. CNcomment:2. SSID 只支持ASCII字符.CNend 12731bd4fe43Sopenharmony_ci* @param psk_config [IN] Type #hi_wifi_sta_psk_config 12741bd4fe43Sopenharmony_ci* @param get_psk [IN/OUT] Type #const unsigned char *,Psk to be obtained, length is 32 Bytes. 12751bd4fe43Sopenharmony_ci* The memory is requested by the caller. 12761bd4fe43Sopenharmony_ci* CNcomment:待获取psk,长度为32 Bytes。由调用者申请内存.CNend 12771bd4fe43Sopenharmony_ci* @param psk_len [IN] Type #unsigned int 12781bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 12791bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 12801bd4fe43Sopenharmony_ci* @par Dependency: 12811bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 12821bd4fe43Sopenharmony_ci* @see NULL 12831bd4fe43Sopenharmony_ci*/ 12841bd4fe43Sopenharmony_ciint hi_wifi_psk_calc(hi_wifi_sta_psk_config psk_config, unsigned char *get_psk, unsigned int psk_len); 12851bd4fe43Sopenharmony_ci 12861bd4fe43Sopenharmony_ci/** 12871bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 12881bd4fe43Sopenharmony_ci* @brief WPA PSK Calculate,then keep it inside .CNcomment:计算WPA PSK, 并做内部保存.CNend 12891bd4fe43Sopenharmony_ci* 12901bd4fe43Sopenharmony_ci* @par Description: 12911bd4fe43Sopenharmony_ci* psk Calculate.CNcomment:计算psk.CNend 12921bd4fe43Sopenharmony_ci* 12931bd4fe43Sopenharmony_ci* @attention 1. support only WPA/WPA2 PSK. CNcomment:1. 只支持WPA/WPA2 PSK计算.CNend \n 12941bd4fe43Sopenharmony_ci* 2. SSID only supports ASCII characters. CNcomment:2. SSID 只支持ASCII字符.CNend \n 12951bd4fe43Sopenharmony_ci* 3. The cached PSK will be cleared after the first quick connection. \n 12961bd4fe43Sopenharmony_ci* CNcomment:3. PSK缓存将在第一次执行快速连接后清除.CNend 12971bd4fe43Sopenharmony_ci* @param psk_config [IN] Type #hi_wifi_sta_psk_config 12981bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 12991bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 13001bd4fe43Sopenharmony_ci* @par Dependency: 13011bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 13021bd4fe43Sopenharmony_ci* @see NULL 13031bd4fe43Sopenharmony_ci*/ 13041bd4fe43Sopenharmony_ciint hi_wifi_psk_calc_and_store(hi_wifi_sta_psk_config psk_config); 13051bd4fe43Sopenharmony_ci 13061bd4fe43Sopenharmony_ci/** 13071bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 13081bd4fe43Sopenharmony_ci* @brief config calling mode of user's callback interface.CNcomment:配置用户回调接口的调用方式.CNend 13091bd4fe43Sopenharmony_ci* 13101bd4fe43Sopenharmony_ci* @par Description: 13111bd4fe43Sopenharmony_ci* config calling mode of user's callback interface.CNcomment:配置用户回调接口的调用方式.CNend 13121bd4fe43Sopenharmony_ci* 13131bd4fe43Sopenharmony_ci* @attention 1. Wpa's task has high priority and call wifi's api directly may be cause error. 13141bd4fe43Sopenharmony_ci CNcomment:1. wpa线程优先级高,直接调用方式下在该回调接口内再次调用某些api会导致线程卡死.CNend 13151bd4fe43Sopenharmony_ci 2. If you have create a task in your app, you should use mode:0, or mode:1 is adervised. 13161bd4fe43Sopenharmony_ci CNcomment:2. 上层应用已创建task来处理事件回调建议使用直接调用方式,否则建议使用线程调用方式.CNend 13171bd4fe43Sopenharmony_ci 3. Configuration will keep till system reboot, set again when you start a new station. 13181bd4fe43Sopenharmony_ci CNcomment:3. 参数会保持上一次设置值直到系统重启,重新启动station后建议再配置一次.CNend 13191bd4fe43Sopenharmony_ci 4. Configuration will work immediately whenever you set. 13201bd4fe43Sopenharmony_ci CNcomment:4. 可随时配置该参数,配置成功即生效.CNend 13211bd4fe43Sopenharmony_ci* @param mode [IN] Type #unsigned char , call mode, 1:direct and 0:create task[default]. 13221bd4fe43Sopenharmony_ci CNcomment:回调调用方式,1:wpa线程直接调用,0:新建一个低优先级线程调用,默认.CNend 13231bd4fe43Sopenharmony_ci* @param task_prio [IN] Type #unsigned char , task priority, range(10-50) . 13241bd4fe43Sopenharmony_ci CNcomment:新建线程优先级,取值范围(10-50).CNend 13251bd4fe43Sopenharmony_ci* @param stack_size [IN] Type #unsigned short , task stack size, more than 1K bytes, default: 2k. 13261bd4fe43Sopenharmony_ci CNcomment:新建线程栈空间,需大于1K,默认2k.CNend 13271bd4fe43Sopenharmony_ci* 13281bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 13291bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 13301bd4fe43Sopenharmony_ci* @par Dependency: 13311bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 13321bd4fe43Sopenharmony_ci* @see NULL 13331bd4fe43Sopenharmony_ci*/ 13341bd4fe43Sopenharmony_ciint hi_wifi_config_callback(unsigned char mode, unsigned char task_prio, unsigned short stack_size); 13351bd4fe43Sopenharmony_ci 13361bd4fe43Sopenharmony_ci/** 13371bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 13381bd4fe43Sopenharmony_ci* @brief register user callback interface.CNcomment:注册回调函数接口.CNend 13391bd4fe43Sopenharmony_ci* 13401bd4fe43Sopenharmony_ci* @par Description: 13411bd4fe43Sopenharmony_ci* register user callback interface.CNcomment:注册回调函数接口.CNend 13421bd4fe43Sopenharmony_ci* 13431bd4fe43Sopenharmony_ci* @attention NULL 13441bd4fe43Sopenharmony_ci* @param event_cb [OUT] Type #hi_wifi_event_cb, event callback .CNcomment:回调函数.CNend 13451bd4fe43Sopenharmony_ci* 13461bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 13471bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 13481bd4fe43Sopenharmony_ci* @par Dependency: 13491bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 13501bd4fe43Sopenharmony_ci* @see NULL 13511bd4fe43Sopenharmony_ci*/ 13521bd4fe43Sopenharmony_ciint hi_wifi_register_event_callback(hi_wifi_event_cb event_cb); 13531bd4fe43Sopenharmony_ci 13541bd4fe43Sopenharmony_ci/** 13551bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 13561bd4fe43Sopenharmony_ci* @brief Set protocol mode of softap.CNcomment:设置softap接口的protocol模式.CNend 13571bd4fe43Sopenharmony_ci* 13581bd4fe43Sopenharmony_ci* @par Description: 13591bd4fe43Sopenharmony_ci* Set protocol mode of softap.CNcomment:设置softap接口的protocol模式.CNend\n 13601bd4fe43Sopenharmony_ci* Initiallize config, set before softap start.CNcomment:初始配置,在softap start之前调用.CNend 13611bd4fe43Sopenharmony_ci* 13621bd4fe43Sopenharmony_ci* @attention Default mode(802.11BGN) CNcomment:默认模式(802.11BGN).CNend 13631bd4fe43Sopenharmony_ci* @param mode [IN] Type #hi_wifi_protocol_mode protocol mode. 13641bd4fe43Sopenharmony_ci* 13651bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 13661bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 13671bd4fe43Sopenharmony_ci* @par Dependency: 13681bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 13691bd4fe43Sopenharmony_ci* @see NULL 13701bd4fe43Sopenharmony_ci*/ 13711bd4fe43Sopenharmony_ciint hi_wifi_softap_set_protocol_mode(hi_wifi_protocol_mode mode); 13721bd4fe43Sopenharmony_ci 13731bd4fe43Sopenharmony_ci/** 13741bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 13751bd4fe43Sopenharmony_ci* @brief Get protocol mode of softap.CNcomment:获取softap接口的protocol模式.CNend 13761bd4fe43Sopenharmony_ci* 13771bd4fe43Sopenharmony_ci* @par Description: 13781bd4fe43Sopenharmony_ci* Get protocol mode of softap.CNcomment:获取softap接口的protocol模式.CNend 13791bd4fe43Sopenharmony_ci* 13801bd4fe43Sopenharmony_ci* @attention NULL 13811bd4fe43Sopenharmony_ci* @param NULL 13821bd4fe43Sopenharmony_ci* 13831bd4fe43Sopenharmony_ci* @retval #hi_wifi_protocol_mode protocol mode. 13841bd4fe43Sopenharmony_ci* @par Dependency: 13851bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 13861bd4fe43Sopenharmony_ci* @see NULL 13871bd4fe43Sopenharmony_ci*/ 13881bd4fe43Sopenharmony_cihi_wifi_protocol_mode hi_wifi_softap_get_protocol_mode(void); 13891bd4fe43Sopenharmony_ci 13901bd4fe43Sopenharmony_ci/** 13911bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 13921bd4fe43Sopenharmony_ci* @brief Set softap's beacon interval.CNcomment:设置softap的beacon周期.CNend 13931bd4fe43Sopenharmony_ci* 13941bd4fe43Sopenharmony_ci* @par Description: 13951bd4fe43Sopenharmony_ci* Set softap's beacon interval.CNcomment:设置softap的beacon周期.CNend \n 13961bd4fe43Sopenharmony_ci* Initialized config sets before interface starts.CNcomment:初始配置softap启动之前调用.CNend 13971bd4fe43Sopenharmony_ci* 13981bd4fe43Sopenharmony_ci* @attention NULL 13991bd4fe43Sopenharmony_ci* @param beacon_period [IN] Type #int beacon period in milliseconds, range(33ms~1000ms), default(100ms) 14001bd4fe43Sopenharmony_ci* 14011bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 14021bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 14031bd4fe43Sopenharmony_ci* @par Dependency: 14041bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 14051bd4fe43Sopenharmony_ci* @see NULL 14061bd4fe43Sopenharmony_ci*/ 14071bd4fe43Sopenharmony_ciint hi_wifi_softap_set_beacon_period(int beacon_period); 14081bd4fe43Sopenharmony_ci 14091bd4fe43Sopenharmony_ci/** 14101bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 14111bd4fe43Sopenharmony_ci* @brief Set softap's dtim count.CNcomment:设置softap的dtim周期.CNend 14121bd4fe43Sopenharmony_ci* 14131bd4fe43Sopenharmony_ci* @par Description: 14141bd4fe43Sopenharmony_ci* Set softap's dtim count.CNcomment:设置softap的dtim周期.CNend \n 14151bd4fe43Sopenharmony_ci* Initialized config sets before interface starts.CNcomment:初始配置softap启动之前调用.CNend 14161bd4fe43Sopenharmony_ci* 14171bd4fe43Sopenharmony_ci* @attention NULL 14181bd4fe43Sopenharmony_ci* @param dtim_period [IN] Type #int, dtim period , range(1~30), default(2) 14191bd4fe43Sopenharmony_ci* 14201bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 14211bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 14221bd4fe43Sopenharmony_ci* @par Dependency: 14231bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 14241bd4fe43Sopenharmony_ci* @see NULL 14251bd4fe43Sopenharmony_ci*/ 14261bd4fe43Sopenharmony_ciint hi_wifi_softap_set_dtim_period(int dtim_period); 14271bd4fe43Sopenharmony_ci 14281bd4fe43Sopenharmony_ci/** 14291bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 14301bd4fe43Sopenharmony_ci* @brief Set update time of softap's group key.CNcomment:配置softap组播秘钥更新时间.CNend 14311bd4fe43Sopenharmony_ci* 14321bd4fe43Sopenharmony_ci* @par Description: 14331bd4fe43Sopenharmony_ci* Set update time of softap's group key.CNcomment:配置softap组播秘钥更新时间.CNend\n 14341bd4fe43Sopenharmony_ci* Initialized config sets before interface starts.CNcomment:初始配置softap启动之前调用.CNend\n 14351bd4fe43Sopenharmony_ci* If you need to use the rekey function, it is recommended to use WPA+WPA2-PSK + CCMP encryption. 14361bd4fe43Sopenharmony_ci* CNcomment:若需要使用rekey功能,推荐使用WPA+WPA2-PSK + CCMP加密方式.CNend 14371bd4fe43Sopenharmony_ci* 14381bd4fe43Sopenharmony_ci* @attention When using wpa2psk-only + CCMP encryption, rekey is forced to 86400s by default. 14391bd4fe43Sopenharmony_ci* CNcomment:当使用wpa2psk-only + CCMP加密方式时 ,rekey默认强制改为 86400.CNend 14401bd4fe43Sopenharmony_ci* @param wpa_group_rekey [IN] Type #int, update time in seconds, range(30s-86400s), default(86400s) 14411bd4fe43Sopenharmony_ci* CNcomment:更新时间以秒为单位,范围(30s-86400s),默认(86400s).CNend 14421bd4fe43Sopenharmony_ci* 14431bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 14441bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 14451bd4fe43Sopenharmony_ci* @par Dependency: 14461bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 14471bd4fe43Sopenharmony_ci* @see NULL 14481bd4fe43Sopenharmony_ci*/ 14491bd4fe43Sopenharmony_ciint hi_wifi_softap_set_group_rekey(int wifi_group_rekey); 14501bd4fe43Sopenharmony_ci 14511bd4fe43Sopenharmony_ci/** 14521bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 14531bd4fe43Sopenharmony_ci* @brief Set short-gi of softap.CNcomment:设置softap的SHORT-GI功能.CNend 14541bd4fe43Sopenharmony_ci* 14551bd4fe43Sopenharmony_ci* @par Description: 14561bd4fe43Sopenharmony_ci* Enable or disable short-gi of softap.CNcomment:开启或则关闭softap的SHORT-GI功能.CNend\n 14571bd4fe43Sopenharmony_ci* Initialized config sets before interface starts.CNcomment:初始配置softap启动之前调用.CNend 14581bd4fe43Sopenharmony_ci* @attention NULL 14591bd4fe43Sopenharmony_ci* @param flag [IN] Type #int, enable(1) or disable(0). default enable(1). 14601bd4fe43Sopenharmony_ci CNcomment:使能标志,默认使能(1).CNend 14611bd4fe43Sopenharmony_ci* 14621bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 14631bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 14641bd4fe43Sopenharmony_ci* @par Dependency: 14651bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 14661bd4fe43Sopenharmony_ci* @see NULL 14671bd4fe43Sopenharmony_ci*/ 14681bd4fe43Sopenharmony_ciint hi_wifi_softap_set_shortgi(int flag); 14691bd4fe43Sopenharmony_ci 14701bd4fe43Sopenharmony_ci/** 14711bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 14721bd4fe43Sopenharmony_ci* @brief Start softap interface.CNcomment:开启SoftAP.CNend 14731bd4fe43Sopenharmony_ci* 14741bd4fe43Sopenharmony_ci* @par Description: 14751bd4fe43Sopenharmony_ci* Start softap interface.CNcomment:开启SoftAP.CNend 14761bd4fe43Sopenharmony_ci* 14771bd4fe43Sopenharmony_ci* @attention 1. Multiple interfaces of the same type are not supported.CNcomment:不支持使用多个同类型接口.CNend\n 14781bd4fe43Sopenharmony_ci* 2. Dual interface coexistence support: STA + AP. CNcomment:双接口共存支持:STA + AP.CNend \n 14791bd4fe43Sopenharmony_ci* 3. Start timeout 5s.CNcomment:启动超时时间5s。CNend \n 14801bd4fe43Sopenharmony_ci* 4. Softap key length range(8 Bytes - 64 Bytes).CNcomment:softap key长度范围(8 Bytes - 64 Bytes).CNend \n 14811bd4fe43Sopenharmony_ci* 5. Only support auth mode as bellow: \n 14821bd4fe43Sopenharmony_ci* HI_WIFI_SECURITY_WPAPSK_WPA2PSK_MIX, \n 14831bd4fe43Sopenharmony_ci* HI_WIFI_SECURITY_WPA2PSK, \n 14841bd4fe43Sopenharmony_ci* HI_WIFI_SECURITY_OPEN \n 14851bd4fe43Sopenharmony_ci* CNcomment:5. 只支持以下认证模式:\n 14861bd4fe43Sopenharmony_ci* HI_WIFI_SECURITY_WPAPSK_WPA2PSK_MIX, \n 14871bd4fe43Sopenharmony_ci* HI_WIFI_SECURITY_WPA2PSK, \n 14881bd4fe43Sopenharmony_ci* HI_WIFI_SECURITY_OPEN.CNend \n 14891bd4fe43Sopenharmony_ci* 6. The memories of <ifname> and <len> should be requested by the caller, 14901bd4fe43Sopenharmony_ci* the input value of len must be the same as the length of ifname(the recommended length is 17Bytes).\n 14911bd4fe43Sopenharmony_ci* CNcomment:6. <ifname>和<len>由调用者申请内存,用户写入len的值必须与ifname长度一致(建议长度为17Bytes).CNend \n 14921bd4fe43Sopenharmony_ci* 7. SSID only supports ASCII characters. 14931bd4fe43Sopenharmony_ci* CNcomment:7. SSID 只支持ASCII字符.CNend \n 14941bd4fe43Sopenharmony_ci* 8. This is a blocking function.CNcomment:8.此函数为阻塞函数.CNend 14951bd4fe43Sopenharmony_ci* @param conf [IN] Type #hi_wifi_softap_config *, softap's configuration.CNcomment:SoftAP配置.CNend 14961bd4fe43Sopenharmony_ci* @param ifname [IN/OUT] Type #char *, interface name.CNcomment:接口名字.CNend 14971bd4fe43Sopenharmony_ci* @param len [IN/OUT] Type #int *, interface name length.CNcomment:接口名字长度.CNend 14981bd4fe43Sopenharmony_ci* 14991bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 15001bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 15011bd4fe43Sopenharmony_ci* @par Dependency: 15021bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 15031bd4fe43Sopenharmony_ci* @see NULL 15041bd4fe43Sopenharmony_ci*/ 15051bd4fe43Sopenharmony_ciint hi_wifi_softap_start(hi_wifi_softap_config *conf, char *ifname, int *len); 15061bd4fe43Sopenharmony_ci 15071bd4fe43Sopenharmony_ci/** 15081bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 15091bd4fe43Sopenharmony_ci* @brief Close softap interface.CNcomment:关闭SoftAP.CNend 15101bd4fe43Sopenharmony_ci* 15111bd4fe43Sopenharmony_ci* @par Description: 15121bd4fe43Sopenharmony_ci* Close softap interface.CNcomment:关闭SoftAP.CNend 15131bd4fe43Sopenharmony_ci* 15141bd4fe43Sopenharmony_ci* @attention 1. This is a blocking function.CNcomment:1.此函数为阻塞函数.CNend 15151bd4fe43Sopenharmony_ci* @param NULL 15161bd4fe43Sopenharmony_ci* 15171bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 15181bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 15191bd4fe43Sopenharmony_ci* @par Dependency: 15201bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 15211bd4fe43Sopenharmony_ci* @see NULL 15221bd4fe43Sopenharmony_ci*/ 15231bd4fe43Sopenharmony_ciint hi_wifi_softap_stop(void); 15241bd4fe43Sopenharmony_ci 15251bd4fe43Sopenharmony_ci/** 15261bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 15271bd4fe43Sopenharmony_ci* @brief Get all user's information of softap.CNcomment:softap获取已连接的station的信息.CNend 15281bd4fe43Sopenharmony_ci* 15291bd4fe43Sopenharmony_ci* @par Description: 15301bd4fe43Sopenharmony_ci* Get all user's information of softap.CNcomment:softap获取已连接的station的信息.CNend 15311bd4fe43Sopenharmony_ci* 15321bd4fe43Sopenharmony_ci* @attention 1.sta_list: malloc by user.CNcomment:1.扫描结果参数。由用户动态申请。CNend \n 15331bd4fe43Sopenharmony_ci* 2.sta_list: max size is hi_wifi_ap_sta_info * 6. 15341bd4fe43Sopenharmony_ci* CNcomment:2.sta_list 足够的结构体大小,最大为hi_wifi_ap_sta_info * 6。CNend \n 15351bd4fe43Sopenharmony_ci* 3.sta_num:parameters can be passed in to specify the number of connected sta.The maximum is 6. 15361bd4fe43Sopenharmony_ci* CNcomment:3.可以传入参数,指定获取已接入的sta个数,最大为6。CNend \n 15371bd4fe43Sopenharmony_ci* 4.sta_num should be the same with number of hi_wifi_ap_sta_info structures applied, Otherwise, 15381bd4fe43Sopenharmony_ci* it will cause memory overflow.\n 15391bd4fe43Sopenharmony_ci* CNcomment:4.sta_num和申请的hi_wifi_ap_sta_info结构体数量一致,否则可能造成内存溢出。CNend 15401bd4fe43Sopenharmony_ci* @param sta_list [IN/OUT] Type #hi_wifi_ap_sta_info *, station information.CNcomment:STA信息.CNend 15411bd4fe43Sopenharmony_ci* @param sta_num [IN/OUT] Type #unsigned int *, station number.CNcomment:STA个数.CNend 15421bd4fe43Sopenharmony_ci* 15431bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 15441bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 15451bd4fe43Sopenharmony_ci* @par Dependency: 15461bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 15471bd4fe43Sopenharmony_ci* @see NULL 15481bd4fe43Sopenharmony_ci*/ 15491bd4fe43Sopenharmony_ciint hi_wifi_softap_get_connected_sta(hi_wifi_ap_sta_info *sta_list, unsigned int *sta_num); 15501bd4fe43Sopenharmony_ci 15511bd4fe43Sopenharmony_ci/** 15521bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 15531bd4fe43Sopenharmony_ci* @brief Softap deauth user by mac address.CNcomment:softap指定断开连接的station网络.CNend 15541bd4fe43Sopenharmony_ci* 15551bd4fe43Sopenharmony_ci* @par Description: 15561bd4fe43Sopenharmony_ci* Softap deauth user by mac address.CNcomment:softap指定断开连接的station网络.CNend 15571bd4fe43Sopenharmony_ci* 15581bd4fe43Sopenharmony_ci* @attention NULL 15591bd4fe43Sopenharmony_ci* @param addr [IN] Type #const unsigned char *, station mac address.CNcomment:MAC地址.CNend 15601bd4fe43Sopenharmony_ci* @param addr_len [IN] Type #unsigned char, station mac address length, must be 6. 15611bd4fe43Sopenharmony_ci* CNcomment:MAC地址长度,必须为6.CNend 15621bd4fe43Sopenharmony_ci* 15631bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 15641bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 15651bd4fe43Sopenharmony_ci* @par Dependency: 15661bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 15671bd4fe43Sopenharmony_ci* @see NULL 15681bd4fe43Sopenharmony_ci*/ 15691bd4fe43Sopenharmony_ciint hi_wifi_softap_deauth_sta(const unsigned char *addr, unsigned char addr_len); 15701bd4fe43Sopenharmony_ci 15711bd4fe43Sopenharmony_ci/** 15721bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 15731bd4fe43Sopenharmony_ci* @brief set mac address.CNcomment:设置MAC地址.CNend 15741bd4fe43Sopenharmony_ci* 15751bd4fe43Sopenharmony_ci* @par Description: 15761bd4fe43Sopenharmony_ci* Set original mac address.CNcomment:设置起始mac地址.CNend\n 15771bd4fe43Sopenharmony_ci* mac address will increase or recycle when adding or deleting device. 15781bd4fe43Sopenharmony_ci* CNcomment:添加设备mac地址递增,删除设备回收对应的mac地址.CNend 15791bd4fe43Sopenharmony_ci* 15801bd4fe43Sopenharmony_ci* @attention NULL 15811bd4fe43Sopenharmony_ci* @param mac_addr [IN] Type #char *, mac address.CNcomment:MAC地址.CNend 15821bd4fe43Sopenharmony_ci* @param mac_len [IN] Type #unsigned char, mac address length.CNcomment:MAC地址长度.CNend 15831bd4fe43Sopenharmony_ci* 15841bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 15851bd4fe43Sopenharmony_ci* @retval #Other Error code 15861bd4fe43Sopenharmony_ci* @par Dependency: 15871bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 15881bd4fe43Sopenharmony_ci* @see NULL 15891bd4fe43Sopenharmony_ci*/ 15901bd4fe43Sopenharmony_ciint hi_wifi_set_macaddr(const char *mac_addr, unsigned char mac_len); 15911bd4fe43Sopenharmony_ci 15921bd4fe43Sopenharmony_ci/** 15931bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 15941bd4fe43Sopenharmony_ci* @brief get mac address.CNcomment:获取MAC地址.CNend 15951bd4fe43Sopenharmony_ci* 15961bd4fe43Sopenharmony_ci* @par Description: 15971bd4fe43Sopenharmony_ci* Get original mac address.CNcomment:获取mac地址.CNend\n 15981bd4fe43Sopenharmony_ci* mac address will increase or recycle when adding device or deleting device. 15991bd4fe43Sopenharmony_ci* CNcomment:添加设备mac地址递增,删除设备回收对应的mac地址.CNend 16001bd4fe43Sopenharmony_ci* 16011bd4fe43Sopenharmony_ci* @attention NULL 16021bd4fe43Sopenharmony_ci* @param mac_addr [OUT] Type #char *, mac address. 16031bd4fe43Sopenharmony_ci* @param mac_len [IN] Type #unsigned char, mac address length. 16041bd4fe43Sopenharmony_ci* 16051bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 16061bd4fe43Sopenharmony_ci* @retval #Other Error code 16071bd4fe43Sopenharmony_ci* @par Dependency: 16081bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 16091bd4fe43Sopenharmony_ci* @see NULL 16101bd4fe43Sopenharmony_ci*/ 16111bd4fe43Sopenharmony_ciint hi_wifi_get_macaddr(char *mac_addr, unsigned char mac_len); 16121bd4fe43Sopenharmony_ci 16131bd4fe43Sopenharmony_ci/** 16141bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 16151bd4fe43Sopenharmony_ci* @brief Set country code.CNcomment:设置国家码.CNend 16161bd4fe43Sopenharmony_ci* 16171bd4fe43Sopenharmony_ci* @par Description: 16181bd4fe43Sopenharmony_ci* Set country code(two uppercases).CNcomment:设置国家码,由两个大写字符组成.CNend 16191bd4fe43Sopenharmony_ci* 16201bd4fe43Sopenharmony_ci* @attention 1.Before setting the country code, you must call hi_wifi_init to complete the initialization. 16211bd4fe43Sopenharmony_ci* CNcomment:设置国家码之前,必须调用hi_wifi_init初始化完成.CNend\n 16221bd4fe43Sopenharmony_ci* 2.cc_len should be greater than or equal to 3.CNcomment:cc_len应大于等于3.CNend 16231bd4fe43Sopenharmony_ci* @param cc [IN] Type #char *, country code.CNcomment:国家码.CNend 16241bd4fe43Sopenharmony_ci* @param cc_len [IN] Type #unsigned char, country code length.CNcomment:国家码长度.CNend 16251bd4fe43Sopenharmony_ci* 16261bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 16271bd4fe43Sopenharmony_ci* @retval #Other Error code 16281bd4fe43Sopenharmony_ci* @par Dependency: 16291bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 16301bd4fe43Sopenharmony_ci* @see NULL 16311bd4fe43Sopenharmony_ci*/ 16321bd4fe43Sopenharmony_ciint hi_wifi_set_country(const char *cc, unsigned char cc_len); 16331bd4fe43Sopenharmony_ci 16341bd4fe43Sopenharmony_ci/** 16351bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 16361bd4fe43Sopenharmony_ci* @brief Get country code.CNcomment:获取国家码.CNend 16371bd4fe43Sopenharmony_ci* 16381bd4fe43Sopenharmony_ci* @par Description: 16391bd4fe43Sopenharmony_ci* Get country code.CNcomment:获取国家码,由两个大写字符组成.CNend 16401bd4fe43Sopenharmony_ci* 16411bd4fe43Sopenharmony_ci* @attention 1.Before getting the country code, you must call hi_wifi_init to complete the initialization. 16421bd4fe43Sopenharmony_ci* CNcomment:获取国家码之前,必须调用hi_wifi_init初始化完成.CNend 16431bd4fe43Sopenharmony_ci* @param cc [OUT] Type #char *, country code.CNcomment:国家码.CNend 16441bd4fe43Sopenharmony_ci* @param len [IN/OUT] Type #int *, country code length.CNcomment:国家码长度.CNend 16451bd4fe43Sopenharmony_ci* 16461bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 16471bd4fe43Sopenharmony_ci* @retval #Other Error code 16481bd4fe43Sopenharmony_ci* @par Dependency: 16491bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 16501bd4fe43Sopenharmony_ci* @see NULL 16511bd4fe43Sopenharmony_ci*/ 16521bd4fe43Sopenharmony_ciint hi_wifi_get_country(char *cc, int *len); 16531bd4fe43Sopenharmony_ci 16541bd4fe43Sopenharmony_ci/** 16551bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 16561bd4fe43Sopenharmony_ci* @brief Set bandwidth.CNcomment:设置带宽.CNend 16571bd4fe43Sopenharmony_ci* 16581bd4fe43Sopenharmony_ci* @par Description: 16591bd4fe43Sopenharmony_ci* Set bandwidth, support 5M/10M/20M.CNcomment:设置接口的工作带宽,支持5M 10M 20M带宽的设置.CNend 16601bd4fe43Sopenharmony_ci* 16611bd4fe43Sopenharmony_ci* @attention NULL 16621bd4fe43Sopenharmony_ci* @param ifname [IN] Type #const char *, interface name.CNcomment:接口名.CNend 16631bd4fe43Sopenharmony_ci* @param ifname_len [IN] Type #unsigned char, interface name length.CNcomment:接口名长度.CNend 16641bd4fe43Sopenharmony_ci* @param bw [IN] Type #hi_wifi_bw, bandwidth enum.CNcomment:带宽.CNend 16651bd4fe43Sopenharmony_ci* 16661bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 16671bd4fe43Sopenharmony_ci* @retval #Other Error code 16681bd4fe43Sopenharmony_ci* @par Dependency: 16691bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 16701bd4fe43Sopenharmony_ci* @see NULL 16711bd4fe43Sopenharmony_ci*/ 16721bd4fe43Sopenharmony_ciint hi_wifi_set_bandwidth(const char *ifname, unsigned char ifname_len, hi_wifi_bw bw); 16731bd4fe43Sopenharmony_ci 16741bd4fe43Sopenharmony_ci/** 16751bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 16761bd4fe43Sopenharmony_ci* @brief Get bandwidth.CNcomment:获取带宽.CNend 16771bd4fe43Sopenharmony_ci* 16781bd4fe43Sopenharmony_ci* @par Description: 16791bd4fe43Sopenharmony_ci* Get bandwidth.CNcomment:获取带宽.CNend 16801bd4fe43Sopenharmony_ci* 16811bd4fe43Sopenharmony_ci* @attention NULL 16821bd4fe43Sopenharmony_ci* @param ifname [IN] Type #const char *, interface name.CNcomment:接口名.CNend 16831bd4fe43Sopenharmony_ci* @param ifname_len [IN] Type #unsigned char, interface name length.CNcomment:接口名长度.CNend 16841bd4fe43Sopenharmony_ci* 16851bd4fe43Sopenharmony_ci* @retval #bandwidth enum.CNcomment:带宽的枚举值.CNend 16861bd4fe43Sopenharmony_ci* @par Dependency: 16871bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 16881bd4fe43Sopenharmony_ci* @see NULL 16891bd4fe43Sopenharmony_ci*/ 16901bd4fe43Sopenharmony_cihi_wifi_bw hi_wifi_get_bandwidth(const char *ifname, unsigned char ifname_len); 16911bd4fe43Sopenharmony_ci 16921bd4fe43Sopenharmony_ci/** 16931bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 16941bd4fe43Sopenharmony_ci* @brief Set channel.CNcomment:设置信道.CNend 16951bd4fe43Sopenharmony_ci* 16961bd4fe43Sopenharmony_ci* @par Description: 16971bd4fe43Sopenharmony_ci* Set channel.CNcomment:设置信道.CNend 16981bd4fe43Sopenharmony_ci* 16991bd4fe43Sopenharmony_ci* @attention NULL 17001bd4fe43Sopenharmony_ci* @param ifname [IN] Type #const char *, interface name.CNcomment:接口名.CNend 17011bd4fe43Sopenharmony_ci* @param ifname_len [IN] Type #unsigned char, interface name length.CNcomment:接口名长度.CNend 17021bd4fe43Sopenharmony_ci* @param channel [IN] Type #int , listen channel.CNcomment:信道号.CNend 17031bd4fe43Sopenharmony_ci* 17041bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 17051bd4fe43Sopenharmony_ci* @retval #Other Error code 17061bd4fe43Sopenharmony_ci* @par Dependency: 17071bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 17081bd4fe43Sopenharmony_ci* @see NULL 17091bd4fe43Sopenharmony_ci*/ 17101bd4fe43Sopenharmony_ciint hi_wifi_set_channel(const char *ifname, unsigned char ifname_len, int channel); 17111bd4fe43Sopenharmony_ci 17121bd4fe43Sopenharmony_ci/** 17131bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 17141bd4fe43Sopenharmony_ci* @brief Get channel.CNcomment:获取信道.CNend 17151bd4fe43Sopenharmony_ci* 17161bd4fe43Sopenharmony_ci* @par Description: 17171bd4fe43Sopenharmony_ci* Get channel.CNcomment:获取信道.CNend 17181bd4fe43Sopenharmony_ci* 17191bd4fe43Sopenharmony_ci* @attention NULL 17201bd4fe43Sopenharmony_ci* @param ifname [IN] Type #const char *, interface name.CNcomment:接口名.CNend 17211bd4fe43Sopenharmony_ci* @param ifname_len [IN] Type #unsigned char, interface name length.CNcomment:接口名长度.CNend 17221bd4fe43Sopenharmony_ci* 17231bd4fe43Sopenharmony_ci* @retval #HI_WIFI_INVALID_CHANNEL 17241bd4fe43Sopenharmony_ci* @retval #Other chanel value. 17251bd4fe43Sopenharmony_ci* @par Dependency: 17261bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 17271bd4fe43Sopenharmony_ci* @see NULL 17281bd4fe43Sopenharmony_ci*/ 17291bd4fe43Sopenharmony_ciint hi_wifi_get_channel(const char *ifname, unsigned char ifname_len); 17301bd4fe43Sopenharmony_ci 17311bd4fe43Sopenharmony_ci/** 17321bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 17331bd4fe43Sopenharmony_ci* @brief Set monitor mode.CNcomment:设置混杂模式.CNend 17341bd4fe43Sopenharmony_ci* 17351bd4fe43Sopenharmony_ci* @par Description: 17361bd4fe43Sopenharmony_ci* Enable/disable monitor mode of interface.CNcomment:设置指定接口的混杂模式使能.CNend 17371bd4fe43Sopenharmony_ci* 17381bd4fe43Sopenharmony_ci* @attention NULL 17391bd4fe43Sopenharmony_ci* @param ifname [IN] Type #const char * interface name.CNcomment:接口名.CNend 17401bd4fe43Sopenharmony_ci* @param enable [IN] Type #int enable(1) or disable(0).CNcomment:开启/关闭.CNend 17411bd4fe43Sopenharmony_ci* @param filter [IN] Type #hi_wifi_ptype_filter * filtered frame type enum.CNcomment:过滤列表.CNend 17421bd4fe43Sopenharmony_ci* 17431bd4fe43Sopenharmony_ci* @retval #HI_ERR_SUCCESS Excute successfully 17441bd4fe43Sopenharmony_ci* @retval #Other Error code 17451bd4fe43Sopenharmony_ci* @par Dependency: 17461bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 17471bd4fe43Sopenharmony_ci* @see NULL 17481bd4fe43Sopenharmony_ci*/ 17491bd4fe43Sopenharmony_ciint hi_wifi_promis_enable(const char *ifname, int enable, const hi_wifi_ptype_filter *filter); 17501bd4fe43Sopenharmony_ci 17511bd4fe43Sopenharmony_ci/** 17521bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 17531bd4fe43Sopenharmony_ci* @brief Register receive callback in monitor mode.CNcomment:注册混杂模式的收包回调函数.CNend 17541bd4fe43Sopenharmony_ci* 17551bd4fe43Sopenharmony_ci* @par Description: 17561bd4fe43Sopenharmony_ci* 1.Register receive callback in monitor mode.CNcomment:1.注册混杂模式的收包回调函数.CNend\n 17571bd4fe43Sopenharmony_ci* 2.Wifi driver will put the receive frames to this callback. 17581bd4fe43Sopenharmony_ci* CNcomment:2.驱动将混杂模式的收到的报文递交到注册的回调函数处理.CNend 17591bd4fe43Sopenharmony_ci* 17601bd4fe43Sopenharmony_ci* @attention NULL 17611bd4fe43Sopenharmony_ci* @param data_cb [IN] Type #hi_wifi_promis_cb callback function pointer.CNcomment:混杂模式回调函数.CNend 17621bd4fe43Sopenharmony_ci* 17631bd4fe43Sopenharmony_ci* @retval #HI_ERR_SUCCESS Excute successfully 17641bd4fe43Sopenharmony_ci* @retval #Other Error code 17651bd4fe43Sopenharmony_ci* @par Dependency: 17661bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 17671bd4fe43Sopenharmony_ci* @see NULL 17681bd4fe43Sopenharmony_ci*/ 17691bd4fe43Sopenharmony_ciint hi_wifi_promis_set_rx_callback(hi_wifi_promis_cb data_cb); 17701bd4fe43Sopenharmony_ci 17711bd4fe43Sopenharmony_ci/** 17721bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 17731bd4fe43Sopenharmony_ci* @brief Open/close system power save.CNcomment:开启/关闭WiFi低功耗模式并配置预期休眠时间.CNend 17741bd4fe43Sopenharmony_ci* 17751bd4fe43Sopenharmony_ci* @par Description: 17761bd4fe43Sopenharmony_ci* Open/close system power save.CNcomment:开启/关闭WiFi低功耗模式并配置预期休眠时间.CNend 17771bd4fe43Sopenharmony_ci* 17781bd4fe43Sopenharmony_ci* @attention NULL 17791bd4fe43Sopenharmony_ci* @param enable [IN] Type #unsigned char, enable(1) or disable(0).CNcomment:开启/关闭WiFi低功耗.CNend 17801bd4fe43Sopenharmony_ci* @param sleep_time [IN] Type #unsigned int, expected sleep time(uint: ms). CNcomment:预期休眠时间(单位: 毫秒), 17811bd4fe43Sopenharmony_ci* 参考有效范围33ms~4000ms, 准确的时间根据dtim*beacon和sleep_time值计算, 17821bd4fe43Sopenharmony_ci* 关闭低功耗或者不配置有效休眠时间时需要将sleep_time配置为0(休眠时间由关联的ap决定).CNend 17831bd4fe43Sopenharmony_ci* 17841bd4fe43Sopenharmony_ci* @retval #HI_ERR_SUCCESS Excute successfully 17851bd4fe43Sopenharmony_ci* @retval #Other Error code 17861bd4fe43Sopenharmony_ci* @par Dependency: 17871bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 17881bd4fe43Sopenharmony_ci* @see NULL 17891bd4fe43Sopenharmony_ci*/ 17901bd4fe43Sopenharmony_ciint hi_wifi_set_pm_switch(unsigned char enable, unsigned int sleep_time); 17911bd4fe43Sopenharmony_ci 17921bd4fe43Sopenharmony_ci/** 17931bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 17941bd4fe43Sopenharmony_ci* @brief Set arp offload on/off.CNcomment:设置arp offload 打开/关闭.CNend 17951bd4fe43Sopenharmony_ci* 17961bd4fe43Sopenharmony_ci* @par Description: 17971bd4fe43Sopenharmony_ci* Set arp offload on with ip address, or set arp offload off. 17981bd4fe43Sopenharmony_ci* CNcomment:设置arp offload打开、并且设置相应ip地址,或者设置arp offload关闭.CNend 17991bd4fe43Sopenharmony_ci* 18001bd4fe43Sopenharmony_ci* @attention NULL 18011bd4fe43Sopenharmony_ci* @param ifname [IN] Type #const char *, device name. 18021bd4fe43Sopenharmony_ci* @param en [IN] Type #unsigned char, arp offload type, 1-on, 0-off. 18031bd4fe43Sopenharmony_ci* @param ip [IN] Type #unsigned int, ip address in network byte order, eg:192.168.50.4 -> 0x0432A8C0. 18041bd4fe43Sopenharmony_ci* 18051bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 18061bd4fe43Sopenharmony_ci* @retval #Other Error code 18071bd4fe43Sopenharmony_ci* @par Dependency: 18081bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 18091bd4fe43Sopenharmony_ci* @see NULL 18101bd4fe43Sopenharmony_ci*/ 18111bd4fe43Sopenharmony_ciunsigned char hi_wifi_arp_offload_setting(const char *ifname, unsigned char en, unsigned int ip); 18121bd4fe43Sopenharmony_ci 18131bd4fe43Sopenharmony_ci/** 18141bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 18151bd4fe43Sopenharmony_ci* @brief Set nd offload on/off.CNcomment:设置nd offload 打开/关闭.CNend 18161bd4fe43Sopenharmony_ci* 18171bd4fe43Sopenharmony_ci* @par Description: 18181bd4fe43Sopenharmony_ci* Set nd offload on with ipv6 address, or set nd offload off. 18191bd4fe43Sopenharmony_ci* CNcomment:设置nd offload打开、设置正确的解析后的ipv6地址,或设置nd offload关闭.CNend 18201bd4fe43Sopenharmony_ci* 18211bd4fe43Sopenharmony_ci* @attention NULL 18221bd4fe43Sopenharmony_ci* @param ifname [IN] Type #const char *, device name. 18231bd4fe43Sopenharmony_ci* @param en [IN] Type #unsigned char, nd offload type, 1-on, 0-off. 18241bd4fe43Sopenharmony_ci* @param ip [IN] Type #unsigned char *, ipv6 address after parsing. 18251bd4fe43Sopenharmony_ci* eg:FE80::F011:31FF:FEE8:DB6E -> 0xfe80000000f01131fffee8db6e 18261bd4fe43Sopenharmony_ci* 18271bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 18281bd4fe43Sopenharmony_ci* @retval #Other Error code 18291bd4fe43Sopenharmony_ci* @par Dependency: 18301bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 18311bd4fe43Sopenharmony_ci* @see NULL 18321bd4fe43Sopenharmony_ci*/ 18331bd4fe43Sopenharmony_ciunsigned char hi_wifi_nd_offload_setting(const char *ifname, unsigned char en, unsigned char *ip6); 18341bd4fe43Sopenharmony_ci 18351bd4fe43Sopenharmony_ci/** 18361bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 18371bd4fe43Sopenharmony_ci* @brief Set tx power.CNcomment:设置发送功率上限.CNend 18381bd4fe43Sopenharmony_ci* 18391bd4fe43Sopenharmony_ci* @par Description: 18401bd4fe43Sopenharmony_ci* Set maximum tx power.CNcomment:设置指定接口的发送功率上限.CNend 18411bd4fe43Sopenharmony_ci* 18421bd4fe43Sopenharmony_ci* @attention 1/only softAP can set maximum tx power.CNcomment:只有AP可以设置最大发送功率.CNend 18431bd4fe43Sopenharmony_ci* 2/should start softAP before set tx power.CNcomment:只有在AP start之后才可以设置.CNend 18441bd4fe43Sopenharmony_ci* @param ifname [IN] Type #const char * interface name. 18451bd4fe43Sopenharmony_ci* @param power [IN] Type #int maximum tx power value, range (0-19]dBm. 18461bd4fe43Sopenharmony_ci* 18471bd4fe43Sopenharmony_ci* @retval #HI_ERR_SUCCESS Excute successfully 18481bd4fe43Sopenharmony_ci* @retval #Other Error code 18491bd4fe43Sopenharmony_ci* @par Dependency: 18501bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 18511bd4fe43Sopenharmony_ci* @see NULL 18521bd4fe43Sopenharmony_ci*/ 18531bd4fe43Sopenharmony_ciint hi_wifi_set_txpower_up_limit(const char *ifname, int power); 18541bd4fe43Sopenharmony_ci 18551bd4fe43Sopenharmony_ci/** 18561bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 18571bd4fe43Sopenharmony_ci* @brief Get tx power.CNcomment:获取发送功率上限.CNend 18581bd4fe43Sopenharmony_ci* 18591bd4fe43Sopenharmony_ci* @par Description: 18601bd4fe43Sopenharmony_ci* Get maximum tx power setting.CNcomment:获取接口的最大发送功率限制值.CNend 18611bd4fe43Sopenharmony_ci* 18621bd4fe43Sopenharmony_ci* @attention NULL 18631bd4fe43Sopenharmony_ci* @param ifname [IN] Type #const char * interface name. 18641bd4fe43Sopenharmony_ci* 18651bd4fe43Sopenharmony_ci* @retval #tx power value. 18661bd4fe43Sopenharmony_ci* @par Dependency: 18671bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 18681bd4fe43Sopenharmony_ci* @see NULL 18691bd4fe43Sopenharmony_ci*/ 18701bd4fe43Sopenharmony_ciint hi_wifi_get_txpower_up_limit(const char *ifname); 18711bd4fe43Sopenharmony_ci 18721bd4fe43Sopenharmony_ci/** 18731bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 18741bd4fe43Sopenharmony_ci* @brief Set retry params.CNcomment:设置软件重传策略.CNend 18751bd4fe43Sopenharmony_ci* 18761bd4fe43Sopenharmony_ci* @par Description: 18771bd4fe43Sopenharmony_ci* Set retry params.CNcomment:设置指定接口的软件重传策略.CNend 18781bd4fe43Sopenharmony_ci* 18791bd4fe43Sopenharmony_ci* @attention 1.Need call befora start sta or softap.CNcomment:1.本API需要在STA或AP start之后调用.CNend 18801bd4fe43Sopenharmony_ci* @param ifname [IN] Type #const char * interface name.CNcomment:接口名.CNend 18811bd4fe43Sopenharmony_ci* @param type [IN] Type #unsigned char retry type. 18821bd4fe43Sopenharmony_ci* CNcomment:0:次数重传(数据帧); 1:次数重传(管理帧); 2:时间重传.CNend 18831bd4fe43Sopenharmony_ci* @param limit [IN] Type #unsigned char limit value. 18841bd4fe43Sopenharmony_ci* CNcomment:重传次数(0~15次)/重传时间(0~200个时间粒度,时间粒度10ms).CNend 18851bd4fe43Sopenharmony_ci* 18861bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 18871bd4fe43Sopenharmony_ci* @retval #Other Error code 18881bd4fe43Sopenharmony_ci* @par Dependency: 18891bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 18901bd4fe43Sopenharmony_ci* @see NULL 18911bd4fe43Sopenharmony_ci*/ 18921bd4fe43Sopenharmony_ciunsigned int hi_wifi_set_retry_params(const char *ifname, unsigned char type, unsigned char limit); 18931bd4fe43Sopenharmony_ci 18941bd4fe43Sopenharmony_ci/** 18951bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 18961bd4fe43Sopenharmony_ci* @brief Set cca threshold.CNcomment:设置CCA门限.CNend 18971bd4fe43Sopenharmony_ci* 18981bd4fe43Sopenharmony_ci* @par Description: 18991bd4fe43Sopenharmony_ci* Set cca threshold.CNcomment:设置CCA门限.CNend 19001bd4fe43Sopenharmony_ci* 19011bd4fe43Sopenharmony_ci* @attention CNcomment:1.threshold设置范围是-128~126时,阈值固定为设置值.CNend\n 19021bd4fe43Sopenharmony_ci* CNcomment:2.threshold设置值为127时,恢复默认阈值-62dBm,并使能动态调整.CNend 19031bd4fe43Sopenharmony_ci* @param ifname [IN] Type #char *, device name. CNcomment:接口名.CNend 19041bd4fe43Sopenharmony_ci* @param threshold [IN] Type #char, threshold. CNcomment:门限值.CNend 19051bd4fe43Sopenharmony_ci* 19061bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 19071bd4fe43Sopenharmony_ci* @retval #Other Error code 19081bd4fe43Sopenharmony_ci* 19091bd4fe43Sopenharmony_ci* @par Dependency: 19101bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 19111bd4fe43Sopenharmony_ci* @see NULL 19121bd4fe43Sopenharmony_ci*/ 19131bd4fe43Sopenharmony_ciunsigned int hi_wifi_set_cca_threshold(const char* ifname, signed char threshold); 19141bd4fe43Sopenharmony_ci 19151bd4fe43Sopenharmony_ci/** 19161bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 19171bd4fe43Sopenharmony_ci* @brief Set tx power offset.CNcomment:设置发送功率偏移.CNend 19181bd4fe43Sopenharmony_ci* 19191bd4fe43Sopenharmony_ci* @par Description: 19201bd4fe43Sopenharmony_ci* Set tx power offset.CNcomment:设置发送功率偏移.CNend 19211bd4fe43Sopenharmony_ci* 19221bd4fe43Sopenharmony_ci* @attention CNcomment:1.offset设置范围是-150~30,单位0.1dB.参数超出范围按最接近的边界值设置CNend\n 19231bd4fe43Sopenharmony_ci* CNcomment:2.offset设置,可能会影响信道功率平坦度和evm.CNend 19241bd4fe43Sopenharmony_ci* @param ifname [IN] Type #char *, device name. CNcomment:接口名.CNend 19251bd4fe43Sopenharmony_ci* @param offset [IN] Type #signed short, offset. CNcomment:门限值.CNend 19261bd4fe43Sopenharmony_ci* 19271bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 19281bd4fe43Sopenharmony_ci* @retval #Other Error code 19291bd4fe43Sopenharmony_ci* 19301bd4fe43Sopenharmony_ci* @par Dependency: 19311bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 19321bd4fe43Sopenharmony_ci* @see NULL 19331bd4fe43Sopenharmony_ci*/ 19341bd4fe43Sopenharmony_ciunsigned int hi_wifi_set_tx_pwr_offset(const char* ifname, signed short offset); 19351bd4fe43Sopenharmony_ci 19361bd4fe43Sopenharmony_ci/** 19371bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 19381bd4fe43Sopenharmony_ci* @brief Send a custom frame.CNcomment:发送用户定制报文.CNend 19391bd4fe43Sopenharmony_ci* 19401bd4fe43Sopenharmony_ci* @par Description: 19411bd4fe43Sopenharmony_ci* Send a custom frame.CNcomment:发送用户定制报文.CNend 19421bd4fe43Sopenharmony_ci* 19431bd4fe43Sopenharmony_ci* @attention 1.Maximum length is 1400 bytes.CNcomment:1.最大支持发送1400字节的报文.CNend\n 19441bd4fe43Sopenharmony_ci* 2.Require to 802.11 prcotocol.CNcomment:2.报文须按照802.11协议格式封装.CNend\n 19451bd4fe43Sopenharmony_ci* 3.Send by management rate.CNcomment:3.采用管理帧速率发送,发送长包效率较低.CNend\n 19461bd4fe43Sopenharmony_ci* 4.Return status only specify the data has injected to send queue, isn't real send status. 19471bd4fe43Sopenharmony_ci* CNcomment:4.返回值仅表示数据是否成功进入发送队列,不表示空口发送状态.CNend\n 19481bd4fe43Sopenharmony_ci* 5.The chip is in a low-power state and does not support sending. 19491bd4fe43Sopenharmony_ci* CNcomment:5.芯片工作在低功耗状态下,不能调用该接口发送报文.CNend\n 19501bd4fe43Sopenharmony_ci* @param ifname [IN] Type #char *, device name. CNcomment:接口名.CNend 19511bd4fe43Sopenharmony_ci* @param data [IN] Type #unsigned char *, frame. CNcomment:帧内容.CNend 19521bd4fe43Sopenharmony_ci* @param len [IN] Type #unsigned int, frame length. CNcomment:帧长度.CNend 19531bd4fe43Sopenharmony_ci* 19541bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 19551bd4fe43Sopenharmony_ci* @retval #Other Error code 19561bd4fe43Sopenharmony_ci* 19571bd4fe43Sopenharmony_ci* @par Dependency: 19581bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 19591bd4fe43Sopenharmony_ci* @see NULL 19601bd4fe43Sopenharmony_ci*/ 19611bd4fe43Sopenharmony_ciint hi_wifi_send_custom_pkt(const char* ifname, const unsigned char *data, unsigned int len); 19621bd4fe43Sopenharmony_ci 19631bd4fe43Sopenharmony_ci/** 19641bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 19651bd4fe43Sopenharmony_ci* @brief Add user IEs to management frame.CNcomment:在管理帧中添加用户IE字段。CNend 19661bd4fe43Sopenharmony_ci* 19671bd4fe43Sopenharmony_ci* @par Description: 19681bd4fe43Sopenharmony_ci* Add user IEs to management frame.CNcomment:在管理帧中添加用户IE字段。CNend 19691bd4fe43Sopenharmony_ci* 19701bd4fe43Sopenharmony_ci* @attention NULL 19711bd4fe43Sopenharmony_ci* @param iftype [IN] Type #hi_wifi_iftype, interface type. CNcomment:接口类型。CNend 19721bd4fe43Sopenharmony_ci* fram_type [IN] Type #hi_wifi_frame_type, frame type,HI_WIFI_IFTYPE_STATION iftype only supports 19731bd4fe43Sopenharmony_ci* Probe Request. 19741bd4fe43Sopenharmony_ci* CNcomment:帧类型, HI_WIFI_IFTYPE_STATION 接口类型只支持Probe Request帧。CNend 19751bd4fe43Sopenharmony_ci* usr_ie_type [IN] Type #usr_ie_type, user IE type, default set zero.CNcomment:用户IE类型,默认设为0。CNend 19761bd4fe43Sopenharmony_ci* ie [IN] Type #const unsigned char *, user IE value.CNcomment:用户IE字段内容。CNend 19771bd4fe43Sopenharmony_ci* ie_len [IN] Type #unsigned short, user IE length.CNcomment:用户IE字段内容长度。CNend 19781bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 19791bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 19801bd4fe43Sopenharmony_ci* @par Dependency: 19811bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 19821bd4fe43Sopenharmony_ci* @see NULL 19831bd4fe43Sopenharmony_ci*/ 19841bd4fe43Sopenharmony_ciint hi_wifi_add_usr_app_ie(hi_wifi_iftype iftype, hi_wifi_frame_type fram_type, 19851bd4fe43Sopenharmony_ci hi_wifi_usr_ie_type usr_ie_type, const unsigned char *ie, unsigned short ie_len); 19861bd4fe43Sopenharmony_ci 19871bd4fe43Sopenharmony_ci/** 19881bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 19891bd4fe43Sopenharmony_ci* @brief Delete user IEs from management frame.CNcomment:在管理帧中删除用户IE字段。CNend 19901bd4fe43Sopenharmony_ci* 19911bd4fe43Sopenharmony_ci* @par Description: 19921bd4fe43Sopenharmony_ci* Delete user IEs from management frame.CNcomment:在管理帧中删除用户IE字段。CNend 19931bd4fe43Sopenharmony_ci* 19941bd4fe43Sopenharmony_ci* @attention NULL 19951bd4fe43Sopenharmony_ci* @param iftype [IN] Type #hi_wifi_iftype, interface type. CNcomment:接口类型。CNend 19961bd4fe43Sopenharmony_ci* fram_type [IN] Type #hi_wifi_frame_type, frame type,HI_WIFI_IFTYPE_STATION iftype only supports 19971bd4fe43Sopenharmony_ci* Probe Request. 19981bd4fe43Sopenharmony_ci* CNcomment:帧类型, HI_WIFI_IFTYPE_STATION 接口类型只支持Probe Request帧。CNend 19991bd4fe43Sopenharmony_ci* usr_ie_type [IN] Type #usr_ie_type, user IE type, default set zero.CNcomment:用户IE类型,默认设为0。CNend 20001bd4fe43Sopenharmony_ci* @retval #HISI_OK Execute successfully. 20011bd4fe43Sopenharmony_ci* @retval #HISI_FAIL Execute failed. 20021bd4fe43Sopenharmony_ci* @par Dependency: 20031bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 20041bd4fe43Sopenharmony_ci* @see NULL 20051bd4fe43Sopenharmony_ci*/ 20061bd4fe43Sopenharmony_ciint hi_wifi_delete_usr_app_ie(hi_wifi_iftype iftype, hi_wifi_frame_type fram_type, hi_wifi_usr_ie_type usr_ie_type); 20071bd4fe43Sopenharmony_ci 20081bd4fe43Sopenharmony_ci/** 20091bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 20101bd4fe43Sopenharmony_ci* @brief Set tcp mode.CNcomment:设置tpc开关.CNend 20111bd4fe43Sopenharmony_ci* 20121bd4fe43Sopenharmony_ci* @par Description: 20131bd4fe43Sopenharmony_ci* Set tpc mode.CNcomment:设置tpc开关.CNend 20141bd4fe43Sopenharmony_ci* 20151bd4fe43Sopenharmony_ci* @attention 1.Mode set to 1, enable auto power control. set to 0, disbale it. 20161bd4fe43Sopenharmony_ci* CNcomment:1.mode范围是0~1,1:打开发送功率自动控制,0:关闭发送功率自动控制.CNend 20171bd4fe43Sopenharmony_ci* @param ifname [IN] Type #char *, device name. CNcomment:接口名.CNend 20181bd4fe43Sopenharmony_ci* @param ifname_len [IN] Type #unsigned char, interface name length.CNcomment:接口名长度.CNend 20191bd4fe43Sopenharmony_ci* @param tpc_value [IN] Type #unsigned int, tpc_value. CNcomment:tpc开关.CNend 20201bd4fe43Sopenharmony_ci* 20211bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 20221bd4fe43Sopenharmony_ci* @retval #Other Error code 20231bd4fe43Sopenharmony_ci* 20241bd4fe43Sopenharmony_ci* @par Dependency: 20251bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 20261bd4fe43Sopenharmony_ci* @see NULL 20271bd4fe43Sopenharmony_ci*/ 20281bd4fe43Sopenharmony_ciunsigned int hi_wifi_set_tpc(const char* ifname, unsigned char ifname_len, unsigned int tpc_value); 20291bd4fe43Sopenharmony_ci 20301bd4fe43Sopenharmony_ci/** 20311bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 20321bd4fe43Sopenharmony_ci* @brief Start STA's anchor point function.CNcomment:启动STA的锚点同步功能.CNend 20331bd4fe43Sopenharmony_ci* 20341bd4fe43Sopenharmony_ci* @par Description: 20351bd4fe43Sopenharmony_ci* Start STA's anchor point function.CNcomment:启动STA的锚点同步功能.CNend 20361bd4fe43Sopenharmony_ci* 20371bd4fe43Sopenharmony_ci* @attention 1.Only support STATION.CNcomment:1.仅支持STA开启该功能.CNend 20381bd4fe43Sopenharmony_ci* 2.Channel set to 0 indicates no channel specified.CNcomment:2.不指定信道时channel参数可设置为0.CNend 20391bd4fe43Sopenharmony_ci* @param ssid [IN] Type #char *, ap's ssid. CNcomment:ap的ssid.CNend 20401bd4fe43Sopenharmony_ci* @param ssid_len [IN] Type #unsigned char, ssid length.CNcomment:ssid长度.CNend 20411bd4fe43Sopenharmony_ci* @param channel [IN] Type #unsigned char, ap's channel.CNcomment:ap的信道.CNend 20421bd4fe43Sopenharmony_ci* 20431bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 20441bd4fe43Sopenharmony_ci* @retval #Other Error code 20451bd4fe43Sopenharmony_ci* 20461bd4fe43Sopenharmony_ci* @par Dependency: 20471bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 20481bd4fe43Sopenharmony_ci* @see NULL 20491bd4fe43Sopenharmony_ci*/ 20501bd4fe43Sopenharmony_ciint hi_wifi_start_anchor(const unsigned char *bssid, unsigned char bssid_len, unsigned char channel, 20511bd4fe43Sopenharmony_ci hi_wifi_anchor_cb cb); 20521bd4fe43Sopenharmony_ci 20531bd4fe43Sopenharmony_ci/** 20541bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 20551bd4fe43Sopenharmony_ci* @brief Stop STA's anchor point function.CNcomment:停止STA的锚点同步功能.CNend 20561bd4fe43Sopenharmony_ci* 20571bd4fe43Sopenharmony_ci* @par Description: 20581bd4fe43Sopenharmony_ci* Stop STA's anchor point function.CNcomment:停止STA的锚点同步功能.CNend 20591bd4fe43Sopenharmony_ci* 20601bd4fe43Sopenharmony_ci* @attention 1.After stoping need stop and start sta again to use normal sta function. 20611bd4fe43Sopenharmony_ci* CNcomment:1.关闭锚点后需要stop STA并重新启动STA以使用正常的wifi功能.CNend 20621bd4fe43Sopenharmony_ci* 20631bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 20641bd4fe43Sopenharmony_ci* @retval #Other Error code 20651bd4fe43Sopenharmony_ci* 20661bd4fe43Sopenharmony_ci* @par Dependency: 20671bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 20681bd4fe43Sopenharmony_ci* @see NULL 20691bd4fe43Sopenharmony_ci*/ 20701bd4fe43Sopenharmony_ciint hi_wifi_stop_anchor(void); 20711bd4fe43Sopenharmony_ci 20721bd4fe43Sopenharmony_ci/** 20731bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 20741bd4fe43Sopenharmony_ci* @brief Set STA's anchor wake up time offset.CNcomment:配置STA的唤醒提前量.CNend 20751bd4fe43Sopenharmony_ci* 20761bd4fe43Sopenharmony_ci* @par Description: 20771bd4fe43Sopenharmony_ci* Set STA's anchor wake up time offset.CNcomment:配置STA的唤醒提前量.CNend 20781bd4fe43Sopenharmony_ci* 20791bd4fe43Sopenharmony_ci* @attention 1.before sta start, the function should call first. 20801bd4fe43Sopenharmony_ci* CNcomment:1.在STA strart之前先调用.CNend 20811bd4fe43Sopenharmony_ci* 2.offset_time should less than 15000us. 20821bd4fe43Sopenharmony_ci* CNcomment:2.偏移时间应该小于15000us.CNend 20831bd4fe43Sopenharmony_ci* @param offset_time [IN] Type #unsigned short, offset time(us). CNcomment:唤醒提前量.CNend 20841bd4fe43Sopenharmony_ci* 20851bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 20861bd4fe43Sopenharmony_ci* @retval #Other Error code 20871bd4fe43Sopenharmony_ci* 20881bd4fe43Sopenharmony_ci* @par Dependency: 20891bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 20901bd4fe43Sopenharmony_ci* @see NULL 20911bd4fe43Sopenharmony_ci*/ 20921bd4fe43Sopenharmony_ciint hi_wifi_anchor_wakeup_offset_time(unsigned short offset_time); 20931bd4fe43Sopenharmony_ci 20941bd4fe43Sopenharmony_ci/** 20951bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 20961bd4fe43Sopenharmony_ci* @brief Get Status Codes for Authentication and Association Frames. 20971bd4fe43Sopenharmony_ci* CNcomment:查询Authentication与Association帧status code.CNend 20981bd4fe43Sopenharmony_ci* 20991bd4fe43Sopenharmony_ci* @par Description: 21001bd4fe43Sopenharmony_ci* Get Status Codes for Authentication and Association Frames. 21011bd4fe43Sopenharmony_ci* CNcomment:查询Authentication与Association帧status code.CNend 21021bd4fe43Sopenharmony_ci* @attention 1.the return value is Status Codes for Authentication and Association Frames in 802.11. 21031bd4fe43Sopenharmony_ci* 2.used when STA connect AP fail. 21041bd4fe43Sopenharmony_ci* 3.the -1 return value means no status code, then if you want to get the reason of connect fail, use 21051bd4fe43Sopenharmony_ci* event_wifi_disconnected.reason_code. 21061bd4fe43Sopenharmony_ci* CNcomment: 21071bd4fe43Sopenharmony_ci* 1.返回值为802.11协议中Authentication reponse与Association reponse帧的status code 21081bd4fe43Sopenharmony_ci* 2.网卡类型为STA时使用,在STA发起路由器连接并失败时调用 21091bd4fe43Sopenharmony_ci* 3.如果返回值为-1,表示无status code信息,此时获取连接失败的原因请使用event_wifi_disconnected结构体中的 21101bd4fe43Sopenharmony_ci* reason_code值.CNend 21111bd4fe43Sopenharmony_ci* @param NULL 21121bd4fe43Sopenharmony_ci* 21131bd4fe43Sopenharmony_ci* @retval #Status Codes value 21141bd4fe43Sopenharmony_ci* 21151bd4fe43Sopenharmony_ci* 21161bd4fe43Sopenharmony_ci* @par Dependency: 21171bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 21181bd4fe43Sopenharmony_ci* @see NULL 21191bd4fe43Sopenharmony_ci*/ 21201bd4fe43Sopenharmony_cishort hi_wifi_get_mac_status_code(void); 21211bd4fe43Sopenharmony_ci 21221bd4fe43Sopenharmony_ci/** 21231bd4fe43Sopenharmony_ci* @ingroup hi_wifi_basic 21241bd4fe43Sopenharmony_ci* @brief Set evm para.CNcomment:设置evm参数.CNend 21251bd4fe43Sopenharmony_ci* 21261bd4fe43Sopenharmony_ci* @par Description: 21271bd4fe43Sopenharmony_ci* Set evm para.CNcomment:设置evm参数.CNend 21281bd4fe43Sopenharmony_ci* 21291bd4fe43Sopenharmony_ci* @attention 1.Should be called before hi_wifi_init(). 21301bd4fe43Sopenharmony_ci* CNcomment:只能在hi_wifi_init()函数前调用.CNend 21311bd4fe43Sopenharmony_ci* @param pa_bias [IN] Type #unsigned char, PA bias setting.0:0xfe83,default value.1:0xfcc3.Others:invalid. 21321bd4fe43Sopenharmony_ci* CNcomment:PA偏置,0:0xfe83,默认值;1:0xfcc3;其它值:不支持.CNend 21331bd4fe43Sopenharmony_ci* @param osc_drv_vals [IN] Type #hi_wifi_xldo_voltage *, OSC driver values ch1~14.CNcomment:信道1~14的OSC驱动强度值.CNend 21341bd4fe43Sopenharmony_ci* @param size [IN] Type #unsigned char, OSC driver values' size.Should be 14. 21351bd4fe43Sopenharmony_ci* CNcomment:OSC驱动强度值数组大小,只能为14.CNend 21361bd4fe43Sopenharmony_ci* 21371bd4fe43Sopenharmony_ci* @retval #HISI_OK Excute successfully 21381bd4fe43Sopenharmony_ci* @retval #Other Error code 21391bd4fe43Sopenharmony_ci* 21401bd4fe43Sopenharmony_ci* @par Dependency: 21411bd4fe43Sopenharmony_ci* @li hi_wifi_api.h: WiFi API 21421bd4fe43Sopenharmony_ci* @see NULL 21431bd4fe43Sopenharmony_ci*/ 21441bd4fe43Sopenharmony_ciunsigned int hi_wifi_set_evm_para(unsigned char pa_bias, hi_wifi_xldo_voltage *osc_drv_vals, unsigned char size); 21451bd4fe43Sopenharmony_ci 21461bd4fe43Sopenharmony_ci#ifdef __cplusplus 21471bd4fe43Sopenharmony_ci#if __cplusplus 21481bd4fe43Sopenharmony_ci } 21491bd4fe43Sopenharmony_ci#endif 21501bd4fe43Sopenharmony_ci#endif 21511bd4fe43Sopenharmony_ci 21521bd4fe43Sopenharmony_ci#endif /* end of hi_wifi_api.h */ 2153