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 16 #ifndef OHOS_I_WIFI_HOTSPOT_H 17 #define OHOS_I_WIFI_HOTSPOT_H 18 19 #include "iremote_broker.h" 20 #include "message_parcel.h" 21 #include "message_option.h" 22 #include "wifi_errcode.h" 23 #include "wifi_ap_msg.h" 24 #include "define.h" 25 #include "wifi_errcode.h" 26 #include "i_wifi_hotspot_callback.h" 27 28 namespace OHOS { 29 namespace Wifi { 30 class IWifiHotspot : public IRemoteBroker { 31 public: ~IWifiHotspot()32 virtual ~IWifiHotspot() 33 {} 34 35 /** 36 * @Description Check whether the hotspot is active. 37 * 38 * @param bActive - active / inactive 39 * @return ErrCode - operation result 40 */ 41 virtual ErrCode IsHotspotActive(bool &bActive) = 0; 42 43 /** 44 * @Description Get the Hotspot Config object 45 * 46 * @param config - HotapotConfig object 47 * @return ErrCode - operation result 48 */ 49 virtual ErrCode GetHotspotConfig(HotspotConfig &config) = 0; 50 51 /** 52 * @Description Get the Hotspot State object 53 * 54 * @param state - current Hotspot state 55 * @return ErrCode - operation result 56 */ 57 virtual ErrCode GetHotspotState(int &state) = 0; 58 59 /** 60 * @Description Set the configuration of Hotspot 61 * 62 * @param config - HotspotConfig object 63 * @return ErrCode - operation result 64 */ 65 virtual ErrCode SetHotspotConfig(const HotspotConfig &config) = 0; 66 67 /** 68 * @Description Get the Station List object. 69 * 70 * @param result - Get result vector of connect Station Info 71 * @return ErrCode - operation result 72 */ 73 virtual ErrCode GetStationList(std::vector<StationInfo> &result) = 0; 74 75 /** 76 * @Description Disconnects a specified sta connection 77 * 78 * @param info - Station object 79 * @return ErrCode - operation result 80 */ 81 virtual ErrCode DisassociateSta(const StationInfo &info) = 0; 82 83 /** 84 * @Description Enable Hotspot 85 * 86 * @return ErrCode - operation result 87 */ 88 virtual ErrCode EnableHotspot(void) = 0; 89 90 /** 91 * @Description Disable Hotspot 92 * 93 * @return ErrCode - operation result 94 */ 95 virtual ErrCode DisableHotspot(void) = 0; 96 97 /** 98 * @Description Get the Block Lists object 99 * 100 * @param infos - Get Blocklist result vector of StationInfo 101 * @return ErrCode - operation result 102 */ 103 virtual ErrCode GetBlockLists(std::vector<StationInfo> &infos) = 0; 104 105 /** 106 * @Description Add a StationInfo object to Blocklist 107 * 108 * @param info - Station object 109 * @return ErrCode - operation result 110 */ 111 virtual ErrCode AddBlockList(const StationInfo &info) = 0; 112 113 /** 114 * @Description Del a StationInfo object from Blocklist 115 * 116 * @param info - StationInfo object 117 * @return ErrCode - operation result 118 */ 119 virtual ErrCode DelBlockList(const StationInfo &info) = 0; 120 121 /** 122 * @Description Get the Valid Bands object 123 * 124 * @param bands - Get result vector of BandType 125 * @return ErrCode - operation result 126 */ 127 virtual ErrCode GetValidBands(std::vector<BandType> &bands) = 0; 128 129 /** 130 * @Description Get the Valid Channels object 131 * 132 * @param band - Specified band 133 * @param validchannels - Obtains the channels corresponding to the specified band 134 * @return ErrCode - operation result 135 */ 136 virtual ErrCode GetValidChannels(BandType band, std::vector<int32_t> &validchannels) = 0; 137 138 /** 139 * @Description Register callback client 140 * 141 * @param callback - callback struct 142 * @return ErrCode - operation result 143 */ 144 virtual ErrCode RegisterCallBack(const sptr<IWifiHotspotCallback> &callback) = 0; 145 146 /** 147 * @Description Get supported features 148 * 149 * @param features - return supported features 150 * @return ErrCode - operation result 151 */ 152 virtual ErrCode GetSupportedFeatures(long &features) = 0; 153 public: 154 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.wifi.IWifiHotspotService"); 155 }; 156 } // namespace Wifi 157 } // namespace OHOS 158 #endif