Reduce serial timeout

This commit is contained in:
BlackMark 2020-07-05 00:14:14 +02:00
parent 018905bc4c
commit 03de89be11

View File

@ -89,12 +89,12 @@ bool SensorDriver::getSensorCommandResponse(const QString& serialPortName, QByte
.arg(serialPort.errorString())); .arg(serialPort.errorString()));
return false; return false;
} }
else if(!serialPort.waitForBytesWritten(500)) { else if(!serialPort.waitForBytesWritten(100)) {
qCritical(ltr("Writing operation timed out for serial port %1, error: %2").arg(serialPortName).arg(serialPort.errorString())); qCritical(ltr("Writing operation timed out for serial port %1, error: %2").arg(serialPortName).arg(serialPort.errorString()));
return false; return false;
} }
while(serialPort.waitForReadyRead(500)) { while(serialPort.waitForReadyRead(100)) {
const auto newData = serialPort.readAll(); const auto newData = serialPort.readAll();
qDebug(ltr("Read additional %1 bytes from serial port %2").arg(newData.size()).arg(serialPortName)); qDebug(ltr("Read additional %1 bytes from serial port %2").arg(newData.size()).arg(serialPortName));
response.append(newData); response.append(newData);