| 380 | } |
| 381 | |
| 382 | void GroundTelemetry::setup_uart() { |
| 383 | assert(m_gnd_settings); |
| 384 | using namespace openhd::telemetry; |
| 385 | const auto uart_linux_fd = serial_openhd_param_to_linux_fd( |
| 386 | m_gnd_settings->get_settings().gnd_uart_connection_type); |
| 387 | if (uart_linux_fd.has_value()) { |
| 388 | SerialEndpoint::HWOptions options{}; |
| 389 | options.linux_filename = uart_linux_fd.value(); |
| 390 | options.baud_rate = m_gnd_settings->get_settings().gnd_uart_baudrate; |
| 391 | options.flow_control = false; |
| 392 | options.enable_reading = false; |
| 393 | m_endpoint_tracker->configure(options, "gnd_ser", |
| 394 | [this](std::vector<MavlinkMessage> messages) { |
| 395 | // We ignore any incoming messages here for |
| 396 | // now, since it is only for mavlink out via |
| 397 | // serial |
| 398 | }); |
| 399 | } else { |
| 400 | m_endpoint_tracker->disable(); |
| 401 | } |
| 402 | } |
| 403 | |
| 404 | void GroundTelemetry::set_link_handle(std::shared_ptr<OHDLink> link) { |
| 405 | // only call this once, we do not support changing the link handle at run time |
nothing calls this directly
no test coverage detected