* @brief Get list of supported bitrates */
| 305 | * @brief Get list of supported bitrates |
| 306 | */ |
| 307 | API::CommandResponse API::Handlers::CANBusHandler::getBitrateList(const QString& id, |
| 308 | const QJsonObject& params) |
| 309 | { |
| 310 | Q_UNUSED(params) |
| 311 | |
| 312 | const auto& bitrateList = IO::ConnectionManager::instance().canBus()->bitrateList(); |
| 313 | |
| 314 | QJsonArray bitrates; |
| 315 | for (const auto& rate : bitrateList) |
| 316 | bitrates.append(rate); |
| 317 | |
| 318 | QJsonObject result; |
| 319 | result[QStringLiteral("bitrateList")] = bitrates; |
| 320 | result[QStringLiteral("currentBitrate")] = |
| 321 | static_cast<qint64>(IO::ConnectionManager::instance().canBus()->bitrate()); |
| 322 | return CommandResponse::makeSuccess(id, result); |
| 323 | } |
| 324 | |
| 325 | /** |
| 326 | * @brief Get interface error message if any |
nothing calls this directly
no test coverage detected