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_DISABLED_STATE_H 16 #define OHOS_P2P_DISABLED_STATE_H 17 18 #include "state.h" 19 #include "p2p_macro.h" 20 #include "wifi_p2p_group_manager.h" 21 #include "wifi_p2p_device_manager.h" 22 #include "wifi_p2p_service_manager.h" 23 24 namespace OHOS { 25 namespace Wifi { 26 class P2pStateMachine; 27 class P2pDisabledState : public State { 28 FRIEND_GTEST(P2pDisabledState); 29 30 public: 31 /** 32 * @Description Construct a new P2pDisabledState object 33 * @param None 34 * @return None 35 */ 36 P2pDisabledState(P2pStateMachine &, WifiP2pGroupManager &, WifiP2pDeviceManager &, WifiP2pServiceManager &); 37 38 /** 39 * @Description Destroy the P2pDisabledState object 40 * @param None 41 * @return None 42 */ 43 ~P2pDisabledState() = default; 44 45 /** 46 * @Description - Called when entering state 47 * @param None 48 * @return None 49 */ 50 virtual void GoInState() override; 51 52 /** 53 * @Description - Called when exiting state 54 * @param None 55 * @return None 56 */ 57 virtual void GoOutState() override; 58 59 /** 60 * @Description - Message Processing Function 61 * @param msg - Message object pointer 62 * @return - bool true:success false:fail 63 */ 64 virtual bool ExecuteStateMsg(InternalMessagePtr msg) override; 65 66 private: 67 virtual void SetVendorFeatures() const; 68 69 private: 70 P2pStateMachine &p2pStateMachine; 71 WifiP2pGroupManager &groupManager; 72 WifiP2pDeviceManager &deviceManager; 73 WifiP2pServiceManager &serviceManager; 74 bool p2pSmInitFlag; 75 }; 76 } // namespace Wifi 77 } // namespace OHOS 78 79 #endif /* OHOS_P2P_DISABLED_STATE_H */ 80