* @brief Configures and connects the UART bus from CLI options. */
| 467 | * @brief Configures and connects the UART bus from CLI options. |
| 468 | */ |
| 469 | void CLI::setupUartConnection() |
| 470 | { |
| 471 | IO::ConnectionManager::instance().setBusType(SerialStudio::BusType::UART); |
| 472 | |
| 473 | if (m_parser.isSet(m_opts.uartOpt)) { |
| 474 | const QString device = m_parser.value(m_opts.uartOpt); |
| 475 | IO::ConnectionManager::instance().uart()->registerDevice(device); |
| 476 | } |
| 477 | |
| 478 | if (m_parser.isSet(m_opts.baudOpt)) { |
| 479 | bool ok = false; |
| 480 | const qint32 baudRate = m_parser.value(m_opts.baudOpt).toInt(&ok); |
| 481 | if (!ok) |
| 482 | qWarning() << "Invalid baud rate:" << m_parser.value(m_opts.baudOpt); |
| 483 | else |
| 484 | IO::ConnectionManager::instance().uart()->setBaudRate(baudRate); |
| 485 | } |
| 486 | |
| 487 | IO::ConnectionManager::instance().connectDevice(); |
| 488 | } |
| 489 | |
| 490 | /** |
| 491 | * @brief Configures and connects a TCP socket from a CLI host:port string. |
nothing calls this directly
no test coverage detected