diff --git a/src/comm/UDPLink.cc b/src/comm/UDPLink.cc index b1316fae9108941862ef4af35068f205e13e70a4..8eecd7fb110da43ff6fcbac484b8728c7b4e42d3 100644 --- a/src/comm/UDPLink.cc +++ b/src/comm/UDPLink.cc @@ -291,21 +291,16 @@ bool UDPLink::_hardwareConnect() if (_connectState) { _socket->joinMulticastGroup(QHostAddress("224.0.0.1")); //-- Make sure we have a large enough IO buffers + #ifdef __mobile__ - _socket->setSocketOption(QAbstractSocket::SendBufferSizeSocketOption, 64 * 1024); - if (_udpConfig->isTransmitOnly()) { - _socket->setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, 0); - } else { - _socket->setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, 128 * 1024); - } + int bufferSizeMultiplier = 1; #else - _socket->setSocketOption(QAbstractSocket::SendBufferSizeSocketOption, 256 * 1024); - if (_udpConfig->isTransmitOnly()) { - _socket->setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, 0);; - } else { - _socket->setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, 512 * 1024);; - } + int bufferSizeMultiplier = 4; #endif + int receiveBufferSize = _udpConfig->isTransmitOnly() ? 0 : 512 * 1024; + _socket->setSocketOption(QAbstractSocket::SendBufferSizeSocketOption, bufferSizeMultiplier * 64 * 1024); + _socket->setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, bufferSizeMultiplier * receiveBufferSize); + _registerZeroconf(_udpConfig->localPort(), kZeroconfRegistration); QObject::connect(_socket, &QUdpSocket::readyRead, this, &UDPLink::readBytes); emit connected(); diff --git a/src/ui/preferences/MavlinkSettings.qml b/src/ui/preferences/MavlinkSettings.qml index d8a62b3fbce9f0ae1da84893310371e75f23fab3..b4c2deb00f2a8df641dfd3767f86d521ed5836ef 100644 --- a/src/ui/preferences/MavlinkSettings.qml +++ b/src/ui/preferences/MavlinkSettings.qml @@ -166,24 +166,22 @@ Rectangle { QGCLabel { width: _labelWidth anchors.baseline: mavlinkForwardingHostNameField.baseline - visible: QGroundControl.settingsManager.appSettings.forwardMavlink.rawValue && - QGroundControl.settingsManager.appSettings.forwardMavlink.visible + visible: QGroundControl.settingsManager.appSettings.forwardMavlink.visible text: qsTr("Host name:") } FactTextField { id: mavlinkForwardingHostNameField fact: QGroundControl.settingsManager.appSettings.forwardMavlinkHostName width: _valueWidth - visible: QGroundControl.settingsManager.appSettings.forwardMavlink.rawValue && - QGroundControl.settingsManager.appSettings.forwardMavlink.visible + visible: QGroundControl.settingsManager.appSettings.forwardMavlink.visible + enabled: QGroundControl.settingsManager.appSettings.forwardMavlink.rawValue anchors.verticalCenter: parent.verticalCenter } } QGCLabel { text: qsTr(" Changing the host name requires restart of application. ") - visible: QGroundControl.settingsManager.appSettings.forwardMavlink.rawValue && - QGroundControl.settingsManager.appSettings.forwardMavlink.visible + visible: QGroundControl.settingsManager.appSettings.forwardMavlink.visible } } }