summaryrefslogtreecommitdiff
path: root/src/serialport/qserialport.cpp
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2015-09-10 16:25:15 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2015-09-24 15:34:43 +0000
commita1655d6ccf3f82508286b471819cc5e5cb64ff44 (patch)
treedd1ef288de9177462c55b5597d52f8de7d8fd37f /src/serialport/qserialport.cpp
parent918b22aef140d293721f0d81ea8988c1d35db582 (diff)
downloadqtserialport-a1655d6ccf3f82508286b471819cc5e5cb64ff44.tar.gz
Cleanup remainders of code relating to data error policy handling
It is impossible to implement all these features on all platforms, and particular drivers may not support them, too. Consequently, the user should handle such errors themselves by applying platform-specific ioctls on the device descriptor and/or parsing the stream's byte-stuffing. This commit also deprecates ParityError, FramingError, and BreakConditionError. Tested on Windows and Linux with the virtual and the USB serial ports. Change-Id: I4ffc2f067787bc304a83326acb2a2421b428f986 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'src/serialport/qserialport.cpp')
-rw-r--r--src/serialport/qserialport.cpp24
1 files changed, 7 insertions, 17 deletions
diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp
index 071e33d..690eb65 100644
--- a/src/serialport/qserialport.cpp
+++ b/src/serialport/qserialport.cpp
@@ -63,15 +63,6 @@ QSerialPortErrorInfo::QSerialPortErrorInfo(QSerialPort::SerialPortError newError
case QSerialPort::TimeoutError:
errorString = QSerialPort::tr("Operation timed out");
break;
- case QSerialPort::ParityError:
- errorString = QSerialPort::tr("Parity error detected while reading");
- break;
- case QSerialPort::BreakConditionError:
- errorString = QSerialPort::tr("Break condition detected while reading");
- break;
- case QSerialPort::FramingError:
- errorString = QSerialPort::tr("Framing error detected while reading");
- break;
case QSerialPort::ReadError:
errorString = QSerialPort::tr("Error reading from device");
break;
@@ -99,18 +90,15 @@ QSerialPortPrivate::QSerialPortPrivate()
, parity(QSerialPort::NoParity)
, stopBits(QSerialPort::OneStop)
, flowControl(QSerialPort::NoFlowControl)
- , policy(QSerialPort::IgnorePolicy)
#if QT_DEPRECATED_SINCE(5,3)
, settingsRestoredOnClose(true)
#endif
, isBreakEnabled(false)
#if defined(Q_OS_WINCE)
, handle(INVALID_HANDLE_VALUE)
- , parityErrorOccurred(false)
, eventNotifier(0)
#elif defined(Q_OS_WIN32)
, handle(INVALID_HANDLE_VALUE)
- , parityErrorOccurred(false)
, readChunkBuffer(ReadChunkSize, 0)
, communicationStarted(false)
, writeStarted(false)
@@ -417,13 +405,16 @@ void QSerialPortPrivate::setError(const QSerialPortErrorInfo &errorInfo)
QtSerialPort 5.2.
\value ParityError Parity error detected by the hardware while
- reading data.
+ reading data. This value is obsolete. We strongly
+ advise against using it in new code.
\value FramingError Framing error detected by the hardware while
- reading data.
+ reading data. This value is obsolete. We strongly
+ advise against using it in new code.
\value BreakConditionError Break condition detected by the hardware on
- the input line.
+ the input line. This value is obsolete. We strongly
+ advise against using it in new code.
\value WriteError An I/O error occurred while writing the data.
@@ -1147,8 +1138,7 @@ bool QSerialPort::setDataErrorPolicy(DataErrorPolicy policy)
QSerialPort::DataErrorPolicy QSerialPort::dataErrorPolicy() const
{
- Q_D(const QSerialPort);
- return d->policy;
+ return QSerialPort::IgnorePolicy;
}
#endif // QT_DEPRECATED_SINCE(5, 2)