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 #ifndef OHOS_P2P_TEMP_DISC_EVENT_H 16 #define OHOS_P2P_TEMP_DISC_EVENT_H 17 18 #include "wifi_p2p_msg.h" 19 20 namespace OHOS { 21 namespace Wifi { 22 enum class DiscEvent { 23 UNKNOWN = 0, 24 PBC_REQ = 1, 25 PBC_RESP = 2, 26 ENTER_PIN = 3, 27 SHOW_PIN = 4, 28 }; 29 class WifiP2pTempDiscEvent { 30 public: 31 /** 32 * @Description Construct a new WifiP2pTempDiscEvent object. 33 * 34 */ 35 WifiP2pTempDiscEvent(); 36 /** 37 * @Description Destroy the WifiP2pTempDiscEvent object. 38 * 39 */ 40 ~WifiP2pTempDiscEvent() = default; 41 /** 42 * @Description Set the event object. 43 * 44 * @param setEvent discovered setEvent 45 */ 46 void SetDiscEvent(DiscEvent setEvent); 47 /** 48 * @Description Get the event object. 49 * 50 * @return DiscEvent 51 */ 52 DiscEvent GetDiscEvent() const; 53 /** 54 * @Description Set the device object. 55 * 56 * @param setDevice setDevice information 57 */ 58 void SetDevice(const WifiP2pDevice &setDevice); 59 /** 60 * @Description Get the device object. 61 * 62 * @return const WifiP2pDevice& device 63 */ 64 const WifiP2pDevice &GetDevice() const; 65 /** 66 * @Description Set the pin object. 67 * 68 * @param setPin the string of setPin 69 */ 70 void SetPin(std::string setPin); 71 /** 72 * @Description Get the pin object. 73 * 74 * @return const std::string& pin 75 */ 76 const std::string &GetPin() const; 77 78 private: 79 DiscEvent event; 80 WifiP2pDevice device; 81 std::string pin; 82 }; /* class WifiP2pTempDiscEvent */ 83 } // namespace Wifi 84 } // namespace OHOS 85 86 #endif /* OHOS_P2P_TEMP_DISC_EVENT_H */