• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
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  * Description: wifi_hotspot.h 的头文件
15  */
16 
17 
18 #ifndef SERVICE_WIFI_HOTSPOT_H
19 #define SERVICE_WIFI_HOTSPOT_H
20 #include "wifi_device.h"
21 #include "errcode.h"
22 #include "wifi_hotspot_config.h"
23 
24 #ifdef __cplusplus
25 #if __cplusplus
26 extern "C" {
27 #endif
28 #endif
29 
30 /**
31  * @defgroup middleware_service_wifi_hotspot WiFi Hotspot
32  * @ingroup  middleware_service_wifi
33  * @{
34  */
35 
36 
37 /**
38  * @if Eng
39  * @brief  Start softap interface.
40  * @param  [in]  config SoftAP's configuration.
41  * @retval ERRCODE_SUCC        Execute successfully.
42  * @retval Other               Execute failed.
43  * @else
44  * @brief  开启SoftAP。
45  * @param  [in]  config 表示SoftAP配置。
46  * @retval ERRCODE_SUCC 成功。
47  * @retval Other        失败。
48  * @endif
49  */
50 errcode_t wifi_softap_enable(const softap_config_stru *config);
51 
52 /**
53  * @if Eng
54  * @brief  Close softap interface.
55  * @retval ERRCODE_SUCC        Execute successfully.
56  * @retval Other               Execute failed.
57  * @else
58  * @brief  关闭SoftAP。
59  * @retval ERRCODE_SUCC 成功。
60  * @retval Other        失败。
61  * @endif
62  */
63 errcode_t wifi_softap_disable(void);
64 
65 /**
66  * @if Eng
67  * @brief  Get hotspot enable status.
68  * @retval 1    softap is initialized.
69  * @retval 0    softap is not initialized.
70  * @else
71  * @brief  获取hotspot使能状态。
72  * @retval 1 softap已经使能。
73  * @retval 0 softap未使能。
74  * @endif
75  */
76 int32_t wifi_is_softap_enabled(void);
77 
78 /**
79  * @if Eng
80  * @brief  Extended configuration of SoftAP.
81  * @param  [in]  config Config parameters of hotspot.
82  * @retval ERRCODE_SUCC        Execute successfully.
83  * @retval Other               Execute failed.
84  * @else
85  * @brief  开启SoftAP。
86  * @param  [in]  config 表示Softap的扩展配置。
87  * @retval ERRCODE_SUCC 成功。
88  * @retval Other        失败。
89  * @endif
90  */
91 errcode_t wifi_set_softap_config_advance(const softap_config_advance_stru *config);
92 
93 /**
94  * @if Eng
95  * @brief  get hotspot config.
96  * @param  [out]  result Config of hotspot.
97  * @retval ERRCODE_SUCC        Execute successfully.
98  * @retval Other               Execute failed.
99  * @else
100  * @brief  获取SoftAP配置。
101  * @param  [out]  result hotspot的配置信息。
102  * @retval ERRCODE_SUCC 成功。
103  * @retval Other        失败。
104  * @endif
105  */
106 errcode_t wifi_get_softap_config(softap_config_stru *result);
107 
108 /**
109  * @if Eng
110  * @brief  get hotspot config.
111  * @param  [out]  result Advance config of hotspot.
112  * @retval ERRCODE_SUCC        Execute successfully.
113  * @retval Other               Execute failed.
114  * @else
115  * @brief  获取SoftAP扩展配置。
116  * @param  [out]  result hotspot的扩展配置信息。
117  * @retval ERRCODE_SUCC 成功。
118  * @retval Other        失败。
119  * @endif
120  */
121 errcode_t wifi_get_softap_config_advance(softap_config_advance_stru *result);
122 
123 /**
124  * @if Eng
125  * @brief  Get all user's information of softap.
126  * @param  [out]  result Station information.
127  * @param  [out]  size Station number.
128  * @retval ERRCODE_SUCC        Execute successfully.
129  * @retval Other               Execute failed.
130  * @else
131  * @brief  softap获取已连接的station的信息。
132  * @param  [out]  result STA信息。
133  * @param  [out]  size   STA个数。
134  * @retval ERRCODE_SUCC 成功。
135  * @retval Other        失败。
136  * @endif
137  */
138 errcode_t wifi_softap_get_sta_list(wifi_sta_info_stru *result, uint32_t *size);
139 
140 /**
141  * @if Eng
142  * @brief  Softap deauth user by mac address.
143  * @param  [in]  mac    Station mac address.
144  * @param  [in]  mac_len Station mac address length, must be 6.
145  * @retval ERRCODE_SUCC        Execute successfully.
146  * @retval Other               Execute failed.
147  * @else
148  * @brief  softap指定断开连接的station网络。
149  * @param  [in]  mac    MAC地址。
150  * @param  [in]  mac_len MAC地址长度,必须为6。
151  * @retval ERRCODE_SUCC 成功。
152  * @retval Other        失败。
153  * @endif
154  */
155 errcode_t wifi_softap_deauth_sta(const uint8_t *mac, int32_t mac_len);
156 
157 /**
158  * @}
159  */
160 
161 #ifdef __cplusplus
162 #if __cplusplus
163 }
164 #endif
165 #endif
166 
167 #endif // SERVICE_WIFI_HOTSPOT_H
168