* @brief Get list of common baud rates */
| 455 | * @brief Get list of common baud rates |
| 456 | */ |
| 457 | API::CommandResponse API::Handlers::UARTHandler::getBaudRateList(const QString& id, |
| 458 | const QJsonObject& params) |
| 459 | { |
| 460 | Q_UNUSED(params) |
| 461 | |
| 462 | const auto& baudRateList = IO::ConnectionManager::instance().uart()->baudRateList(); |
| 463 | |
| 464 | QJsonArray baudRates; |
| 465 | for (const auto& rate : baudRateList) |
| 466 | baudRates.append(rate.toInt()); |
| 467 | |
| 468 | QJsonObject result; |
| 469 | result[QStringLiteral("baudRateList")] = baudRates; |
| 470 | result[QStringLiteral("currentBaudRate")] = IO::ConnectionManager::instance().uart()->baudRate(); |
| 471 | return CommandResponse::makeSuccess(id, result); |
| 472 | } |
| 473 | |
| 474 | /** |
| 475 | * @brief Get current UART configuration |
nothing calls this directly
no test coverage detected