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

Updated from reviewer feedback

parent 44d8027d
......@@ -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();
......
......@@ -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("<i> Changing the host name requires restart of application. </i>")
visible: QGroundControl.settingsManager.appSettings.forwardMavlink.rawValue &&
QGroundControl.settingsManager.appSettings.forwardMavlink.visible
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