Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
f0f05794
Commit
f0f05794
authored
Apr 02, 2011
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed UDP multiplexer bug, fixed serial compile errors
parent
938a4320
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
121 additions
and
63 deletions
+121
-63
.gitignore
.gitignore
+4
-0
qgroundcontrol.pro
qgroundcontrol.pro
+24
-9
SerialInterface.h
src/comm/SerialInterface.h
+17
-10
SerialLink.cc
src/comm/SerialLink.cc
+5
-23
UDPLink.cc
src/comm/UDPLink.cc
+24
-21
qgroundcontrol-qserialport.pri
thirdParty/qserialport/qgroundcontrol-qserialport.pri
+47
-0
No files found.
.gitignore
View file @
f0f05794
...
...
@@ -44,3 +44,7 @@ user_config.pri
*.cproject
*.sln
*.suo
thirdParty/qserialport-build-desktop/
thirdParty/qserialport/bin/
thirdParty/qserialport/lib/
qgroundcontrol.pro
View file @
f0f05794
...
...
@@ -58,36 +58,47 @@ exists(user_config.pri) {
}
INCLUDEPATH
+=
$$
BASEDIR
/../
mavlink
/
include
/
common
INCLUDEPATH
+=
$$
BASEDIR
/../
mavlink
/
include
INCLUDEPATH
+=
$$
BASEDIR
/
thirdParty
/
mavlink
/
include
/
common
INCLUDEPATH
+=
$$
BASEDIR
/
thirdParty
/
mavlink
/
include
contains
(
MAVLINK_CONF
,
pixhawk
)
{
#
Remove
the
default
set
-
it
is
included
anyway
INCLUDEPATH
-=
$$
BASEDIR
/../
mavlink
/
include
/
common
INCLUDEPATH
-=
$$
BASEDIR
/
thirdParty
/
mavlink
/
include
/
common
#
PIXHAWK
SPECIAL
MESSAGES
INCLUDEPATH
+=
$$
BASEDIR
/../
mavlink
/
include
/
pixhawk
INCLUDEPATH
+=
$$
BASEDIR
/
thirdParty
/
mavlink
/
include
/
pixhawk
DEFINES
+=
QGC_USE_PIXHAWK_MESSAGES
}
contains
(
MAVLINK_CONF
,
slugs
)
{
#
Remove
the
default
set
-
it
is
included
anyway
INCLUDEPATH
-=
$$
BASEDIR
/../
mavlink
/
include
/
common
INCLUDEPATH
-=
$$
BASEDIR
/
thirdParty
/
mavlink
/
include
/
common
#
SLUGS
SPECIAL
MESSAGES
INCLUDEPATH
+=
$$
BASEDIR
/../
mavlink
/
include
/
slugs
INCLUDEPATH
+=
$$
BASEDIR
/
thirdParty
/
mavlink
/
include
/
slugs
DEFINES
+=
QGC_USE_SLUGS_MESSAGES
}
contains
(
MAVLINK_CONF
,
ualberta
)
{
#
Remove
the
default
set
-
it
is
included
anyway
INCLUDEPATH
-=
$$
BASEDIR
/../
mavlink
/
include
/
common
INCLUDEPATH
-=
$$
BASEDIR
/
thirdParty
/
mavlink
/
include
/
common
#
UALBERTA
SPECIAL
MESSAGES
INCLUDEPATH
+=
$$
BASEDIR
/../
mavlink
/
include
/
ualberta
INCLUDEPATH
+=
$$
BASEDIR
/
thirdParty
/
mavlink
/
include
/
ualberta
DEFINES
+=
QGC_USE_UALBERTA_MESSAGES
}
contains
(
MAVLINK_CONF
,
ardupilotmega
)
{
#
Remove
the
default
set
-
it
is
included
anyway
INCLUDEPATH
-=
$$
BASEDIR
/../
mavlink
/
include
/
common
INCLUDEPATH
-=
$$
BASEDIR
/
thirdParty
/
mavlink
/
include
/
common
#
UALBERTA
SPECIAL
MESSAGES
INCLUDEPATH
+=
$$
BASEDIR
/../
mavlink
/
include
/
ardupilotmega
INCLUDEPATH
+=
$$
BASEDIR
/
thirdParty
/
mavlink
/
include
/
ardupilotmega
DEFINES
+=
QGC_USE_ARDUPILOTMEGA_MESSAGES
}
...
...
@@ -97,13 +108,6 @@ contains(MAVLINK_CONF, ardupilotmega) {
#
done
by
the
plugins
above
include
(
qgroundcontrol
.
pri
)
#
QWT
plot
and
QExtSerial
depend
on
paths
set
by
qgroundcontrol
.
pri
#
Include
serial
port
library
include
(
src
/
lib
/
qextserialport
/
qextserialport
.
pri
)
#
include
qserial
library
include
(
thirdParty
/
qserial
/
qserialport
.
prf
)
#
Include
QWT
plotting
library
include
(
src
/
lib
/
qwt
/
qwt
.
pri
)
DEPENDPATH
+=
.
\
...
...
@@ -111,11 +115,22 @@ DEPENDPATH += . \
lib
/
QMapControl
/
src
\
lib
/
opmapcontrol
\
lib
/
opmapcontrol
/
src
\
plugins
plugins
\
thirdParty
/
qserialport
/
include
\
thirdParty
/
qserialport
/
include
/
QtSerialPort
\
thirdParty
/
qserialport
INCLUDEPATH
+=
.
\
lib
/
QMapControl
\
lib
/
opmapcontrol
\
$$
BASEDIR
/../
mavlink
/
include
thirdParty
/
qserialport
/
include
\
thirdParty
/
qserialport
/
include
/
QtSerialPort
\
thirdParty
/
qserialport
/
src
#
Include
serial
port
library
include
(
src
/
lib
/
qextserialport
/
qextserialport
.
pri
)
#
include
qserial
library
include
(
thirdParty
/
qserialport
/
qgroundcontrol
-
qserialport
.
pri
)
#
..
/
mavlink
/
include
\
#
MAVLink
/
include
\
...
...
src/comm/SerialInterface.h
View file @
f0f05794
...
...
@@ -49,7 +49,8 @@ signals:
public:
enum
baudRateType
{
enum
baudRateType
{
BAUD50
,
//POSIX ONLY
BAUD75
,
//POSIX ONLY
BAUD110
,
...
...
@@ -77,14 +78,16 @@ public:
BAUD921600
// WINDOWS ONLY
};
enum
dataBitsType
{
enum
dataBitsType
{
DATA_5
,
DATA_6
,
DATA_7
,
DATA_8
};
enum
parityType
{
enum
parityType
{
PAR_NONE
,
PAR_ODD
,
PAR_EVEN
,
...
...
@@ -92,13 +95,15 @@ public:
PAR_SPACE
};
enum
stopBitsType
{
enum
stopBitsType
{
STOP_1
,
STOP_1_5
,
//WINDOWS ONLY
STOP_2
};
enum
flowType
{
enum
flowType
{
FLOW_OFF
,
FLOW_HARDWARE
,
FLOW_XONXOFF
...
...
@@ -107,7 +112,8 @@ public:
/**
* structure to contain port settings
*/
struct
portSettings
{
struct
portSettings
{
baudRateType
BaudRate
;
dataBitsType
DataBits
;
parityType
Parity
;
...
...
@@ -186,10 +192,11 @@ public:
}
virtual
void
setTimeout
(
qint64
timeout
)
{
_port
->
setTimeout
(
timeout
);
}
;
}
virtual
void
setFlow
(
SerialInterface
::
flowType
flow
)
{
// TODO implement
};
_port
->
setFlowControl
((
FlowType
)
flow
);
}
};
using
namespace
TNX
;
...
...
@@ -262,11 +269,11 @@ public:
virtual
void
setTimeout
(
qint64
timeout
)
{
// TODO implement
//_port->setTimeout(timeout);
}
;
}
virtual
void
setFlow
(
SerialInterface
::
flowType
flow
)
{
// TODO map
settings
.
setFlowControl
(
QPortSettings
::
FLOW_OFF
);
}
;
}
};
#endif // SERIALINTERFACE_H
...
...
src/comm/SerialLink.cc
View file @
f0f05794
...
...
@@ -48,32 +48,14 @@ SerialLink::SerialLink(QString portname, SerialInterface::baudRateType baudrate,
this
->
timeout
=
1
;
///< The timeout controls how long the program flow should wait for new serial bytes. As we're polling, we don't want to wait at all.
// Set the port name
if
(
porthandle
==
""
)
{
// name = tr("serial link ") + QString::number(getId()) + tr(" (unconfigured)");
if
(
porthandle
==
""
)
{
name
=
tr
(
"Serial Link "
)
+
QString
::
number
(
getId
());
}
else
{
name
=
portname
.
trimmed
();
}
#ifdef _WIN3232
// Windows 32bit & 64bit serial connection
winPort
=
CreateFile
(
porthandle
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
0
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
0
);
if
(
winPort
==
INVALID_HANDLE_VALUE
)
{
if
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
)
{
//serial port does not exist. Inform user.
}
//some other error occurred. Inform user.
else
{
name
=
portname
.
trimmed
();
}
#else
#endif
loadSettings
();
}
...
...
src/comm/UDPLink.cc
View file @
f0f05794
...
...
@@ -85,6 +85,8 @@ void UDPLink::setPort(int port)
*/
void
UDPLink
::
addHost
(
const
QString
&
host
)
{
if
(
host
!=
""
)
{
qDebug
()
<<
"UDP:"
<<
"ADDING HOST:"
<<
host
;
if
(
host
.
contains
(
":"
))
{
qDebug
()
<<
"HOST: "
<<
host
.
split
(
":"
).
first
();
...
...
@@ -109,6 +111,7 @@ void UDPLink::addHost(const QString& host)
// Set port according to default (this port)
ports
.
append
(
port
);
}
}
}
void
UDPLink
::
removeHost
(
const
QString
&
hostname
)
...
...
thirdParty/qserialport/qgroundcontrol-qserialport.pri
0 → 100644
View file @
f0f05794
######################################################################
# Automatically generated by qmake (2.01a) Sa. Apr 2 10:42:30 2011
######################################################################
DEPENDPATH += . \
include/QtSerialPort \
src/common \
src/posix \
src/win32
INCLUDEPATH += include \
include/QtSerialPort \
src/posix \
src/win32
# Input
HEADERS += include/QtSerialPort/qportsettings.h \
include/QtSerialPort/qserialport.h \
include/QtSerialPort/qserialport_export.h \
include/QtSerialPort/qserialportnative.h
macx|linux-g++|linux-g++-64 {
HEADERS += src/posix/termioshelper.h
}
win32-msvc2008|win32-g++ {
HEADERS += src/win32/commdcbhelper.h \
src/win32/qwincommevtnotifier.h \
src/win32/wincommevtbreaker.h \
src/win32/commdcbhelper.h \
src/win32/qwincommevtnotifier.h \
src/win32/wincommevtbreaker.h
}
SOURCES += src/common/qportsettings.cpp \
src/common/qserialport.cpp
macx|linux-g++|linux-g++-64 {
SOURCES += src/posix/qserialportnative_posix.cpp \
src/posix/termioshelper.cpp
}
win32-msvc2008|win32-g++ {
SOURCES += src/win32/commdcbhelper.cpp \
src/win32/qserialportnative_win32.cpp \
src/win32/qwincommevtnotifier.cpp \
src/win32/wincommevtbreaker.cpp
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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