1/* 2 * Copyright (c) 2023 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.1 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.1 39 */ 40 41/** 42 * @brief Defines the package path of the WLAN module interface. 43 * 44 * @since 3.2 45 * @version 1.1 46 */ 47package ohos.hdi.wlan.v1_1; 48 49/** 50 * @brief Defines the {@code Feature} object information. 51 * 52 * @since 3.2 53 * @version 1.1 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.1 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.1 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.1 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.1 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.1 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.1 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 Defines the Wi-Fi scan result. 170 * 171 * @since 4.0 172 * @version 1.1 173 */ 174struct HdfWifiScanResultExt { 175 /** Flag of the basic service set (BSS)/independent basic service set (IBSS). */ 176 unsigned int flags; 177 /** BSSID information. */ 178 unsigned char[] bssid; 179 /** Capability information fields (in host byte order). */ 180 unsigned short caps; 181 /** Channel frequency. */ 182 unsigned int freq; 183 /** Beacon interval. */ 184 unsigned short beaconInt; 185 /** Signal quality. */ 186 int qual; 187 /** Signal strength. */ 188 int level; 189 /** Time for receiving the latest beacon or probe response frame, in milliseconds. */ 190 unsigned int age; 191 /** Timestamp **/ 192 unsigned long tsf; 193 /** Variable value in the scan result. */ 194 unsigned char[] variable; 195 /** IE in the following Probe Response message. */ 196 unsigned char[] ie; 197 /** IE in the following beacon. */ 198 unsigned char[] beaconIe; 199}; 200 201/** 202 * @brief Defines the Wi-Fi scan results. 203 * 204 * @since 4.0 205 * @version 1.1 206 */ 207struct HdfWifiScanResults { 208 struct HdfWifiScanResultExt[] res; 209}; 210 211/** 212 * @brief Define Wi-Fi frequency band information. 213 * 214 * @since 3.2 215 * @version 1.1 216 */ 217struct HdfWifiInfo { 218 /** Wi-Fi frequency band. */ 219 int band; 220 /** Number of frequencies supported in the Wi-Fi frequency band. */ 221 unsigned int size; 222}; 223 224/** 225 * @brief Defines the channel measurement parameters. 226 * 227 * @since 3.2 228 * @version 1.1 229 */ 230struct MeasChannelParam { 231 /** Channel ID. */ 232 int channelId; 233 /** Measure time. */ 234 int measTime; 235}; 236 237/** 238 * @brief Defines the channel measurement result. 239 * 240 * @since 3.2 241 * @version 1.1 242 */ 243struct MeasChannelResult { 244 /** Channel ID. */ 245 int channelId; 246 /** Channel load. */ 247 int chload; 248 /** Channel noise. */ 249 int noise; 250}; 251 252/** 253 * @brief Defines the projection parameters. 254 * 255 * @since 3.2 256 * @version 1.1 257 */ 258struct ProjectionScreenCmdParam { 259 /** ID of the projection command. */ 260 int cmdId; 261 /** Content of the projection command. */ 262 byte[] buf; 263}; 264 265/** 266 * @brief Defines STA information. 267 * 268 * @since 3.2 269 * @version 1.1 270 */ 271struct WifiStationInfo { 272 /** Receive (RX) rate. */ 273 unsigned int rxRate; 274 /** Transmit (TX) rate. */ 275 unsigned int txRate; 276 /** Transmission type. */ 277 unsigned int flags; 278 /** RX Very High Throughput Modulation and Coding Scheme (VHT-MCS) configuration. */ 279 unsigned char rxVhtmcs; 280 /** TX VHT-MCS configuration. */ 281 unsigned char txVhtmcs; 282 /** RX Modulation and Coding Scheme (MCS) index. */ 283 unsigned char rxMcs; 284 /** TX MCS index. */ 285 unsigned char txMcs; 286 /** RX Very High Throughput Number of Spatial Streams (VHT-NSS) configuration. */ 287 unsigned char rxVhtNss; 288 /** TX VHT-NSS configuration. */ 289 unsigned char txVhtNss; 290}; 291 292struct AdjustChannelInfo { 293 int msgId; 294 unsigned char chanNumber; 295 unsigned char bandwidth; 296 unsigned char switchType; 297 unsigned char statusCode; 298}; 299 300/** 301 * @brief Defines Pno scan network information. 302 * 303 * @since 4.0 304 * @version 1.1 305 */ 306struct PnoNetwork { 307 /** whether to scan hidden network. */ 308 boolean isHidden; 309 /** Frequencies to scan. */ 310 int[] freqs; 311 /** Ssid to scan. */ 312 struct HdfWifiDriverScanSsid ssid; 313}; 314 315/** 316 * @brief Defines Pno scan parameters. 317 * 318 * @since 4.0 319 * @version 1.1 320 */ 321struct PnoSettings { 322 /** Minimum 2G Rssi to scan. */ 323 int min2gRssi; 324 /** Minimum 5G Rssi to scan. */ 325 int min5gRssi; 326 /** Scan interval. */ 327 int scanIntervalMs; 328 /** Scan iteration. */ 329 int scanIterations; 330 /** Scan network list. */ 331 struct PnoNetwork[] pnoNetworks; 332}; 333 334/** 335 * @brief Defines signal poll information. 336 * 337 * @since 4.0 338 * @version 1.1 339 */ 340struct SignalPollResult { 341 /** Rssi value in dBM. */ 342 int currentRssi; 343 /** Association frequency in MHz. */ 344 int associatedFreq; 345 /** Transmission bit rate in Mbps. */ 346 int txBitrate; 347 /** Received bit rate in Mbps. */ 348 int rxBitrate; 349 /** Noise value in dBM. */ 350 int currentNoise; 351 /** Snr value in dB. */ 352 int currentSnr; 353 /** Current channel load. */ 354 int currentChload; 355 /** Uldelay value in ms. */ 356 int currentUlDelay; 357 /** TxBytes value. */ 358 int currentTxBytes; 359 /** RxBytes value. */ 360 int currentRxBytes; 361 /** TxFailed value. */ 362 int currentTxFailed; 363 /** TxPackets value. */ 364 int currentTxPackets; 365 /** RxPackets value. */ 366 int currentRxPackets; 367}; 368/** @} */