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.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp
index 845f4be..4129d64 100644
--- a/noncore/apps/opie-console/io_serial.cpp
+++ b/noncore/apps/opie-console/io_serial.cpp
@@ -29,2 +29,3 @@ void IOSerial::send(const QByteArray &data) {
void IOSerial::close() {
+ qWarning("closing!");
if (m_fd) {
@@ -119,3 +120,3 @@ bool IOSerial::open() {
} else {
- qWarning("opened");
+ qWarning(" already opened");
emit error(Refuse, tr("Device is already connected"));
@@ -178,2 +179,7 @@ QString IOSerial::name() const {
int IOSerial::rawIO()const {
+ if (m_read )
+ disconnect(m_read, SIGNAL(activated(int)), this, SLOT(dataArrived()));
+ if (m_error )
+ disconnect(m_error, SIGNAL(activated(int)), this, SLOT(errorOccured()));
+
int fd = ::open(m_device, O_RDWR );
@@ -182 +188,9 @@ int IOSerial::rawIO()const {
};
+void IOSerial::closeRawIO(int fd) {
+ if (m_read )
+ connect(m_read, SIGNAL(activated(int)), this, SLOT(dataArrived()));
+ if (m_error )
+ connect(m_error, SIGNAL(activated(int)), this, SLOT(errorOccured()));
+
+ ::close( fd );
+}