Commit 7b5733de authored by Jacob Dahl's avatar Jacob Dahl

Updated from reviewer feedback

parent 44d8027d
...@@ -291,21 +291,16 @@ bool UDPLink::_hardwareConnect() ...@@ -291,21 +291,16 @@ bool UDPLink::_hardwareConnect()
if (_connectState) { if (_connectState) {
_socket->joinMulticastGroup(QHostAddress("224.0.0.1")); _socket->joinMulticastGroup(QHostAddress("224.0.0.1"));
//-- Make sure we have a large enough IO buffers //-- Make sure we have a large enough IO buffers
#ifdef __mobile__ #ifdef __mobile__
_socket->setSocketOption(QAbstractSocket::SendBufferSizeSocketOption, 64 * 1024); int bufferSizeMultiplier = 1;
if (_udpConfig->isTransmitOnly()) {
_socket->setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, 0);
} else {
_socket->setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, 128 * 1024);
}
#else #else
_socket->setSocketOption(QAbstractSocket::SendBufferSizeSocketOption, 256 * 1024); int bufferSizeMultiplier = 4;
if (_udpConfig->isTransmitOnly()) {
_socket->setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, 0);;
} else {
_socket->setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, 512 * 1024);;
}
#endif #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); _registerZeroconf(_udpConfig->localPort(), kZeroconfRegistration);
QObject::connect(_socket, &QUdpSocket::readyRead, this, &UDPLink::readBytes); QObject::connect(_socket, &QUdpSocket::readyRead, this, &UDPLink::readBytes);
emit connected(); emit connected();
......
...@@ -166,24 +166,22 @@ Rectangle { ...@@ -166,24 +166,22 @@ Rectangle {
QGCLabel { QGCLabel {
width: _labelWidth width: _labelWidth
anchors.baseline: mavlinkForwardingHostNameField.baseline anchors.baseline: mavlinkForwardingHostNameField.baseline
visible: QGroundControl.settingsManager.appSettings.forwardMavlink.rawValue && visible: QGroundControl.settingsManager.appSettings.forwardMavlink.visible
QGroundControl.settingsManager.appSettings.forwardMavlink.visible
text: qsTr("Host name:") text: qsTr("Host name:")
} }
FactTextField { FactTextField {
id: mavlinkForwardingHostNameField id: mavlinkForwardingHostNameField
fact: QGroundControl.settingsManager.appSettings.forwardMavlinkHostName fact: QGroundControl.settingsManager.appSettings.forwardMavlinkHostName
width: _valueWidth width: _valueWidth
visible: QGroundControl.settingsManager.appSettings.forwardMavlink.rawValue && visible: QGroundControl.settingsManager.appSettings.forwardMavlink.visible
QGroundControl.settingsManager.appSettings.forwardMavlink.visible enabled: QGroundControl.settingsManager.appSettings.forwardMavlink.rawValue
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
} }
QGCLabel { QGCLabel {
text: qsTr("<i> Changing the host name requires restart of application. </i>") text: qsTr("<i> Changing the host name requires restart of application. </i>")
visible: QGroundControl.settingsManager.appSettings.forwardMavlink.rawValue && visible: QGroundControl.settingsManager.appSettings.forwardMavlink.visible
QGroundControl.settingsManager.appSettings.forwardMavlink.visible
} }
} }
} }
......
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