summaryrefslogtreecommitdiffstats
path: root/src/serialportengine_unix.cpp
diff options
context:
space:
mode:
authorDenis Shienkov <scapig@yandex.ru>2012-03-28 18:19:39 +0400
committerDenis Shienkov <scapig@yandex.ru>2012-03-28 17:11:25 +0200
commit28cc50d4f4af43114a05a543b6ce7326ea0c0c1a (patch)
tree60a3080681b9d0f717d9e318ca2275b4d96096df /src/serialportengine_unix.cpp
parent933a1640656c480ed05c0268c8cac3c8925396c3 (diff)
SerialPort, optimization notification and I/O subsystems.
Change-Id: I0200f66b0786557aa0c884d94027e58ee0ec53e4 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <scapig@yandex.ru>
Diffstat (limited to 'src/serialportengine_unix.cpp')
-rwxr-xr-xsrc/serialportengine_unix.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/serialportengine_unix.cpp b/src/serialportengine_unix.cpp
index e81d88d9..8da52051 100755
--- a/src/serialportengine_unix.cpp
+++ b/src/serialportengine_unix.cpp
@@ -930,6 +930,32 @@ void UnixSerialPortEngine::setWriteNotificationEnabled(bool enable)
}
/*!
+ Returns the current status of the errors notification subsystem.
+*/
+bool UnixSerialPortEngine::isErrorNotificationEnabled() const
+{
+ return (m_exceptionNotifier && m_exceptionNotifier->isEnabled());
+}
+
+/*!
+ Enables or disables errors notification subsystem, depending on
+ the \a enable parameter. If the subsystem is enabled, it will
+ asynchronously track the occurrence of an event fderror.
+*/
+void UnixSerialPortEngine::setErrorNotificationEnabled(bool enable)
+{
+ if (m_exceptionNotifier)
+ m_exceptionNotifier->setEnabled(enable);
+ else if (enable) {
+ m_exceptionNotifier =
+ new QSocketNotifier(m_descriptor, QSocketNotifier::Exception, this);
+
+ m_exceptionNotifier->installEventFilter(this);
+ m_exceptionNotifier->setEnabled(true);
+ }
+}
+
+/*!
Not used in POSIX implementation, error handling is carried
out in other ways.