author | zecke <zecke> | 2002-10-09 14:25:38 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-09 14:25:38 (UTC) |
commit | f9f2d227b3cfbc2187b4f7f535fc59f9735798d0 (patch) (side-by-side diff) | |
tree | 7645623f7dde640222fab3e5ff0af0af3ae2f882 /noncore/apps/opie-console/test/senderui.cpp | |
parent | ff0caad7ea46d19f7a7916047fd0914f6f100dde (diff) | |
download | opie-f9f2d227b3cfbc2187b4f7f535fc59f9735798d0.zip opie-f9f2d227b3cfbc2187b4f7f535fc59f9735798d0.tar.gz opie-f9f2d227b3cfbc2187b4f7f535fc59f9735798d0.tar.bz2 |
A small testsuite
the stuff from the remote goes to the stdout
There is a send button and a multilineedit
be sure to hit \n before sending...
Some debug code... in some files
debugged IOSerial it should be fine now
Diffstat (limited to 'noncore/apps/opie-console/test/senderui.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/test/senderui.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/test/senderui.cpp b/noncore/apps/opie-console/test/senderui.cpp new file mode 100644 index 0000000..fc93c04 --- a/dev/null +++ b/noncore/apps/opie-console/test/senderui.cpp @@ -0,0 +1,47 @@ +#include <stdlib.h> +#include <stdio.h> + +#include <qmultilineedit.h> + +#include "../profile.h" +#include "../io_serial.h" + + +#include "senderui.h" + +SenderUI::SenderUI() + : Sender() { + + /* we do that manually */ + Profile prof; + QString str = "/dev/ttyS0"; + prof.writeEntry("Device",str ); + prof.writeEntry("Baud", 115200 ); + + qWarning("prof " + prof.readEntry("Device") + " " + str); + ser = new IOSerial(prof); + connect(ser, SIGNAL(received(const QByteArray& ) ), + this, SLOT(got(const QByteArray&) ) ); + + if ( ser->open() ) + qWarning("opened!!!"); + else + qWarning("could not open"); + + + +} +SenderUI::~SenderUI() { + +} +void SenderUI::slotSend() { + QCString str = MultiLineEdit1->text().utf8(); + qWarning("sending: %s", str.data() ); + ser->send( str ); +} +void SenderUI::got(const QByteArray& ar) { + for ( uint i = 0; i < ar.count(); i++ ) { + printf("%c", ar[i] ); + } + //printf("\n"); +} |