• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2024 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 CHIP
18 * @{
19 *
20 * @brief Provides APIs for the upper-layer WLAN service.
21 *
22 * You can use the APIs to manager the wifi chip, init and release the wifi chip, create and remove iface, register callback
23 * get the name and type of the iface, get the support frequencies and set the mode of chip. The interface of the current path
24 * is used perferentially. The interface of the wlan/v1_0, wlan/v1_1, wlan/v1_2 path will be distributed later.
25 *
26 * @since 5.0
27 * @version 1.0
28 */
29
30/**
31 * @file ChipTypes.idl
32 *
33 * @brief Provides the enumerated variables, structures in CHIP APIs.
34 *
35 * @since 5.0
36 * @version 1.0
37 */
38
39/**
40 * @brief Defines the package path of the chip module interface.
41 *
42 * @since 5.0
43 * @version 1.0
44 */
45
46package ohos.hdi.wlan.chip.v1_0;
47
48/**
49 * @brief Enumerates the code of status.
50 *
51 * @since 5.0
52 * @version 1.0
53 */
54enum ErrorCode : int{
55    SUCCESS,
56    INVALID_CHIP,
57    INVALID_IFACE,
58    UNSUPPORTED,
59    UNAVAILABLE,
60    NOT_INITED,
61    UNKNOWN
62};
63
64/**
65 * @brief Enumerates the types of the interface.
66 *
67 * @since 5.0
68 * @version 1.0
69 */
70enum IfaceType : unsigned int {
71    STA,
72    AP,
73    P2P,
74    NANIFACE
75};
76
77/**
78 * @brief Defines the limitations of the interface.
79 *
80 * @since 5.0
81 * @version 1.0
82 */
83struct IfaceLimit {
84    enum IfaceType[] types;
85    unsigned int ifaceNum;
86};
87
88/**
89 * @brief Defines the usable interface of the chip.
90 *
91 * @since 5.0
92 * @version 1.0
93 */
94struct ComboIface {
95    struct IfaceLimit[] limits;
96};
97
98/**
99 * @brief Defines the usable mode of the chip.
100 *
101 * @since 5.0
102 * @version 1.0
103 */
104struct UsableMode {
105    unsigned int modeId;
106    struct ComboIface[] usableCombo;
107};
108
109/**
110 * @brief Defines the scan param.
111 *
112 * @since 5.0
113 * @version 1.0
114 */
115struct ScanParams {
116    String[] ssids;
117    int[] freqs;
118    String extraIes;
119    String bssid;
120    unsigned char prefixSsidScanFlag;
121    unsigned char fastConnectFlag;
122};
123
124/**
125 * @brief Defines the scan result info, This interface is preferentially used to communicate with the Wi-Fi service.
126 *
127 * @since 5.0
128 * @version 1.0
129 */
130struct ScanResultsInfo {
131    unsigned int flags;
132    unsigned char[] bssid;
133    unsigned short caps;
134    unsigned int freq;
135    unsigned short beaconInterval;
136    int qual;
137    int level;
138    unsigned int age;
139    unsigned long tsf;
140    unsigned char[] variable;
141    unsigned char[] ie;
142    unsigned char[] beaconIe;
143};
144
145/**
146 * @brief Defines the pno scan info.
147 *
148 * @since 5.0
149 * @version 1.0
150 */
151struct PnoScanParams {
152    int min2gRssi;
153    int min5gRssi;
154    int scanIntervalMs;
155    int scanIterations;
156    String[] hiddenssids;
157    String[] savedssids;
158    int[] freqs;
159};
160
161/**
162 * @brief Defines the signal info, This interface is preferentially used to communicate with the Wi-Fi service.
163 *
164 * @since 5.0
165 * @version 1.0
166 */
167struct SignalPollResult {
168    int currentRssi;
169    int associatedFreq;
170    int txBitrate;
171    int rxBitrate;
172    int currentNoise;
173    int currentSnr;
174    int currentChload;
175    int currentUlDelay;
176    int currentTxBytes;
177    int currentRxBytes;
178    int currentTxFailed;
179    int currentTxPackets;
180    int currentRxPackets;
181    unsigned short chloadSelf;
182    int c0Rssi;
183    int c1Rssi;
184    unsigned char[] ext;
185};
186/** @} */