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_STA_MONITOR_H 16 #define OHOS_STA_MONITOR_H 17 18 #include "sta_state_machine.h" 19 20 namespace OHOS { 21 namespace Wifi { 22 class StaMonitor { 23 FRIEND_GTEST(StaMonitor); 24 public: 25 /** 26 * @Description : Construct a new Sta Monitor object. 27 * 28 */ 29 StaMonitor(); 30 31 /** 32 * @Description Destroy the Sta Monitor object. 33 * 34 */ 35 virtual ~StaMonitor(); 36 37 /** 38 * @Description : Initialize the sta monitor. 39 * 40 */ 41 ErrCode InitStaMonitor(); 42 43 /** 44 * @Description : Uninitialize the sta monitor. 45 * 46 */ 47 ErrCode UnInitStaMonitor() const; 48 49 /** 50 * @Description : Generating a Sta State Machine Instance. 51 * 52 * @param paraStaStateMachine - a Sta State Machine Instance [in] 53 */ 54 void SetStateMachine(StaStateMachine *paraStaStateMachine); 55 56 /** 57 * @Description : Callback of the connection state change event. 58 * 59 * @param status : status codes [in] 60 * @param networkId - network id [in] 61 * @param bssid - bssid of the network [in] 62 */ 63 void OnConnectChangedCallBack(int status, int networkId,const std::string &bssid); 64 65 /** 66 * @Description : Callback of the connection state change event. 67 * 68 * @param reason : reason for bssid change [in] 69 * @param bssid: bssid of the network [in] 70 */ 71 void OnBssidChangedCallBack(const std::string &reason, const std::string &bssid); 72 73 /** 74 * @Description : Callback of the wpa state change event. 75 * 76 * @param status - status codes [in] 77 */ 78 void OnWpaStateChangedCallBack(int status); 79 80 /** 81 * @Description : Callback of the Wpa ssid wrong key event. 82 * 83 * @param status - status codes [in] 84 */ 85 void OnWpaSsidWrongKeyCallBack(int status); 86 87 /** 88 * @Description : Callback of the Connection Full event. 89 * 90 * @param status - status codes [in] 91 */ 92 void onWpaConnectionFullCallBack(int status); 93 94 /** 95 * @Description : Callback of the Connection Refused event. 96 * 97 * @param status - status codes [in] 98 */ 99 void onWpaConnectionRejectCallBack(int status); 100 101 /** 102 * @Description : Callback of the WPS_OVERLAP event. 103 * 104 * @param status - status codes [in] 105 */ 106 void OnWpsPbcOverlapCallBack(int status); 107 108 /** 109 * @Description : Callback of the WPS_TIMEOUT event. 110 * 111 * @param status - status codes [in] 112 */ 113 void OnWpsTimeOutCallBack(int status); 114 115 private: 116 StaStateMachine *pStaStateMachine; 117 }; 118 } // namespace Wifi 119 } // namespace OHOS 120 #endif