• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef OHOS_ARCH_LITE
22 #include "ienhance_service.h"
23 #endif
24 namespace OHOS {
25 namespace Wifi {
26 class IApService {
27 public:
28     /**
29      * @DescriptionDestroy the IApService object.
30      *
31      */
32     virtual ~IApService() = default;
33     virtual ErrCode EnableHotspot() = 0;
34     virtual ErrCode DisableHotspot() = 0;
35     virtual ErrCode AddBlockList(const StationInfo &stationInfo) = 0;
36     virtual ErrCode DelBlockList(const StationInfo &stationInfo) = 0;
37     virtual ErrCode SetHotspotConfig(const HotspotConfig &hotspotConfig) = 0;
38     virtual ErrCode DisconnetStation(const StationInfo &stationInfo) = 0;
39     virtual ErrCode GetStationList(std::vector<StationInfo> &result) = 0;
40     virtual ErrCode GetValidBands(std::vector<BandType> &bands) = 0;
41     virtual ErrCode GetValidChannels(BandType band, std::vector<int32_t> &validChannel) = 0;
42     virtual ErrCode GetSupportedPowerModel(std::set<PowerModel>& setPowerModelList) = 0;
43     virtual ErrCode GetPowerModel(PowerModel& model) = 0;
44     virtual ErrCode SetPowerModel(const PowerModel& model) = 0;
45     virtual ErrCode SetHotspotIdleTimeout(int time) = 0;
46     virtual void OnNetCapabilitiesChanged(const int apStatus) = 0;
47 #ifndef OHOS_ARCH_LITE
48     virtual void SetEnhanceService(IEnhanceService* enhanceService) = 0;
49 #endif
50 
51     /**
52      * @Description - Registers all callbacks provided by the P2P service.
53      * @param callbacks - All callbacks
54      * @return ErrCode
55      */
56     virtual ErrCode RegisterApServiceCallbacks(const IApServiceCallbacks &callbacks) = 0;
57 
58     /**
59      * @Description get hotspot mode
60      *
61      * @param model - the model to be set
62      * @return ErrCode - operation result
63      */
64     virtual ErrCode GetHotspotMode(HotspotMode &mode);
65 
66     /**
67      * @Description set hotspot mode
68      *
69      * @param model - the model to be set
70      * @return ErrCode - operation result
71      */
72     virtual ErrCode SetHotspotMode(const HotspotMode &mode);
73 };
74 }  // namespace Wifi
75 }  // namespace OHOS
76 #endif
77