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.
24 *
25 * @since 5.0
26 * @version 1.0
27 */
28
29/**
30 * @file IChipController.idl
31 *
32 * @brief Provides APIs to controller the wifi chip, register wifi event callback, init or release wifi chip, get available chips
33 * and get the wifi chip service.
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
48import ohos.hdi.wlan.chip.v1_0.ChipTypes;
49import ohos.hdi.wlan.chip.v1_0.IChipControllerCallback;
50import ohos.hdi.wlan.chip.v1_0.IConcreteChip;
51
52interface IChipController {
53    /**
54     * @brief Registers wifi event callback messages.
55     *
56     * @param eventCallback Indicates the register callback messages.
57     *
58     * @return Returns <b>0</b> if the operation is successful.
59     * @return Returns a negative value if the operation fails.
60     *
61     * @since 5.0
62     * @version 1.0
63     */
64    RegisterWifiEventCallback([in] IChipControllerCallback eventCallback);
65
66    /**
67     * @brief Checkes if the hdi service is inited.
68     *
69     * @param started Indicates if the hdi service is inited.
70     *
71     * @return Returns <b>0</b> if the operation is successful.
72     * @return Returns a negative value if the operation fails.
73     *
74     * @since 5.0
75     * @version 1.0
76     */
77    IsInit([out] boolean inited);
78
79    /**
80     * @brief Inites the wifi hdi service.
81     *
82     * @return Returns <b>0</b> if the operation is successful.
83     * @return Returns a negative value if the operation fails.
84     *
85     * @since 5.0
86     * @version 1.0
87     */
88    Init();
89
90    /**
91     * @brief Releases the wifi hdi service.
92     *
93     * @return Returns <b>0</b> if the operation is successful.
94     * @return Returns a negative value if the operation fails.
95     *
96     * @since 5.0
97     * @version 1.0
98     */
99    Release();
100
101    /**
102     * @brief Obtains the id of chips.
103     *
104     * @param chipIds Indicates the id of chips.
105     *
106     * @return Returns <b>0</b> if the operation is successful.
107     * @return Returns a negative value if the operation fails.
108     *
109     * @since 5.0
110     * @version 1.0
111     */
112    GetAvailableChips([out] unsigned int[] chipIds);
113
114    /**
115     * @brief Obtains the chip service corresponding to the chip id.
116     *
117     * @param chipId Indicates the id of the chip.
118     * @param chip Indicates the chip service object of the chip id.
119     *
120     * @return Returns <b>0</b> if the operation is successful.
121     * @return Returns a negative value if the operation fails.
122     *
123     * @since 5.0
124     * @version 1.0
125     */
126    GetChipService([in] unsigned int chipId, [out] IConcreteChip chip);
127};
128/** @} */