From c1fd861dca01f00c861383d3a9e554518967b45c Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Sat, 25 Jun 2016 12:50:49 +0200 Subject: [PATCH] LP-341 serial port: call setDataTerminalReady(true) after opening port and add some error handling code --- ground/gcs/src/plugins/serialconnection/serialplugin.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ground/gcs/src/plugins/serialconnection/serialplugin.cpp b/ground/gcs/src/plugins/serialconnection/serialplugin.cpp index 64807b519..f97cd8cfb 100644 --- a/ground/gcs/src/plugins/serialconnection/serialplugin.cpp +++ b/ground/gcs/src/plugins/serialconnection/serialplugin.cpp @@ -162,6 +162,8 @@ QIODevice *SerialConnection::openDevice(const QString &deviceName) // don't specify a parent when constructing the QSerialPort as this object will be moved // to a different thread later on (see telemetrymanager.cpp) serialHandle = new QSerialPort(port); + connect(serialHandle, static_cast(&QSerialPort::error), + [=](QSerialPort::SerialPortError error) { qWarning() << "serial port error:" << error; }); // we need to handle port settings here... if (serialHandle->open(QIODevice::ReadWrite)) { if (serialHandle->setBaudRate(m_config->speed().toInt()) @@ -172,6 +174,8 @@ QIODevice *SerialConnection::openDevice(const QString &deviceName) qDebug() << "Serial telemetry running at " << m_config->speed(); m_deviceOpened = true; } + // see https://librepilot.atlassian.net/browse/LP-341 + serialHandle->setDataTerminalReady(true); } return serialHandle; } -- 2.11.4.GIT