1 /* 2 * Copyright (C) 2021-2022 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_IAP_SERVICE_H 16 #define OHOS_IAP_SERVICE_H 17 18 #include "wifi_errcode.h" 19 #include "wifi_msg.h" 20 #include "i_ap_service_callbacks.h" 21 22 namespace OHOS { 23 namespace Wifi { 24 class IApService { 25 public: 26 /** 27 * @DescriptionDestroy the IApService object. 28 * 29 */ 30 virtual ~IApService() = default; 31 virtual ErrCode EnableHotspot() = 0; 32 virtual ErrCode DisableHotspot() = 0; 33 virtual ErrCode AddBlockList(const StationInfo &stationInfo) = 0; 34 virtual ErrCode DelBlockList(const StationInfo &stationInfo) = 0; 35 virtual ErrCode SetHotspotConfig(const HotspotConfig &hotspotConfig) = 0; 36 virtual ErrCode DisconnetStation(const StationInfo &stationInfo) = 0; 37 virtual ErrCode GetStationList(std::vector<StationInfo> &result) = 0; 38 virtual ErrCode GetValidBands(std::vector<BandType> &bands) = 0; 39 virtual ErrCode GetValidChannels(BandType band, std::vector<int32_t> &validChannel) = 0; 40 virtual ErrCode GetSupportedPowerModel(std::set<PowerModel>& setPowerModelList) = 0; 41 virtual ErrCode GetPowerModel(PowerModel& model) = 0; 42 virtual ErrCode SetPowerModel(const PowerModel& model) = 0; 43 virtual ErrCode SetHotspotIdleTimeout(int time) = 0; 44 45 /** 46 * @Description - Registers all callbacks provided by the P2P service. 47 * @param callbacks - All callbacks 48 * @return ErrCode 49 */ 50 virtual ErrCode RegisterApServiceCallbacks(const IApServiceCallbacks &callbacks) = 0; 51 }; 52 } // namespace Wifi 53 } // namespace OHOS 54 #endif 55