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.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp
index 77ced85..929aeff 100644
--- a/noncore/apps/opie-console/io_serial.cpp
+++ b/noncore/apps/opie-console/io_serial.cpp
@@ -40,3 +40,5 @@ void IOSerial::close() {
bool IOSerial::open() {
+ qWarning("open");
if (!m_fd) {
+ qWarning("going to open %s", m_device.latin1());
struct termios tty;
@@ -44,2 +46,3 @@ bool IOSerial::open() {
if (m_fd < 0) {
+ qWarning(" fd < 0 ");
emit error(CouldNotOpen, strerror(errno));
@@ -52,2 +55,3 @@ bool IOSerial::open() {
if (speed == -1) {
+ qWarning("speed -1");
emit error(Refuse, tr("Invalid baud rate"));
@@ -115,2 +119,3 @@ bool IOSerial::open() {
} else {
+ qWarning("opened");
emit error(Refuse, tr("Device is already connected"));
@@ -123,2 +128,4 @@ void IOSerial::reload(const Profile &config) {
m_device = config.readEntry("Device", SERIAL_DEFAULT_DEVICE);
+ qWarning( "Dev" +m_device );
+ qWarning( "Conf:" +config.readEntry("Device") );
m_baud = config.readNumEntry("Baud", SERIAL_DEFAULT_BAUD);
@@ -152,6 +159,5 @@ void IOSerial::errorOccured() {
void IOSerial::dataArrived() {
- QByteArray array;
- char buf[4096];
+ QByteArray array(4096);
- int len = read(m_fd, buf, 4096);
+ int len = read(m_fd, array.data(), 4096);
if (len == 0)
@@ -160,3 +166,3 @@ void IOSerial::dataArrived() {
return;
- array.setRawData(buf, len);
+ array.resize( len );
emit received(array);