| 173 | }; |
| 174 | |
| 175 | bool wifi::commandhelper::iw_set_rate_mcs(const std::string &device, |
| 176 | uint32_t mcs_index, bool is_2g) { |
| 177 | if (device == "ath0") { // Qualcomm-specific logic |
| 178 | get_logger()->info("set_rate_mcs {} {}", device, mcs_index); |
| 179 | if (mcs_index < he20_11ax_rate_ol.size()) { |
| 180 | const auto rate = he20_11ax_rate_ol[mcs_index]; |
| 181 | std::vector<std::string> args{device, "bcast_rate", std::to_string(rate)}; |
| 182 | OHDUtil::run_command("iwpriv", args); |
| 183 | return true; |
| 184 | } |
| 185 | return false; |
| 186 | } |
| 187 | |
| 188 | // Generic logic for other devices |
| 189 | get_logger()->info("iw_set_rate_mcs {} {} mBm", device, mcs_index); |
| 190 | std::vector<std::string> args{"dev", |
| 191 | device, |
| 192 | "set", |
| 193 | "bitrates", |
| 194 | is_2g ? "ht-mcs-2.4" : "ht-mcs-5", |
| 195 | std::to_string(mcs_index)}; |
| 196 | const auto ret = OHDUtil::run_command("iw", args); |
| 197 | if (ret != 0) { |
| 198 | get_logger()->warn("iw_set_rate_mcs failed {}", ret); |
| 199 | return false; |
| 200 | } |
| 201 | return true; |
| 202 | } |
| 203 | |
| 204 | bool wifi::commandhelper::nmcli_set_device_managed_status( |
| 205 | const std::string &device, bool managed) { |
nothing calls this directly
no test coverage detected