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 IConcreteChip.idl 31 * 32 * @brief Provides APIs to concrete the chip, get the specific chip information. 33 * 34 * @since 5.0 35 * @version 1.0 36 */ 37 38/** 39 * @brief Defines the package path of the chip module interface. 40 * 41 * @since 5.0 42 * @version 1.0 43 */ 44 45package ohos.hdi.wlan.chip.v1_0; 46 47import ohos.hdi.wlan.chip.v1_0.ChipTypes; 48import ohos.hdi.wlan.chip.v1_0.IChipIface; 49import ohos.hdi.wlan.chip.v1_0.IConcreteChipCallback; 50 51interface IConcreteChip { 52 /** 53 * @brief Obtains the id of the service. 54 * 55 * @param id Indicates the chip id. 56 * 57 * @return Returns <b>0</b> if the operation is successful. 58 * @return Returns a negative value if the operation fails. 59 * 60 * @since 5.0 61 * @version 1.0 62 */ 63 GetChipId([out] int id); 64 65 /** 66 * @brief Registers the callback information of the corresponding chip service. 67 * 68 * @param chipEventcallback Indicates the event callback of chip service. 69 * 70 * @return Returns <b>0</b> if the operation is successful. 71 * @return Returns a negative value if the operation fails. 72 * 73 * @since 5.0 74 * @version 1.0 75 */ 76 RegisterChipEventCallback([in] IConcreteChipCallback chipEventcallback); 77 78 /** 79 * @brief Obtains the modes supported by the chip. 80 * 81 * @param modes Indicates supported mode of the chip. 82 * 83 * @return Returns <b>0</b> if the operation is successful. 84 * @return Returns a negative value if the operation fails. 85 * 86 * @since 5.0 87 * @version 1.0 88 */ 89 GetChipModes([out] struct UsableMode[] modes); 90 91 /** 92 * @brief Get chip capabilities from wifi driver. 93 * 94 * @param capabilities Indicates the chip capabilities. 95 * 96 * @return Returns <b>0</b> if the operation is successful. 97 * @return Returns a negative value if the operation fails. 98 * 99 * @since 5.0 100 * @version 1.0 101 */ 102 GetChipCaps([out] unsigned int capabilities); 103 104 /** 105 * @brief Obtains the mode of the chip id. 106 * 107 * @param modeId Indicates the mode of the current chip id. 108 * 109 * @return Returns <b>0</b> if the operation is successful. 110 * @return Returns a negative value if the operation fails. 111 * 112 * @since 5.0 113 * @version 1.0 114 */ 115 GetCurrentMode([out] unsigned int modeId); 116 117 /** 118 * @brief Creates the Ap interface service. 119 * 120 * @param iface Indicates Ap interface service object. 121 * 122 * @return Returns <b>0</b> if the operation is successful. 123 * @return Returns a negative value if the operation fails. 124 * 125 * @since 5.0 126 * @version 1.0 127 */ 128 CreateApService([out] IChipIface iface); 129 130 /** 131 * @brief Obtains the name of the Ap interface. 132 * 133 * @param ifnames Indicates Ap interface name. 134 * 135 * @return Returns <b>0</b> if the operation is successful. 136 * @return Returns a negative value if the operation fails. 137 * 138 * @since 5.0 139 * @version 1.0 140 */ 141 GetApServiceIfNames([out] String[] ifnames); 142 143 /** 144 * @brief Obtains the service of the Ap interface. 145 * 146 * @param ifnames Indicates Ap interface name. 147 * @param iface Indicates the Ap interface service object. 148 * 149 * @return Returns <b>0</b> if the operation is successful. 150 * @return Returns a negative value if the operation fails. 151 * 152 * @since 5.0 153 * @version 1.0 154 */ 155 GetApService([in] String ifname, [out] IChipIface iface); 156 157 /** 158 * @brief Deletes the service of the Ap interface. 159 * 160 * @param ifnames Indicates Ap interface name. 161 * 162 * @return Returns <b>0</b> if the operation is successful. 163 * @return Returns a negative value if the operation fails. 164 * 165 * @since 5.0 166 * @version 1.0 167 */ 168 RemoveApService([in] String ifname); 169 170 /** 171 * @brief Creates the P2p interface service. 172 * 173 * @param iface Indicates P2p interface service object. 174 * 175 * @return Returns <b>0</b> if the operation is successful. 176 * @return Returns a negative value if the operation fails. 177 * 178 * @since 5.0 179 * @version 1.0 180 */ 181 CreateP2pService([out] IChipIface iface); 182 183 /** 184 * @brief Obtains the name of the P2p interface. 185 * 186 * @param ifnames Indicates P2p interface name. 187 * 188 * @return Returns <b>0</b> if the operation is successful. 189 * @return Returns a negative value if the operation fails. 190 * 191 * @since 5.0 192 * @version 1.0 193 */ 194 GetP2pServiceIfNames([out] String[] ifnames); 195 196 /** 197 * @brief Obtains the service of the P2p interface. 198 * 199 * @param ifnames Indicates P2p interface name. 200 * @param iface Indicates the P2p interface service object. 201 * 202 * @return Returns <b>0</b> if the operation is successful. 203 * @return Returns a negative value if the operation fails. 204 * 205 * @since 5.0 206 * @version 1.0 207 */ 208 GetP2pService([in] String ifname, [out] IChipIface iface); 209 210 /** 211 * @brief Deletes the service of the P2p interface. 212 * 213 * @param ifnames Indicates P2p interface name. 214 * 215 * @return Returns <b>0</b> if the operation is successful. 216 * @return Returns a negative value if the operation fails. 217 * 218 * @since 5.0 219 * @version 1.0 220 */ 221 RemoveP2pService([in] String ifname); 222 223 /** 224 * @brief Creates the Sta interface service. 225 * 226 * @param iface Indicates Sta interface service object. 227 * 228 * @return Returns <b>0</b> if the operation is successful. 229 * @return Returns a negative value if the operation fails. 230 * 231 * @since 5.0 232 * @version 1.0 233 */ 234 CreateStaService([out] IChipIface iface); 235 236 /** 237 * @brief Obtains the name of the Sta interface. 238 * 239 * @param ifnames Indicates Sta interface name. 240 * 241 * @return Returns <b>0</b> if the operation is successful. 242 * @return Returns a negative value if the operation fails. 243 * 244 * @since 5.0 245 * @version 1.0 246 */ 247 GetStaServiceIfNames([out] String[] ifnames); 248 249 /** 250 * @brief Obtains the service of the Sta interface. 251 * 252 * @param ifnames Indicates Sta interface name. 253 * @param iface Indicates the Sta interface service object. 254 * 255 * @return Returns <b>0</b> if the operation is successful. 256 * @return Returns a negative value if the operation fails. 257 * 258 * @since 5.0 259 * @version 1.0 260 */ 261 GetStaService([in] String ifname, [out] IChipIface iface); 262 263 /** 264 * @brief Deletes the service of the Sta interface. 265 * 266 * @param ifnames Indicates Sta interface name. 267 * 268 * @return Returns <b>0</b> if the operation is successful. 269 * @return Returns a negative value if the operation fails. 270 * 271 * @since 5.0 272 * @version 1.0 273 */ 274 RemoveStaService([in] String ifname); 275 276 /** 277 * @brief Sets the mode id of chip. 278 * 279 * @param modeId Indicates the id of different mode. 280 * 281 * @return Returns <b>0</b> if the operation is successful. 282 * @return Returns a negative value if the operation fails. 283 * 284 * @since 5.0 285 * @version 1.0 286 */ 287 SetChipMode([in] unsigned int modeId); 288}; 289/** @} */