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