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 Wpa 18 * @{ 19 * 20 * @brief Defines 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 IWpaCallback.idl 31 * 32 * @brief Provides callbacks to be invoked when the wpa supplicant is restarted, the scan result is returned, 33 * and a Netlink message is received. 34 * 35 * @since 3.2 36 * @version 1.0 37 */ 38 39/** 40 * @brief Defines the package path of the WLAN module interface. 41 * 42 * @since 3.2 43 * @version 1.0 44 */ 45package ohos.hdi.wlan.wpa.v1_0; 46 47import ohos.hdi.wlan.wpa.v1_0.WpaTypes; 48 49/** 50 * @brief Defines the callbacks of the Wpa module. 51 * 52 * The callback is invoked to continue the subsequent processing when the wpa supplicant restarts, hotspot scan ends, 53 * or a Netlink message is received. 54 * 55 * @since 4.1 56 * @version 1.0 57 */ 58[callback] interface IWpaCallback { 59 /** 60 * Used to indicate the disconnection from the currently connected 61 * network on this iface. 62 * 63 * @param disconnectParam Indicates the paramerter of Disconnect 64 * @param ifName Indicates the NIC name. 65 * 66 * @since 4.1 67 * @version 1.0 68 */ 69 OnEventDisconnected([in] struct HdiWpaDisconnectParam disconnectParam, [in] String ifName); 70 71 /** 72 * Used to indicate the Connection from the currently connected 73 * network on this iface. 74 * 75 * @param disconnectParam Indicates the paramerter of Connect 76 * @param ifName Indicates the NIC name. 77 * 78 * @since 4.1 79 * @version 1.0 80 */ 81 OnEventConnected([in] struct HdiWpaConnectParam connectParam, [in] String ifName); 82 83 /** 84 * Used to indicate the BssidChanged from the currently BssidChanged 85 * network on this iface. 86 * 87 * @param disconnectParam Indicates the paramerter of BssidChanged 88 * @param ifName Indicates the NIC name. 89 * 90 * @since 4.1 91 * @version 1.0 92 */ 93 OnEventBssidChanged([in] struct HdiWpaBssidChangedParam bssidChangedParam, [in] String ifName); 94 95 /** 96 * Used to indicate the Wpa State Changed from the currently State Changed 97 * network on this iface. 98 * 99 * @param disconnectParam Indicates the paramerter of BssidChanged 100 * @param ifName Indicates the NIC name. 101 * 102 * @since 4.1 103 * @version 1.0 104 */ 105 OnEventStateChanged([in] struct HdiWpaStateChangedParam statechangedParam, [in] String ifName); 106 107 /** 108 * Used to indicate the TempDisabled from the currently wifi TempDisabled 109 * network on this iface. 110 * 111 * @param disconnectParam Indicates the paramerter of TempDisabled 112 * @param ifName Indicates the NIC name. 113 * 114 * @since 4.1 115 * @version 1.0 116 */ 117 OnEventTempDisabled([in] struct HdiWpaTempDisabledParam tempDisabledParam, [in] String ifName); 118 119 /** 120 * Used to indicate the AssociateReject from the currently wifi AssociateReject 121 * network on this iface. 122 * 123 * @param disconnectParam Indicates the paramerter of AssociateReject 124 * @param ifName Indicates the NIC name. 125 * 126 * @since 4.1 127 * @version 1.0 128 */ 129 OnEventAssociateReject([in] struct HdiWpaAssociateRejectParam associateRejectParam, [in] String ifName); 130 131 /** 132 * Used to indicate the overlap of a WPS PBC connection attempt from the currently wifi 133 * network on this iface. 134 * 135 * @param ifName Indicates the NIC name. 136 * 137 * @since 4.1 138 * @version 1.0 139 */ 140 OnEventWpsOverlap([in] String ifName); 141 142 /** 143 * Used to indicate the timeout of a PBC connection attempt from the currently wifi 144 * network on this iface. 145 * 146 * @param ifName Indicates the NIC name. 147 * 148 * @since 4.1 149 * @version 1.0 150 */ 151 OnEventWpsTimeout([in] String ifName); 152 153 /** 154 * Used to indicate the timeout of a PBC connection attempt from the currently wifi 155 * network on this iface. 156 * 157 * @param ifName Indicates the NIC name. 158 * 159 * @since 4.1 160 * @version 1.0 161 */ 162 OnEventScanResult([in] HdiWpaRecvScanResultParam recvScanResultParam, [in] String ifName); 163 /** 164 * Used to indicate that a P2P device has been found. 165 * 166 * @param deviceInfoParam Indicates the paramerter of device found 167 * @param ifName Indicates the NIC name. 168 * 169 * @since 4.1 170 * @version 1.0 171 */ 172 OnEventDeviceFound([in] struct HdiP2pDeviceInfoParam deviceInfoParam, [in] String ifName); 173 174 /** 175 * Used to indicate that a P2P device has been lost. 176 * 177 * @param deviceLostParam Indicates the paramerter of device Lost 178 * @param ifName Indicates the NIC name. 179 * 180 * @since 4.1 181 * @version 1.0 182 */ 183 OnEventDeviceLost([in] struct HdiP2pDeviceLostParam deviceLostParam, [in] String ifName); 184 185 /** 186 * Used to indicate the reception of a P2P Group Owner negotiation request. 187 * 188 * @param goNegotiationRequestParam MAC address of the device that initiated the GO 189 * negotiation request. 190 * @param ifName Indicates the NIC name. 191 * 192 * @since 4.1 193 * @version 1.0 194 */ 195 OnEventGoNegotiationRequest([in] struct HdiP2pGoNegotiationRequestParam goNegotiationRequestParam, 196 [in] String ifName); 197 198 /** 199 * Used to indicate the completion of a P2P Group Owner negotiation request. 200 * 201 * @param goNegotiationCompletedParam Status of the GO negotiation. 202 * @param ifName Indicates the NIC name. 203 * 204 * @since 4.1 205 * @version 1.0 206 */ 207 OnEventGoNegotiationCompleted([in] struct HdiP2pGoNegotiationCompletedParam goNegotiationCompletedParam, 208 [in] String ifName); 209 210 /** 211 * Used to indicate the reception of a P2P invitation. 212 * 213 * @param invitationReceivedParam Indicates the paramerter of invitation ReceivedParam. 214 * @param ifName Indicates the NIC name. 215 * 216 * @since 4.1 217 * @version 1.0 218 */ 219 OnEventInvitationReceived([in] struct HdiP2pInvitationReceivedParam invitationReceivedParam, 220 [in] String ifName); 221 222 /** 223 * Used to indicate the result of the P2P invitation request. 224 * 225 * @param invitationResultParam Indicates the paramerter of Invitation Result. 226 * @param ifName Indicates the NIC name. 227 * 228 * @since 4.1 229 * @version 1.0 230 */ 231 OnEventInvitationResult([in] struct HdiP2pInvitationResultParam invitationResultParam, 232 [in] String ifName); 233 234 /** 235 * Used to indicate a successful formation of a P2P group. 236 * 237 * @param ifName Indicates the NIC name. 238 * 239 * @since 4.1 240 * @version 1.0 241 */ 242 OnEventGroupFormationSuccess([in] String ifName); 243 244 /** 245 * Used to indicate a failure to form a P2P group. 246 * 247 * @param reason Indicates the reason of Group Formation Failure. 248 * @param ifName Indicates the NIC name. 249 * 250 * @since 4.1 251 * @version 1.0 252 */ 253 OnEventGroupFormationFailure([in] String reason, [in] String ifName); 254 255 /** 256 * Used to indicate the start of a P2P group. 257 * 258 * @param groupStartedParam Indicates the paramerter of Group Started. 259 * @param ifName Indicates the NIC name. 260 * 261 * @since 4.1 262 * @version 1.0 263 */ 264 OnEventGroupStarted([in] struct HdiP2pGroupStartedParam groupStartedParam, [in] String ifName); 265 266 /** 267 * Used to indicate the removal of a P2P group. 268 * 269 * @param groupRemovedParam Indicates the paramerter of Group Removed. 270 * @param ifName Indicates the NIC name. 271 * 272 * @since 4.1 273 * @version 1.0 274 */ 275 OnEventGroupRemoved([in] struct HdiP2pGroupRemovedParam groupRemovedParam, [in] String ifName); 276 277 /** 278 * Used to indicate the completion of a P2P provision discovery request. 279 * 280 * @param provisionDiscoveryCompletedParam Indicates the paramerter of Provision Discovery Completed. 281 * @param ifName Indicates the NIC name. 282 * 283 * @since 4.1 284 * @version 1.0 285 */ 286 OnEventProvisionDiscoveryCompleted([in] struct HdiP2pProvisionDiscoveryCompletedParam 287 provisionDiscoveryCompletedParam, [in] String ifName); 288 289 /** 290 * Used to indicate the termination of P2P find operation. 291 * 292 * @param ifName Indicates the NIC name. 293 * 294 * @since 4.1 295 * @version 1.0 296 */ 297 OnEventFindStopped([in] String ifName); 298 299 /** 300 * Used to indicate the request of a P2P service discovery. 301 * 302 * @param servDiscReqInfoParam Indicates the paramerter of Service Discovery request. 303 * @param ifName Indicates the NIC name. 304 * 305 * @since 4.1 306 * @version 1.0 307 */ 308 OnEventServDiscReq([in] struct HdiP2pServDiscReqInfoParam servDiscReqInfoParam, [in] String ifName); 309 310 /** 311 * Used to indicate the reception of a P2P service discovery response. 312 * 313 * @param servDiscRespParam Indicates the paramerter of Service Discovery Resp. 314 * @param ifName Indicates the NIC name. 315 * 316 * @since 4.1 317 * @version 1.0 318 */ 319 OnEventServDiscResp([in] struct HdiP2pServDiscRespParam servDiscRespParam, [in] String ifName); 320 321 /** 322 * Used to indicate when a STA device is connected or disconnected to this device. 323 * 324 * @param staConnectStateParam Indicates the paramerter of Sta Connect State. 325 * @param ifName Indicates the NIC name. 326 * 327 * @since 4.1 328 * @version 1.0 329 */ 330 OnEventStaConnectState([in] struct HdiP2pStaConnectStateParam staConnectStateParam, [in] String ifName); 331 332 /** 333 * Used to indicate when a Iface was created. 334 * 335 * @param ifaceCreatedParam Indicates the paramerter of Iface Created. 336 * @param ifName Indicates the NIC name. 337 * 338 * @since 4.1 339 * @version 1.0 340 */ 341 OnEventIfaceCreated([in] struct HdiP2pIfaceCreatedParam ifaceCreatedParam, [in] String ifName); 342 343 /** 344 * Used to indicate STA authentication reject 345 * 346 * @param authRejectParam Indicates the paramerter of auth reject. 347 * @param ifName Indicates the NIC name. 348 * 349 * @since 4.1 350 * @version 1.0 351 */ 352 OnEventAuthReject([in] struct HdiWpaAuthRejectParam authRejectParam, [in] String ifName); 353 354 /** 355 * Used to handle STA callback parameters 356 * 357 * @param notifyParam Indicates the paramerter of Sta. 358 * @param cmd Indicates command of Sta from WifiHal. 359 * 360 * @since 4.1 361 * @version 1.0 362 */ 363 OnEventStaNotify([in] String notifyParam, [in] String ifName); 364 365 /** 366 * Used to Reporting WPA Information 367 * 368 * @param wpaMsgForCbInfo Parameters for reporting WPA information 369 * @param ifName Indicates the NIC name. 370 * 371 * @since 4.1 372 * @version 1.0 373 */ 374 OnEventVendorCb([in] WpaVendorInfo wpaVendorInfo, [in] String ifName); 375}