| 383 | } |
| 384 | |
| 385 | void SerialEndpointManager::configure(const SerialEndpoint::HWOptions& options, |
| 386 | const std::string& tag, |
| 387 | MAV_MSG_CALLBACK cb) { |
| 388 | std::lock_guard<std::mutex> guard(m_serial_endpoint_mutex); |
| 389 | if (m_serial_endpoint != nullptr) { |
| 390 | // Disable the currently running uart configuration, if there is any |
| 391 | m_console->info("Stopping already existing FC UART"); |
| 392 | m_serial_endpoint->stop(); |
| 393 | m_serial_endpoint.reset(); |
| 394 | m_serial_endpoint = nullptr; |
| 395 | } |
| 396 | m_serial_endpoint = std::make_unique<SerialEndpoint>(tag, options); |
| 397 | m_serial_endpoint->registerCallback(std::move(cb)); |
| 398 | } |
| 399 | |
| 400 | std::optional<std::string> serial_openhd_param_to_linux_fd( |
| 401 | const std::string& param_name) { |
nothing calls this directly
no test coverage detected