• 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 
16 #ifndef OHOS_WIFI_SCAN_H
17 #define OHOS_WIFI_SCAN_H
18 
19 #include "wifi_errcode.h"
20 #include "wifi_scan_msg.h"
21 #include "i_wifi_scan_callback.h"
22 
23 namespace OHOS {
24 namespace Wifi {
25 class WifiScan {
26 public:
27     static std::unique_ptr<WifiScan> CreateWifiScan(int system_ability_id);
28     static std::unique_ptr<WifiScan> GetInstance(int system_ability_id);
29 
~WifiScan()30     virtual ~WifiScan()
31     {}
32 
33     /**
34      * @Description Set the Scan Control Info object
35      *
36      * @param info - ScanControlInfo object
37      * @return ErrCode - operation result
38      */
39     virtual ErrCode SetScanControlInfo(const ScanControlInfo &info) = 0;
40 
41     /**
42      * @Description Start scan Wifi
43      *
44      * @return ErrCode - operation result
45      */
46     virtual ErrCode Scan() = 0;
47 
48     /**
49      * @Description Obtain the scanning result
50      *
51      * @param result - Get result venctor of WifiScanInfo
52      * @return ErrCode - operation result
53      */
54     virtual ErrCode GetScanInfoList(std::vector<WifiScanInfo> &result) = 0;
55 
56     virtual ErrCode RegisterCallBack(const sptr<IWifiScanCallback> &callback) = 0;
57 
58     /**
59      * @Description Get supported features
60      *
61      * @param features - return supported features
62      * @return ErrCode - operation result
63      */
64     virtual ErrCode GetSupportedFeatures(long &features) = 0;
65 
66     /**
67      * @Description Check if supported input feature
68      *
69      * @param feature - input feature
70      * @return true - supported
71      * @return false - unsupported
72      */
73     virtual bool IsFeatureSupported(long feature) = 0;
74 };
75 }  // namespace Wifi
76 }  // namespace OHOS
77 #endif