| 314 | } |
| 315 | |
| 316 | void SerialEndpoint::start() { |
| 317 | std::lock_guard<std::mutex> lock(m_connect_receive_thread_mutex); |
| 318 | m_console->debug("start()-begin"); |
| 319 | if (m_connect_receive_thread != nullptr) { |
| 320 | m_console->debug("Already started"); |
| 321 | return; |
| 322 | } |
| 323 | _stop_requested = false; |
| 324 | m_connect_receive_thread = std::make_unique<std::thread>( |
| 325 | &SerialEndpoint::connect_and_read_loop, this); |
| 326 | m_console->debug("start()-end"); |
| 327 | } |
| 328 | |
| 329 | void SerialEndpoint::stop() { |
| 330 | std::lock_guard<std::mutex> lock(m_connect_receive_thread_mutex); |