summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/io_serial.cpp
Unidiff
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,11 +1,13 @@
1 1
2#include <fcntl.h> 2#include <fcntl.h>
3#include <termios.h> 3#include <termios.h>
4#include <errno.h> 4#include <errno.h>
5#include <unistd.h> 5#include <unistd.h>
6#include <stdio.h>
7
6#include "io_serial.h" 8#include "io_serial.h"
7 9
8IOSerial::IOSerial(const Profile &config) : IOLayer(config) { 10IOSerial::IOSerial(const Profile &config) : IOLayer(config) {
9 m_read = 0l; 11 m_read = 0l;
10 m_error = 0l; 12 m_error = 0l;
11 m_fd = 0; 13 m_fd = 0;
@@ -161,12 +163,17 @@ void IOSerial::dataArrived() {
161 163
162 int len = read(m_fd, array.data(), 4096); 164 int len = read(m_fd, array.data(), 4096);
163 if (len == 0) 165 if (len == 0)
164 close(); 166 close();
165 if (len < 0) 167 if (len < 0)
166 return; 168 return;
169 qWarning("got from layer");
170 for (int i = 0; i < len; i++ ) {
171 printf("%c", array[i] );
172 }
173 printf("\n");
167 array.resize( len ); 174 array.resize( len );
168 emit received(array); 175 emit received(array);
169} 176}
170 177
171QString IOSerial::identifier() const { 178QString IOSerial::identifier() const {
172 return "serial"; 179 return "serial";