summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/test/senderui.cpp
Unidiff
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.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/test/senderui.cpp b/noncore/apps/opie-console/test/senderui.cpp
index 8bc1676..2ce3f6d 100644
--- a/noncore/apps/opie-console/test/senderui.cpp
+++ b/noncore/apps/opie-console/test/senderui.cpp
@@ -1,35 +1,36 @@
1#include <stdlib.h> 1#include <stdlib.h>
2#include <stdio.h> 2#include <stdio.h>
3#include <fcntl.h> 3#include <fcntl.h>
4#include <sys/termios.h> 4#include <sys/termios.h>
5 5
6#include <qmultilineedit.h> 6#include <qmultilineedit.h>
7#include <qsocketnotifier.h> 7#include <qsocketnotifier.h>
8 8
9#include "../profile.h" 9#include "../profile.h"
10#include "../io_serial.h" 10#include "../io_serial.h"
11#include "../filetransfer.h" 11#include "../filetransfer.h"
12#include "../filereceive.h"
12 13
13#include <opie/oprocess.h> 14#include <opie/oprocess.h>
14 15
15#include "senderui.h" 16#include "senderui.h"
16 17
17SenderUI::SenderUI() 18SenderUI::SenderUI()
18 : Sender() { 19 : Sender() {
19 20
20 /* we do that manually */ 21 /* we do that manually */
21 Profile prof; 22 Profile prof;
22 QString str = "/dev/ttyS0"; 23 QString str = "/dev/ttyS0";
23 prof.writeEntry("Device",str ); 24 prof.writeEntry("Device",str );
24 prof.writeEntry("Baud", 115200 ); 25 prof.writeEntry("Baud", 115200 );
25 26
26 qWarning("prof " + prof.readEntry("Device") + " " + str); 27 qWarning("prof " + prof.readEntry("Device") + " " + str);
27 ser = new IOSerial(prof); 28 ser = new IOSerial(prof);
28 connect(ser, SIGNAL(received(const QByteArray& ) ), 29 connect(ser, SIGNAL(received(const QByteArray& ) ),
29 this, SLOT(got(const QByteArray&) ) ); 30 this, SLOT(got(const QByteArray&) ) );
30 31
31 if ( ser->open() ) 32 if ( ser->open() )
32 qWarning("opened!!!"); 33 qWarning("opened!!!");
33 else 34 else
34 qWarning("could not open"); 35 qWarning("could not open");
35 36
@@ -45,24 +46,30 @@ void SenderUI::slotSendFile() {
45 46
46 connect (sz, SIGNAL(sent()), 47 connect (sz, SIGNAL(sent()),
47 this, SLOT(fileTransComplete())); 48 this, SLOT(fileTransComplete()));
48} 49}
49 50
50void SenderUI::slotSend() { 51void SenderUI::slotSend() {
51 QCString str = MultiLineEdit1->text().utf8(); 52 QCString str = MultiLineEdit1->text().utf8();
52 qWarning("sending: %s", str.data() ); 53 qWarning("sending: %s", str.data() );
53 ser->send( str ); 54 ser->send( str );
54} 55}
55void SenderUI::got(const QByteArray& ar) { 56void SenderUI::got(const QByteArray& ar) {
56 for ( uint i = 0; i < ar.count(); i++ ) { 57 for ( uint i = 0; i < ar.count(); i++ ) {
57 printf("%c", ar[i] ); 58 printf("%c", ar[i] );
58 } 59 }
59 //printf("\n"); 60 //printf("\n");
60} 61}
61 62
62void SenderUI::fileTransComplete() { 63void SenderUI::fileTransComplete() {
63 64
64 qWarning("file transfer complete"); 65 qWarning("file transfer complete");
65} 66}
66void SenderUI::send() { 67void SenderUI::send() {
67 68
68} 69}
70void SenderUI::slotRev(){
71qWarning("Going to receive!");
72FileReceive *rev = new FileReceive( FileReceive::SZ, ser );
73rev->receive();
74
75} \ No newline at end of file