1 /* 2 * Copyright (C) 2023-2023 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_SELF_CURE_SERVICE_H 17 #define OHOS_WIFI_SELF_CURE_SERVICE_H 18 19 #include "wifi_errcode.h" 20 #include "wifi_msg.h" 21 #include "self_cure_service_callback.h" 22 #include "ip2p_service_callbacks.h" 23 #include "sta_service_callback.h" 24 25 namespace OHOS { 26 namespace Wifi { 27 class ISelfCureService { 28 public: 29 virtual ~ISelfCureService() = default; 30 /** 31 * @Description Register self cure callback function. 32 * 33 * @param callbacks - Callback function pointer storage structure 34 * @return ErrCode - success: WIFI_OPT_SUCCESS fail: WIFI_OPT_FAILED 35 */ 36 virtual ErrCode RegisterSelfCureServiceCallback(const SelfCureServiceCallback &callbacks) = 0; 37 /** 38 * @Description self cure service initialization function. 39 * 40 * @return ErrCode - success: WIFI_OPT_SUCCESS, failed: WIFI_OPT_FAILED 41 */ 42 virtual ErrCode InitSelfCureService() = 0; 43 44 /** 45 * @Description Get register sta callback 46 * 47 * @return StaServiceCallback - sta callback 48 */ 49 virtual StaServiceCallback GetStaCallback() const = 0; 50 51 /** 52 * @Description Notify Internet Failure Detected 53 * 54 * @return ErrCode - success: WIFI_OPT_SUCCESS, failed: WIFI_OPT_FAILED 55 */ 56 virtual ErrCode NotifyInternetFailureDetected(int forceNoHttpCheck) = 0; 57 58 /** 59 * @Description Is SelfCure On Going 60 * 61 * @return bool - true: selfcure is ongoing, false: selfcure is not ongoing 62 */ 63 virtual bool IsSelfCureOnGoing() = 0; 64 65 /** 66 * @Description Deal sta opened result 67 * 68 * @param instId - instance Id 69 */ 70 virtual void DealStaOpened(int instId) = 0; 71 }; 72 } // namespace Wifi 73 } // namespace OHOS 74 #endif 75