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.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp
index 0540d9e..03e92dd 100644
--- a/noncore/apps/opie-console/io_serial.cpp
+++ b/noncore/apps/opie-console/io_serial.cpp
@@ -1,17 +1,19 @@
#include <fcntl.h>
#include <termios.h>
#include <errno.h>
#include <unistd.h>
+#include <stdio.h>
+
#include "io_serial.h"
IOSerial::IOSerial(const Profile &config) : IOLayer(config) {
m_read = 0l;
m_error = 0l;
m_fd = 0;
m_connected = false;
reload(config);
}
IOSerial::~IOSerial() {
@@ -155,24 +157,29 @@ void IOSerial::errorOccured() {
emit error(ClosedUnexpected, strerror(errno));
close();
}
void IOSerial::dataArrived() {
QByteArray array(4097);
int len = read(m_fd, array.data(), 4096);
if (len == 0)
close();
if (len < 0)
return;
+ qWarning("got from layer");
+ for (int i = 0; i < len; i++ ) {
+ printf("%c", array[i] );
+ }
+ printf("\n");
array.resize( len );
emit received(array);
}
QString IOSerial::identifier() const {
return "serial";
}
QString IOSerial::name() const {
return "RS232 Serial IO Layer";
}
int IOSerial::rawIO()const {