summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/io_serial.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/io_serial.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/io_serial.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp
index c10d5a8..b89a53b 100644
--- a/noncore/apps/opie-console/io_serial.cpp
+++ b/noncore/apps/opie-console/io_serial.cpp
@@ -8,6 +8,7 @@ IOSerial::IOSerial(const Profile &config) : IOLayer(config) {
m_read = 0l;
m_error = 0l;
m_fd = 0;
+ m_connected = false;
reload(config);
}
@@ -32,7 +33,9 @@ void IOSerial::close() {
delete m_error;
::close(m_fd);
m_fd = 0;
+ m_connected = false;
} else {
+ m_connected = false;
emit error(Refuse, tr("Not connected"));
}
}
@@ -111,6 +114,7 @@ bool IOSerial::open() {
m_error = new QSocketNotifier(m_fd, QSocketNotifier::Exception, this);
connect(m_read, SIGNAL(activated(int)), this, SLOT(dataArrived()));
connect(m_error, SIGNAL(activated(int)), this, SLOT(errorOccured()));
+ m_connected = false;
return TRUE;
} else {
emit error(Refuse, tr("Device is already connected"));
@@ -194,3 +198,7 @@ QBitArray IOSerial::supports()const {
return ar;
}
+
+bool IOSerial::isConnected() {
+ return m_connected;
+}