1 /* 2 * Copyright (C) 2021 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 #ifndef OHOS_WIFI_P2P_EVENT_CALLBACK_H 17 #define OHOS_WIFI_P2P_EVENT_CALLBACK_H 18 19 #include <functional> 20 #include <string> 21 #include "wifi_native_struct.h" 22 23 namespace OHOS { 24 namespace Wifi { 25 struct P2pHalCallback { 26 std::function<void(int)> onConnectSupplicant; 27 std::function<void(const HalP2pDeviceFound &)> onDeviceFound; 28 std::function<void(const std::string &)> onDeviceLost; 29 std::function<void(const std::string &, short)> onGoNegotiationRequest; 30 std::function<void(void)> onGoNegotiationSuccess; 31 std::function<void(int)> onGoNegotiationFailure; 32 std::function<void(const HalP2pInvitationInfo &)> onInvitationReceived; 33 std::function<void(const std::string &, int)> onInvitationResult; 34 std::function<void(void)> onGroupFormationSuccess; 35 std::function<void(const std::string &)> onGroupFormationFailure; 36 std::function<void(const HalP2pGroupInfo &)> onGroupStarted; 37 std::function<void(const std::string &, bool)> onGroupRemoved; 38 std::function<void(const std::string &)> onProvisionDiscoveryPbcRequest; 39 std::function<void(const std::string &)> onProvisionDiscoveryPbcResponse; 40 std::function<void(const std::string &)> onProvisionDiscoveryEnterPin; 41 std::function<void(const std::string &, const std::string &)> onProvisionDiscoveryShowPin; 42 std::function<void(void)> onProvisionDiscoveryFailure; 43 std::function<void(void)> onFindStopped; 44 std::function<void(const std::string &, short, const std::vector<unsigned char> &)> onServiceDiscoveryResponse; 45 std::function<void(const std::string &)> onStaDeauthorized; 46 std::function<void(const std::string &, const std::string &)> onStaAuthorized; 47 std::function<void(void)> connectSupplicantFailed; 48 std::function<void(const HalP2pServDiscReqInfo &)> onP2pServDiscReq; 49 std::function<void(const std::string &, int)> onP2pIfaceCreated; 50 std::function<void(const std::string &, int)> onP2pConnectFailed; 51 std::function<void(int)> onP2pChannelSwitch; 52 std::function<void(const std::string &)> onEventStaNotify; 53 }; 54 } // namespace Wifi 55 } // namespace OHOS 56 57 #endif 58