summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/test/senderui.cpp
authorzecke <zecke>2002-10-09 14:25:38 (UTC)
committer zecke <zecke>2002-10-09 14:25:38 (UTC)
commitf9f2d227b3cfbc2187b4f7f535fc59f9735798d0 (patch) (unidiff)
tree7645623f7dde640222fab3e5ff0af0af3ae2f882 /noncore/apps/opie-console/test/senderui.cpp
parentff0caad7ea46d19f7a7916047fd0914f6f100dde (diff)
downloadopie-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.cpp47
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 @@
1#include <stdlib.h>
2#include <stdio.h>
3
4#include <qmultilineedit.h>
5
6#include "../profile.h"
7#include "../io_serial.h"
8
9
10#include "senderui.h"
11
12SenderUI::SenderUI()
13 : Sender() {
14
15 /* we do that manually */
16 Profile prof;
17 QString str = "/dev/ttyS0";
18 prof.writeEntry("Device",str );
19 prof.writeEntry("Baud", 115200 );
20
21 qWarning("prof " + prof.readEntry("Device") + " " + str);
22 ser = new IOSerial(prof);
23 connect(ser, SIGNAL(received(const QByteArray& ) ),
24 this, SLOT(got(const QByteArray&) ) );
25
26 if ( ser->open() )
27 qWarning("opened!!!");
28 else
29 qWarning("could not open");
30
31
32
33}
34SenderUI::~SenderUI() {
35
36}
37void SenderUI::slotSend() {
38 QCString str = MultiLineEdit1->text().utf8();
39 qWarning("sending: %s", str.data() );
40 ser->send( str );
41}
42void SenderUI::got(const QByteArray& ar) {
43 for ( uint i = 0; i < ar.count(); i++ ) {
44 printf("%c", ar[i] );
45 }
46 //printf("\n");
47}