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 inline const int CMD_SET_RX_LISTEN_POWER_SAVING_SWITCH = 125; 27 inline const int CMD_SET_SOFTAP_2G_MSS = 106; 28 inline const int CMD_AX_BLA_LIST = 131; 29 inline const int CMD_AX_SELFCURE = 132; 30 inline const int CMD_BE_BLA_LIST = 221; 31 inline const int CMD_EMLSR_MODE = 222; 32 inline const int CMD_MLD_LINK_SWITCH = 223; 33 34 struct WifiPrivCmd { 35 uint8_t *buf; 36 uint32_t size; 37 uint32_t len; 38 }; 39 40 class WifiCmdClient { 41 public: 42 static WifiCmdClient &GetInstance(); 43 int SendCmdToDriver(const std::string &ifName, int commandId, const std::string ¶m) const; 44 std::string VoWifiDetectInternal(std::string cmd); 45 46 private: 47 int SendCommandToDriverByInterfaceName(const std::string &ifName, const std::string &cmdParm, 48 char *out = nullptr) const; 49 int SetRxListen(const std::string &ifName, const std::string ¶m) const; 50 int Set2gSoftapMss(const std::string &ifName, const std::string ¶m) const; 51 int SetAxBlaList(const std::string &ifName, const std::string ¶m) const; 52 int AxSelfcure(const std::string &ifName, const std::string ¶m) const; 53 int SetBeBlaList(const std::string &ifName, const std::string ¶m) const; 54 int SetEmlsrMode(const std::string &ifName, const std::string ¶m) const; 55 int StartMldLinkSwitch(const std::string &ifName, const std::string ¶m) const; 56 }; 57 } // namespace Wifi 58 } // namespace OHOS 59 60 #endif /* OHOS_WIFI_CMD_CLIENT_H */