summaryrefslogtreecommitdiffstats
path: root/src/serialportengine_unix.cpp
diff options
context:
space:
mode:
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.