• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 HDI_SAMPLE_CLIENT_CPP_INF_H
17 #define HDI_SAMPLE_CLIENT_CPP_INF_H
18 
19 #include <list>
20 #include <map>
21 #include <vector>
22 #include <hdf_log.h>
23 #include <iservmgr_hdi.h>
24 
25 namespace OHOS {
26 namespace HDI {
27 namespace WLAN {
28 namespace V1_0 {
29 
30 struct WifiFeatureInfo {
31     char *ifName;
32     int32_t type;
33 };
34 
35 class IWlan : public IRemoteBroker {
36 public:
37     DECLARE_INTERFACE_DESCRIPTOR(u"HDI.WLAN.V1_0");
~IWlan()38     virtual ~IWlan(){}
39     static sptr<IWlan> Get(const std::string& serviceName);
40     virtual int32_t wifiConstruct() = 0;
41     virtual int32_t wifiDestruct() = 0;
42     virtual int32_t start() = 0;
43     virtual int32_t stop() = 0;
44     virtual int32_t getSupportFeature(std::vector<uint8_t>& supType) = 0;
45     virtual int32_t getSupportCombo(std::vector<uint64_t>& combo) = 0;
46     virtual int32_t createFeature(int32_t type, std::shared_ptr<WifiFeatureInfo>& ifeature) = 0;
47     virtual int32_t getFeatureByIfName(std::string& ifName, std::shared_ptr<WifiFeatureInfo>& ifeature) = 0;
48     virtual int32_t registerEventCallback(std::function<int32_t(int32_t event, struct HdfSBuf *sbuf)> cb) = 0;
49     virtual int32_t unregisterEventCallback() = 0;
50     virtual int32_t destroyFeature(std::shared_ptr<WifiFeatureInfo> ifeature) = 0;
51     virtual int32_t resetDriver(const uint8_t chipId) = 0;
52     virtual int32_t getAsscociatedStas(std::shared_ptr<WifiFeatureInfo> ifeature, std::shared_ptr<StaInfo> staInfo,
53         uint32_t count, std::vector<uint32_t>& num) = 0;
54     virtual int32_t setCountryCode(std::shared_ptr<WifiFeatureInfo> ifeature, std::string& code, uint32_t len) = 0;
55     virtual int32_t getNetworkIfaceName(std::shared_ptr<WifiFeatureInfo> ifeature) = 0;
56     virtual int32_t getFeatureType(std::shared_ptr<WifiFeatureInfo> ifeature) = 0;
57     virtual int32_t setMacAddress(std::shared_ptr<WifiFeatureInfo> ifeature, std::vector<uint8_t>& mac) = 0;
58     virtual int32_t getDeviceMacAddress(std::shared_ptr<WifiFeatureInfo> ifeature, std::vector<uint8_t>& mac,
59         uint8_t len) = 0;
60     virtual int32_t getFreqsWithBand(std::shared_ptr<WifiFeatureInfo> ifeature, int32_t band,
61         std::vector<int32_t> freq, uint32_t count, uint32_t& num) = 0;
62     virtual int32_t setTxPower(std::shared_ptr<WifiFeatureInfo> ifeature, int32_t power) = 0;
63     virtual int32_t getChipId(std::shared_ptr<WifiFeatureInfo> ifeature, uint8_t& chipId) = 0;
64     virtual int32_t getIfNamesByChipId(const uint8_t chipId, std::string& ifNames, uint32_t& num) = 0;
65     virtual int32_t setScanningMacAddress(std::shared_ptr<WifiFeatureInfo> ifeature, std::vector<uint8_t>& scanMac,
66         uint8_t len) = 0;
67 };
68 
69 }
70 }
71 }
72 }
73 
74 #endif