diff options
Diffstat (limited to 'src/serialport/qserialport_win.cpp')
-rw-r--r-- | src/serialport/qserialport_win.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp index d0bb24c..d3eda5f 100644 --- a/src/serialport/qserialport_win.cpp +++ b/src/serialport/qserialport_win.cpp @@ -386,7 +386,7 @@ bool QSerialPortPrivate::setBaudRate() bool QSerialPortPrivate::setBaudRate(qint32 baudRate, QSerialPort::Directions directions) { if (directions != QSerialPort::AllDirections) { - setError(QSerialPortErrorInfo(QSerialPort::UnsupportedOperationError)); + setError(QSerialPortErrorInfo(QSerialPort::UnsupportedOperationError, QSerialPort::tr("Custom baud rate direction is unsupported"))); return false; } currentDcb.BaudRate = baudRate; @@ -675,18 +675,16 @@ void QSerialPortPrivate::handleLineStatusErrors() return; } - QSerialPortErrorInfo error; - if (errors & CE_FRAME) { - error.errorCode = QSerialPort::FramingError; + setError(QSerialPortErrorInfo(QSerialPort::FramingError, QSerialPort::tr("Framing error detected while reading"))); } else if (errors & CE_RXPARITY) { - error.errorCode = QSerialPort::ParityError; + setError(QSerialPortErrorInfo(QSerialPort::FramingError, QSerialPort::tr("ParityError error detected while reading"))); parityErrorOccurred = true; } else if (errors & CE_BREAK) { - error.errorCode = QSerialPort::BreakConditionError; + setError(QSerialPortErrorInfo(QSerialPort::BreakConditionError, QSerialPort::tr("Break condition detected while reading"))); + } else { + setError(QSerialPortErrorInfo(QSerialPort::UnknownError, QSerialPort::tr("Unknown streaming error"))); } - - setError(error); } inline bool QSerialPortPrivate::initialize() |