1 /*
2  * Copyright (C) 2023-2023 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_CMD_CLIENT_H
17 #define OHOS_WIFI_CMD_CLIENT_H
18 
19 #include <cstdint>
20 #include <string>
21 
22 namespace OHOS {
23 namespace Wifi {
24 
25 #define CMD_SET_SOFTAP_MIMOMODE "SET_AP_MODE"
26 const int CMD_SET_RX_LISTEN_POWER_SAVING_SWITCH = 125;
27 const int CMD_SET_SOFTAP_2G_MSS = 106;
28 const int CMD_AX_BLA_LIST = 131;
29 const int CMD_AX_SELFCURE = 132;
30 const int CMD_BE_BLA_LIST = 221;
31 struct WifiPrivCmd {
32     uint8_t *buf;
33     uint32_t size;
34     uint32_t len;
35 };
36 
37 class WifiCmdClient {
38 public:
39     static WifiCmdClient &GetInstance();
40     int SendCmdToDriver(const std::string &ifName, int commandId, const std::string &param) const;
41 
42 private:
43     int SendCommandToDriverByInterfaceName(const std::string &ifName, const std::string &cmdParm) const;
44     int SetRxListen(const std::string &ifName, const std::string &param) const;
45     int Set2gSoftapMss(const std::string &ifName, const std::string &param) const;
46     int SetAxBlaList(const std::string &ifName, const std::string &param) const;
47     int AxSelfcure(const std::string &ifName, const std::string &param) const;
48     int SetBeBlaList(const std::string &ifName, const std::string &param) const;
49 };
50 } // namespace Wifi
51 } // namespace OHOS
52 
53 #endif /* OHOS_WIFI_CMD_CLIENT_H */