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 16 #ifndef WIFI_SCAN_PROXY 17 #define WIFI_SCAN_PROXY 18 19 #include <iremote_proxy.h> 20 #include "i_wifi_scan.h" 21 #include "wifi_errcode.h" 22 #include "wifi_scan_msg.h" 23 24 namespace OHOS { 25 namespace Wifi { 26 class WifiScanProxy : public IRemoteProxy<IWifiScan>, public IRemoteObject::DeathRecipient { 27 public: 28 explicit WifiScanProxy(const sptr<IRemoteObject> &remote); 29 virtual ~WifiScanProxy(); 30 31 /** 32 * @Description Start scan Wifi 33 * 34 * @return ErrCode - operation result 35 */ 36 virtual ErrCode Scan() override; 37 38 /** 39 * @Description Set the Scan Control Info object 40 * 41 * @param info - ScanControlInfo object 42 * @return ErrCode - operation result 43 */ 44 virtual ErrCode SetScanControlInfo(const tagScanControlInfo &info) override; 45 46 /** 47 * @Description Start scan with specified params 48 * 49 * @param params - WifiScanParams object 50 * @return ErrCode - operation result 51 */ 52 virtual ErrCode AdvanceScan(const WifiScanParams ¶ms) override; 53 54 /** 55 * @Description Check whether the ScanAlways mode is enabled 56 * 57 * @param bOpen - true / false 58 * @return ErrCode - operation result 59 */ 60 virtual ErrCode IsWifiClosedScan(bool &bOpen) override; 61 62 /** 63 * @Description Obtain the scanning result 64 * 65 * @param result - Get result venctor of WifiScanInfo 66 * @return ErrCode - operation result 67 */ 68 virtual ErrCode GetScanInfoList(std::vector<WifiScanInfo> &result) override; 69 70 virtual ErrCode RegisterCallBack(const sptr<IWifiScanCallback> &callback) override; 71 72 /** 73 * @Description Get supported features 74 * 75 * @param features - return supported features 76 * @return ErrCode - operation result 77 */ 78 ErrCode GetSupportedFeatures(long &features) override; 79 80 void OnRemoteDied(const wptr<IRemoteObject>& remoteObject) override; 81 private: 82 static BrokerDelegator<WifiScanProxy> g_delegator; 83 bool mRemoteDied; 84 }; 85 } // namespace Wifi 86 } // namespace OHOS 87 #endif 88