summaryrefslogtreecommitdiff
path: root/src/serialport/qserialport.h
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2014-12-30 13:38:05 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2015-01-15 20:57:33 +0100
commitb1005907d26a3e2f5dffaec93d656a0c1210961f (patch)
treeb5db77484d92536a995a8d822166bb0906eac8ef /src/serialport/qserialport.h
parent38f43b390e5b27f6243ba781394ad2418ead6b74 (diff)
downloadqtserialport-b1005907d26a3e2f5dffaec93d656a0c1210961f.tar.gz
Improve usage of the break state for the Tx line
1. Now the sendBreak() method is deprecated since it is blocking and impossible to implement same behavior on different platforms using their API's. Besides, this method can be implemented via setBreakEnabled() and QTimer. 2. Introduced the new property named as "breakEnabled" which consist of setBreakEnabled() and isBreakEnabled() methods and the signal breakEnabledChanged(). Note: After opening, the port always is in non-break state. Task-number: QTBUG-36571 Change-Id: Ib808dab7eaed8cc5449c66d8186a29a7b7e45afc Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'src/serialport/qserialport.h')
-rw-r--r--src/serialport/qserialport.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/serialport/qserialport.h b/src/serialport/qserialport.h
index 295869d..ebd748a 100644
--- a/src/serialport/qserialport.h
+++ b/src/serialport/qserialport.h
@@ -63,6 +63,7 @@ class Q_SERIALPORT_EXPORT QSerialPort : public QIODevice
#if QT_DEPRECATED_SINCE(5, 3)
Q_PROPERTY(bool settingsRestoredOnClose READ settingsRestoredOnClose WRITE setSettingsRestoredOnClose NOTIFY settingsRestoredOnCloseChanged)
#endif
+ Q_PROPERTY(bool breakEnabled READ isBreakEnabled WRITE setBreakEnabled NOTIFY breakEnabledChanged)
Q_ENUMS(BaudRate DataBits Parity StopBits FlowControl DataErrorPolicy SerialPortError)
Q_FLAGS(Directions PinoutSignals)
@@ -244,8 +245,11 @@ public:
bool waitForReadyRead(int msecs) Q_DECL_OVERRIDE;
bool waitForBytesWritten(int msecs) Q_DECL_OVERRIDE;
+#if QT_DEPRECATED_SINCE(5, 5)
bool sendBreak(int duration = 0);
+#endif
bool setBreakEnabled(bool set = true);
+ bool isBreakEnabled() const;
Handle handle() const;
@@ -260,6 +264,7 @@ Q_SIGNALS:
void requestToSendChanged(bool set);
void error(QSerialPort::SerialPortError serialPortError);
void settingsRestoredOnCloseChanged(bool restore);
+ void breakEnabledChanged(bool set);
protected:
qint64 readData(char *data, qint64 maxSize) Q_DECL_OVERRIDE;