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
@@ -7,8 +7,9 @@
IOSerial::IOSerial(const Profile &config) : IOLayer(config) {
m_read = 0l;
m_error = 0l;
m_fd = 0;
+ m_connected = false;
reload(config);
}
@@ -31,9 +32,11 @@ void IOSerial::close() {
delete m_read;
delete m_error;
::close(m_fd);
m_fd = 0;
+ m_connected = false;
} else {
+ m_connected = false;
emit error(Refuse, tr("Not connected"));
}
}
@@ -110,8 +113,9 @@ bool IOSerial::open() {
m_read = new QSocketNotifier(m_fd, QSocketNotifier::Read, this);
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"));
m_fd = 0;
@@ -193,4 +197,8 @@ QBitArray IOSerial::supports()const {
ar[1] = 1;
return ar;
}
+
+bool IOSerial::isConnected() {
+ return m_connected;
+}