Commit 0320b530 authored by Don Gagne's avatar Don Gagne

Silence some queued signal warnings

parent 3c5a3553
...@@ -26,6 +26,9 @@ SerialLink::SerialLink(QString portname, int baudRate, bool hardwareFlowControl, ...@@ -26,6 +26,9 @@ SerialLink::SerialLink(QString portname, int baudRate, bool hardwareFlowControl,
m_stopp(false), m_stopp(false),
m_reqReset(false) m_reqReset(false)
{ {
// We use QSerialPort::SerialPortError in a signal so we must declare it as a meta type
static int idMetaType = qRegisterMetaType<QSerialPort::SerialPortError>();
Q_UNUSED(idMetaType);
// Get the name of the current port in use. // Get the name of the current port in use.
m_portName = portname.trimmed(); m_portName = portname.trimmed();
...@@ -445,7 +448,9 @@ bool SerialLink::hardwareConnect() ...@@ -445,7 +448,9 @@ bool SerialLink::hardwareConnect()
void SerialLink::linkError(QSerialPort::SerialPortError error) void SerialLink::linkError(QSerialPort::SerialPortError error)
{ {
qDebug() << error; if (error != QSerialPort::NoError) {
qDebug() << "SerialLink::linkError" << error;
}
} }
......
...@@ -36,10 +36,14 @@ This file is part of the QGROUNDCONTROL project ...@@ -36,10 +36,14 @@ This file is part of the QGROUNDCONTROL project
#include <QThread> #include <QThread>
#include <QMutex> #include <QMutex>
#include <QString> #include <QString>
#include <qserialport.h>
#include <configuration.h> #include <configuration.h>
#include "SerialLinkInterface.h" #include "SerialLinkInterface.h"
// We use QSerialPort::SerialPortError in a signal so we must declare it as a meta type
#include <qserialport.h>
#include <QMetaType>
Q_DECLARE_METATYPE(QSerialPort::SerialPortError)
/** /**
* @brief The SerialLink class provides cross-platform access to serial links. * @brief The SerialLink class provides cross-platform access to serial links.
* It takes care of the link management and provides a common API to higher * It takes care of the link management and provides a common API to higher
......
...@@ -43,6 +43,12 @@ TCPLink::TCPLink(QHostAddress hostAddress, quint16 socketPort) : ...@@ -43,6 +43,12 @@ TCPLink::TCPLink(QHostAddress hostAddress, quint16 socketPort) :
_socket(NULL), _socket(NULL),
_socketIsConnected(false) _socketIsConnected(false)
{ {
// Even though QAbstractSocket::SocketError is used in a signal by Qt, Qt doesn't declare it as a meta type.
// This in turn causes debug output to be kicked out about not being able to queue the signal. We register it
// as a meta type to silence that.
static int idMetaType = qRegisterMetaType<QAbstractSocket::SocketError>();
Q_UNUSED(idMetaType);
_linkId = getNextLinkId(); _linkId = getNextLinkId();
_resetName(); _resetName();
......
...@@ -34,10 +34,16 @@ ...@@ -34,10 +34,16 @@
#include <QMap> #include <QMap>
#include <QMutex> #include <QMutex>
#include <QHostAddress> #include <QHostAddress>
#include <QTcpSocket>
#include <LinkInterface.h> #include <LinkInterface.h>
#include <configuration.h> #include <configuration.h>
// Even though QAbstractSocket::SocketError is used in a signal by Qt, Qt doesn't declare it as a meta type.
// This in turn causes debug output to be kicked out about not being able to queue the signal. We declare it
// as a meta type to silence that.
#include <QMetaType>
#include <QTcpSocket>
Q_DECLARE_METATYPE(QAbstractSocket::SocketError)
//#define TCPLINK_READWRITE_DEBUG // Use to debug data reads/writes //#define TCPLINK_READWRITE_DEBUG // Use to debug data reads/writes
class TCPLink : public LinkInterface class TCPLink : public LinkInterface
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment