1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
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 OHOS_IDL_IWIFI_SUPPLICANT_IFACE_H
17 #define OHOS_IDL_IWIFI_SUPPLICANT_IFACE_H
18 
19 #include <stdint.h>
20 #include "wifi_error_no.h"
21 #include "i_wifi_struct.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /**
28  * @Description Set the supplementary event callback function.
29  *
30  * @param callback
31  */
32 void SetSupplicantEventCallback(ISupplicantEventCallback callback);
33 
34 /**
35  * @Description Obtains the supplementary event callback structure.
36  *
37  * @return ISupplicantEventCallback*
38  */
39 ISupplicantEventCallback *GetSupplicantEventCallback(void);
40 
41 /**
42  * @Description Start Supplicant.
43  *
44  * @return WifiErrorNo
45  */
46 WifiErrorNo StartSupplicant(void);
47 
48 /**
49  * @Description Close Supplicant.
50  *
51  * @return WifiErrorNo
52  */
53 WifiErrorNo StopSupplicant(void);
54 
55 /**
56  * @Description Connect supplicant.
57  *
58  * @return WifiErrorNo
59  */
60 WifiErrorNo ConnectSupplicant(void);
61 
62 /**
63  * @Description DisConnect Supplicant.
64  *
65  * @return WifiErrorNo
66  */
67 WifiErrorNo DisconnectSupplicant(void);
68 
69 /**
70  * @Description Request to Supplicant.
71  *
72  * @param buf
73  * @param bufSize
74  * @return WifiErrorNo
75  */
76 WifiErrorNo RequestToSupplicant(unsigned char *buf, int32_t bufSize);
77 
78 /**
79  * @Description Registers the supplementary event callback function.
80  *
81  * @param callback
82  * @return WifiErrorNo
83  */
84 WifiErrorNo RegisterSupplicantEventCallback(ISupplicantEventCallback callback);
85 
86 /**
87  * @Description Connect.
88  *
89  * @param networkId
90  * @return WifiErrorNo
91  */
92 WifiErrorNo Connect(int networkId);
93 
94 /**
95  * @Description Reconnect.
96  *
97  * @return WifiErrorNo
98  */
99 WifiErrorNo Reconnect(void);
100 
101 /**
102  * @Description Reassociate.
103  *
104  * @return WifiErrorNo
105  */
106 WifiErrorNo Reassociate(void);
107 
108 /**
109  * @Description Disconnect.
110  *
111  * @return WifiErrorNo
112  */
113 WifiErrorNo Disconnect(void);
114 
115 /**
116  * @Description Turn on/off power save mode for the interface.
117  *
118  * @param enable
119  * @return WifiErrorNo
120  */
121 WifiErrorNo SetPowerSave(int enable);
122 
123 /**
124  * @Description Setting the country code.
125  *
126  * @param countryCode
127  * @return WifiErrorNo
128  */
129 WifiErrorNo WpaSetCountryCode(const char *countryCode);
130 
131 /**
132  * @Description Obtains the country code.
133  *
134  * @param countryCode
135  * @param codeSize
136  * @return WifiErrorNo
137  */
138 WifiErrorNo WpaGetCountryCode(char *countryCode, int codeSize);
139 #ifdef __cplusplus
140 }
141 #endif
142 #endif