1 /* 2 * Copyright (c) 2022 Winner Microelectronics Co., Ltd. All rights reserved. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef __WM_WIFI_API_H__ 17 #define __WM_WIFI_API_H__ 18 19 #ifdef __cplusplus 20 #if __cplusplus 21 extern "C" { 22 #endif 23 #endif 24 25 /** 26 * mac transform string.CNcomment:地址转为字符串.CNend 27 */ 28 #ifndef MACSTR 29 #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" 30 #endif 31 32 #ifndef MAC2STR 33 #define mac2str(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] 34 #endif 35 36 #ifndef bit 37 #define bit(x) (1U << (x)) 38 #endif 39 40 /** 41 * @ingroup hi_wifi_basic 42 * 43 * TKIP of cipher mode.CNcomment:加密方式为TKIP.CNend 44 */ 45 #define WIFI_CIPHER_TKIP bit(3) 46 47 /** 48 * @ingroup hi_wifi_basic 49 * 50 * CCMP of cipher mode.CNcomment:加密方式为CCMP.CNend 51 */ 52 #define WIFI_CIPHER_CCMP bit(4) 53 54 /** 55 * @ingroup hi_wifi_basic 56 * 57 * Channel numbers of 2.4G frequency.CNcomment:2.4G频段的信道数量.CNend 58 */ 59 #define WIFI_24G_CHANNEL_NUMS 14 60 61 /** 62 * @ingroup hi_wifi_basic 63 * 64 * max interiface name length.CNcomment:网络接口名最大长度.CNend 65 */ 66 #define WIFI_IFNAME_MAX_SIZE 16 67 68 /** 69 * @ingroup hi_wifi_basic 70 * 71 * The minimum timeout of a single reconnection.CNcomment:最小单次重连超时时间.CNend 72 */ 73 #define WIFI_MIN_RECONNECT_TIMEOUT 2 74 75 /** 76 * @ingroup hi_wifi_basic 77 * 78 * The maximum timeout of a single reconnection, representing an infinite number of loop reconnections. 79 * CNcomment:最大单次重连超时时间,表示无限次循环重连.CNend 80 */ 81 #define WIFI_MAX_RECONNECT_TIMEOUT 65535 82 83 /** 84 * @ingroup hi_wifi_basic 85 * 86 * The minimum auto reconnect interval.CNcomment:最小自动重连间隔时间.CNend 87 */ 88 #define WIFI_MIN_RECONNECT_PERIOD 1 89 90 /** 91 * @ingroup hi_wifi_basic 92 * 93 * The maximum auto reconnect interval.CNcomment:最大自动重连间隔时间.CNend 94 */ 95 #define WIFI_MAX_RECONNECT_PERIOD 65535 96 97 /** 98 * @ingroup hi_wifi_basic 99 * 100 * The minmum times of auto reconnect.CNcomment:最小自动重连连接次数.CNend 101 */ 102 #define WIFI_MIN_RECONNECT_TIMES 1 103 104 /** 105 * @ingroup hi_wifi_basic 106 * 107 * The maximum times of auto reconnect.CNcomment:最大自动重连连接次数.CNend 108 */ 109 #define WIFI_MAX_RECONNECT_TIMES 65535 110 111 /** 112 * @ingroup hi_wifi_basic 113 * 114 * max scan number of ap.CNcomment:支持扫描ap的最多数目.CNend 115 */ 116 #define WIFI_SCAN_AP_LIMIT 32 117 118 /** 119 * @ingroup hi_wifi_basic 120 * 121 * length of status buff.CNcomment:获取连接状态字符串的长度.CNend 122 */ 123 #define WIFI_STATUS_BUF_LEN_LIMIT 512 124 125 /** 126 * @ingroup hi_wifi_basic 127 * 128 * Decimal only WPS pin code length.CNcomment:WPS中十进制pin码长度.CNend 129 */ 130 #define WIFI_WPS_PIN_LEN 8 131 132 /** 133 * @ingroup hi_wifi_basic 134 * 135 * default max num of station.CNcomment:默认支持的station最大个数.CNend 136 */ 137 #define WIFI_DEFAULT_MAX_NUM_STA 6 138 139 #ifdef __cplusplus 140 #if __cplusplus 141 } 142 #endif 143 #endif 144 145 #endif /* end of hi_wifi_api.h */