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 OHOS_WIFI_CHIP_HAL_INTERFACE_H
17 #define OHOS_WIFI_CHIP_HAL_INTERFACE_H
18 
19 #include <string>
20 #include <vector>
21 #include "i_wifi_chip.h"
22 #include "i_wifi_struct.h"
23 #include "wifi_base_hal_interface.h"
24 #include "wifi_chip_event_callback.h"
25 
26 namespace OHOS {
27 namespace Wifi {
28 class WifiChipHalInterface : public WifiBaseHalInterface {
29 public:
30     /**
31      * @Description Get the Instance object.
32      *
33      * @return WifiChipHalInterface&
34      */
35     static WifiChipHalInterface &GetInstance(void);
36 
37     /**
38      * @Description Obtains the chip object by ID.
39      *
40      * @param id
41      * @param chip
42      * @return WifiErrorNo
43      */
44     WifiErrorNo GetWifiChipObject(int id, IWifiChip &chip);
45 
46     /**
47      * @Description Obtains the Wi-Fi chip ID set.
48      *
49      * @param ids
50      * @return WifiErrorNo
51      */
52     WifiErrorNo GetChipIds(std::vector<int> &ids);
53 
54     /**
55      * @Description Obtains the chip ID.
56      *
57      * @param id
58      * @return WifiErrorNo
59      */
60     WifiErrorNo GetUsedChipId(int &id);
61 
62     /**
63      * @Description Obtains chip capabilities.
64      *
65      * @param capabilities
66      * @return WifiErrorNo
67      */
68     WifiErrorNo GetChipCapabilities(int &capabilities);
69 
70     /**
71      * @Description Obtains the joint mode supported by the chip,
72      *              for example, sta+sta/sta+p2p/sta+ap/sta+nan/ap+nan.
73      *
74      * @param modes
75      * @return WifiErrorNo
76      */
77     WifiErrorNo GetSupportedModes(std::vector<int> &modes);
78 
79     /**
80      * @Description Configure the current joint mode of the chip.
81      *
82      * @param mode
83      * @return WifiErrorNo
84      */
85     WifiErrorNo ConfigRunModes(int mode);
86 
87     /**
88      * @Description Gets the current federation mode.
89      *
90      * @param mode
91      * @return WifiErrorNo
92      */
93     WifiErrorNo GetCurrentMode(int &mode);
94 
95     /**
96      * @Description Registering a Wi-Fi Chip Event.
97      *
98      * @param callback
99      * @return WifiErrorNo
100      */
101     WifiErrorNo RegisterChipEventCallback(WifiChipEventCallback &callback);
102 
103     /**
104      * @Description Requesting the debugging information of the firmware chip.
105      *
106      * @param debugInfo
107      * @return WifiErrorNo
108      */
109     WifiErrorNo RequestFirmwareDebugInfo(std::string &debugInfo);
110 
111     /**
112      * @Description is support DBDC
113      *
114      * @param isSupport
115      * @return WifiErrorNo
116      */
117     WifiErrorNo IsSupportDbdc(bool &isSupport) const;
118 
119     /**
120      * @Description is support CSA
121      *
122      * @param isSupport
123      * @return WifiErrorNo
124      */
125     WifiErrorNo IsSupportCsa(bool &isSupport) const;
126 
127     /**
128      * @Description is support radar detection
129      *
130      * @param isSupport
131      * @return WifiErrorNo
132      */
133     WifiErrorNo IsSupportRadarDetect(bool &isSupport) const;
134 
135     /**
136      * @Description is support DFS channel
137      *
138      * @param isSupport
139      * @return WifiErrorNo
140      */
141     WifiErrorNo IsSupportDfsChannel(bool &isSupport) const;
142 
143     /**
144      * @Description is support indoor channel
145      *
146      * @param isSupport
147      * @return WifiErrorNo
148      */
149     WifiErrorNo IsSupportIndoorChannel(bool &isSupport) const;
150 };
151 }  // namespace Wifi
152 }  // namespace OHOS
153 
154 #endif