diff --git a/src/comm/TCPLink.cc b/src/comm/TCPLink.cc index 70bf07decd72cdb7c609a8d896511e0d7b977f92..67cd1ded84e6fe4525f711e09f66ed2683933c48 100644 --- a/src/comm/TCPLink.cc +++ b/src/comm/TCPLink.cc @@ -291,7 +291,7 @@ void TCPConfiguration::saveSettings(QSettings& settings, const QString& root) void TCPConfiguration::loadSettings(QSettings& settings, const QString& root) { settings.beginGroup(root); - _port = (quint16)settings.value("port", QGC_UDP_PORT).toUInt(); + _port = (quint16)settings.value("port", QGC_TCP_PORT).toUInt(); QString address = settings.value("host", _address.toString()).toString(); _address = address; settings.endGroup(); diff --git a/src/comm/UDPLink.cc b/src/comm/UDPLink.cc index 9c232ea3b69dd330e7d88946ed0c70d7a5a5d742..2ef238b1638c7b2b60be06ea6f2783cc189669f4 100644 --- a/src/comm/UDPLink.cc +++ b/src/comm/UDPLink.cc @@ -267,7 +267,7 @@ qint64 UDPLink::getCurrentOutDataRate() const UDPConfiguration::UDPConfiguration(const QString& name) : LinkConfiguration(name) { - _localPort = QGC_UDP_PORT; + _localPort = QGC_UDP_LOCAL_PORT; } UDPConfiguration::UDPConfiguration(UDPConfiguration* source) : LinkConfiguration(source) @@ -404,7 +404,7 @@ void UDPConfiguration::loadSettings(QSettings& settings, const QString& root) _confMutex.lock(); settings.beginGroup(root); _hosts.clear(); - _localPort = (quint16)settings.value("port", QGC_UDP_PORT).toUInt(); + _localPort = (quint16)settings.value("port", QGC_UDP_LOCAL_PORT).toUInt(); int hostCount = settings.value("hostCount", 0).toInt(); for(int i = 0; i < hostCount; i++) { QString hkey = QString("host%1").arg(i); diff --git a/src/comm/UDPLink.h b/src/comm/UDPLink.h index 9adfd266d6ec806d579251bffe7704ca7bca086c..578de01c121e15f3ac0d97d80334597265d4245a 100644 --- a/src/comm/UDPLink.h +++ b/src/comm/UDPLink.h @@ -40,7 +40,8 @@ This file is part of the QGROUNDCONTROL project #include "QGCConfig.h" #include "LinkManager.h" -#define QGC_UDP_PORT 14550 +#define QGC_UDP_LOCAL_PORT 14550 +#define QGC_UDP_TARGET_PORT 14555 class UDPConfiguration : public LinkConfiguration { diff --git a/src/ui/QGCUDPLinkConfiguration.cc b/src/ui/QGCUDPLinkConfiguration.cc index dc949d631a77f9dccc2a172f1186186689941718..584257fd980096d9bd27a679c8b11fdbf498051f 100644 --- a/src/ui/QGCUDPLinkConfiguration.cc +++ b/src/ui/QGCUDPLinkConfiguration.cc @@ -108,7 +108,7 @@ void QGCUDPLinkConfiguration::on_addHost_clicked() QString hostName = QInputDialog::getText( this, tr("Add a host target to MAVLink"), tr("Host (hostname:port): "), - QLineEdit::Normal, QString("localhost:%1").arg(QGC_UDP_PORT), &ok); + QLineEdit::Normal, QString("localhost:%1").arg(QGC_UDP_TARGET_PORT), &ok); if (ok && !hostName.isEmpty()) { _config->addHost(hostName); _reloadList();