MCPcopy Create free account
hub / github.com/OpenHD/OpenHD / setup_uart

Method setup_uart

OpenHD/ohd_telemetry/src/GroundTelemetry.cpp:382–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

380}
381
382void 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
404void 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

Callers

nothing calls this directly

Calls 3

disableMethod · 0.80
configureMethod · 0.45

Tested by

no test coverage detected