Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
0320b530
Commit
0320b530
authored
Feb 22, 2014
by
Don Gagne
Browse files
Silence some queued signal warnings
parent
3c5a3553
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/comm/SerialLink.cc
View file @
0320b530
...
...
@@ -26,6 +26,9 @@ SerialLink::SerialLink(QString portname, int baudRate, bool hardwareFlowControl,
m_stopp
(
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.
m_portName
=
portname
.
trimmed
();
...
...
@@ -445,7 +448,9 @@ bool SerialLink::hardwareConnect()
void
SerialLink
::
linkError
(
QSerialPort
::
SerialPortError
error
)
{
qDebug
()
<<
error
;
if
(
error
!=
QSerialPort
::
NoError
)
{
qDebug
()
<<
"SerialLink::linkError"
<<
error
;
}
}
...
...
src/comm/SerialLink.h
View file @
0320b530
...
...
@@ -36,10 +36,14 @@ This file is part of the QGROUNDCONTROL project
#include
<QThread>
#include
<QMutex>
#include
<QString>
#include
<qserialport.h>
#include
<configuration.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.
* It takes care of the link management and provides a common API to higher
...
...
src/comm/TCPLink.cc
View file @
0320b530
...
...
@@ -43,6 +43,12 @@ TCPLink::TCPLink(QHostAddress hostAddress, quint16 socketPort) :
_socket
(
NULL
),
_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
();
_resetName
();
...
...
src/comm/TCPLink.h
View file @
0320b530
...
...
@@ -34,10 +34,16 @@
#include
<QMap>
#include
<QMutex>
#include
<QHostAddress>
#include
<QTcpSocket>
#include
<LinkInterface.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
class
TCPLink
:
public
LinkInterface
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment