summaryrefslogtreecommitdiff
path: root/src/serialport/qserialport_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/serialport/qserialport_p.h')
-rw-r--r--src/serialport/qserialport_p.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/serialport/qserialport_p.h b/src/serialport/qserialport_p.h
index a39bc22..571b0de 100644
--- a/src/serialport/qserialport_p.h
+++ b/src/serialport/qserialport_p.h
@@ -106,6 +106,19 @@ class QSocketNotifier;
QString serialPortLockFilePath(const QString &portName);
#endif
+class QSerialPortErrorInfo
+{
+public:
+ explicit QSerialPortErrorInfo(QSerialPort::SerialPortError errorCode = QSerialPort::UnknownError,
+ const QString &errorString = QString())
+ : errorCode(errorCode)
+ , errorString(errorString)
+ {
+ }
+ QSerialPort::SerialPortError errorCode;
+ QString errorString;
+};
+
class QSerialPortPrivate : public QIODevicePrivate
{
Q_DECLARE_PUBLIC(QSerialPort)
@@ -144,7 +157,9 @@ public:
bool setFlowControl(QSerialPort::FlowControl flowControl);
bool setDataErrorPolicy(QSerialPort::DataErrorPolicy policy);
- QSerialPort::SerialPortError decodeSystemError(int systemErrorCode = -1) const;
+ QSerialPortErrorInfo getSystemError(int systemErrorCode = -1) const;
+
+ void setError(const QSerialPortErrorInfo &errorInfo);
qint64 writeData(const char *data, qint64 maxSize);
@@ -237,11 +252,11 @@ public:
bool initialize(QIODevice::OpenMode mode);
bool updateTermios();
- QSerialPort::SerialPortError setBaudRate_helper(qint32 baudRate,
+ QSerialPortErrorInfo setBaudRate_helper(qint32 baudRate,
QSerialPort::Directions directions);
- QSerialPort::SerialPortError setCustomBaudRate(qint32 baudRate,
+ QSerialPortErrorInfo setCustomBaudRate(qint32 baudRate,
QSerialPort::Directions directions);
- QSerialPort::SerialPortError setStandardBaudRate(qint32 baudRate,
+ QSerialPortErrorInfo setStandardBaudRate(qint32 baudRate,
QSerialPort::Directions directions);
bool isReadNotificationEnabled() const;