1/*
2 * Copyright (c) 2022 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/**
17 * @addtogroup WLAN
18 * @{
19 *
20 * @brief Provides APIs for the upper-layer WLAN service.
21 *
22 * You can use the APIs to enable or disable a WLAN hotspot, scan for hotspots, connect to a WLAN hotspot,
23 * manage WLAN chips, network devices, and power, and apply for, release, and move network data buffers.
24 *
25 * @since 3.2
26 * @version 1.0
27 */
28
29 /**
30 * @file WlanTypes.idl
31 *
32 * @brief Defines data types related to the WLAN module.
33 *
34 * The WLAN module data includes the {@code Feature} object information, station (STA) information,
35 * scan information, and network device information.
36 *
37 * @since 3.2
38 * @version 1.0
39 */
40
41/**
42 * @brief Defines the package path of the WLAN module interface.
43 *
44 * @since 3.2
45 * @version 1.0
46 */
47package ohos.hdi.wlan.v1_0;
48
49/**
50 * @brief Defines the {@code Feature} object information.
51 *
52 * @since 3.2
53 * @version 1.0
54 */
55struct HdfFeatureInfo {
56    /** NIC name of the {@code Feature} object. */
57    String ifName;
58    /** {@code Feature} object. */
59    int type;
60};
61
62/**
63 * @brief Defines STA information.
64 *
65 * @since 3.2
66 * @version 1.0
67 */
68struct HdfStaInfo {
69    /** MAC address of an STA. */
70    unsigned char[] mac;
71};
72
73/**
74 * @brief Defines the service set identifier (SSID) information for a Wi-Fi scan.
75 *
76 * @since 3.2
77 * @version 1.0
78 */
79struct HdfWifiDriverScanSsid {
80    /** SSID to scan. */
81    String ssid;
82    /** Length of the SSID. */
83    int ssidLen;
84};
85
86/**
87 * @brief Defines Wi-Fi scan parameters.
88 *
89 * @since 3.2
90 * @version 1.0
91 */
92struct HdfWifiScan{
93    /** SSIDs to scan. */
94    struct HdfWifiDriverScanSsid[] ssids;
95    /** Frequencies to scan. */
96    int[] freqs;
97    /** Extended information element (IE) carried in a Wi-Fi scan request. */
98    unsigned char[] extraIes;
99    /** Basic service set identifier (BSSID) to scan. */
100    unsigned char[] bssid;
101    /** Whether the SSID to be scanned has a prefix. */
102    unsigned char prefixSsidScanFlag;
103    /** Fast connect flag. */
104    unsigned char fastConnectFlag;
105};
106
107/**
108 * @brief Defines network device Information.
109 *
110 * @since 3.2
111 * @version 1.0
112 */
113struct HdfNetDeviceInfo {
114    /** Index of the network device. */
115    unsigned int index;
116    /** Network interface card (NIC) name. */
117    String ifName;
118    /** Length of the NIC name. */
119    unsigned int ifNameLen;
120    /** NIC type. */
121    unsigned char iftype;
122    /** MAC address of the network device. */
123    unsigned char[] mac;
124};
125
126/**
127 * @brief Defines the network device information set.
128 *
129 * @since 3.2
130 * @version 1.0
131 */
132struct HdfNetDeviceInfoResult {
133    /** A sef of network device information. */
134    struct HdfNetDeviceInfo[] deviceInfos;
135};
136
137/**
138 * @brief Defines the Wi-Fi scan result.
139 *
140 * @since 3.2
141 * @version 1.0
142 */
143struct HdfWifiScanResult {
144    /** Flag of the basic service set (BSS)/independent basic service set (IBSS). */
145    unsigned int flags;
146    /** BSSID information. */
147    unsigned char[] bssid;
148    /** Capability information fields (in host byte order). */
149    unsigned short caps;
150    /** Channel frequency. */
151    unsigned int freq;
152    /** Beacon interval. */
153    unsigned short beaconInt;
154    /** Signal quality. */
155    int qual;
156    /** Signal strength. */
157    int level;
158    /** Time for receiving the latest beacon or probe response frame, in milliseconds. */
159    unsigned int age;
160    /** Variable value in the scan result. */
161    unsigned char[] variable;
162    /** IE in the following Probe Response message. */
163    unsigned char[] ie;
164    /** IE in the following beacon. */
165    unsigned char[] beaconIe;
166};
167
168/**
169 * @brief Define Wi-Fi frequency band information.
170 *
171 * @since 3.2
172 * @version 1.0
173 */
174struct HdfWifiInfo {
175    /** Wi-Fi frequency band. */
176    int band;
177    /** Number of frequencies supported in the Wi-Fi frequency band. */
178    unsigned int size;
179};
180
181/**
182 * @brief Defines the channel measurement parameters.
183 *
184 * @since 3.2
185 * @version 1.0
186 */
187struct MeasChannelParam {
188    /** Channel ID. */
189    int channelId;
190    /** Measure time. */
191    int measTime;
192};
193
194/**
195 * @brief Defines the channel measurement result.
196 *
197 * @since 3.2
198 * @version 1.0
199 */
200struct MeasChannelResult {
201    /** Channel ID. */
202    int channelId;
203    /** Channel load. */
204    int chload;
205    /** Channel noise. */
206    int noise;
207};
208
209/**
210 * @brief Defines the projection parameters.
211 *
212 * @since 3.2
213 * @version 1.0
214 */
215struct ProjectionScreenCmdParam {
216    /** ID of the projection command. */
217    int cmdId;
218    /** Content of the projection command. */
219    byte[] buf;
220};
221
222/**
223 * @brief Defines STA information.
224 *
225 * @since 3.2
226 * @version 1.0
227 */
228struct WifiStationInfo {
229    /** Receive (RX) rate. */
230    unsigned int rxRate;
231    /** Transmit (TX) rate. */
232    unsigned int txRate;
233    /** Transmission type. */
234    unsigned int flags;
235    /** RX Very High Throughput Modulation and Coding Scheme (VHT-MCS) configuration. */
236    unsigned char rxVhtmcs;
237    /** TX VHT-MCS configuration. */
238    unsigned char txVhtmcs;
239    /** RX Modulation and Coding Scheme (MCS) index. */
240    unsigned char rxMcs;
241    /** TX MCS index. */
242    unsigned char txMcs;
243    /** RX Very High Throughput Number of Spatial Streams (VHT-NSS) configuration. */
244    unsigned char rxVhtNss;
245    /** TX VHT-NSS configuration. */
246    unsigned char txVhtNss;
247};
248
249struct AdjustChannelInfo {
250    int msgId;
251    unsigned char chanNumber;
252    unsigned char bandwidth;
253    unsigned char switchType;
254    unsigned char statusCode;
255};
256/** @} */