Diffstat (limited to 'noncore/apps/opie-console/test') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/test/senderui.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/noncore/apps/opie-console/test/senderui.cpp b/noncore/apps/opie-console/test/senderui.cpp index df27055..45fd11d 100644 --- a/noncore/apps/opie-console/test/senderui.cpp +++ b/noncore/apps/opie-console/test/senderui.cpp | |||
@@ -1,79 +1,79 @@ | |||
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 | #include "../filereceive.h" |
13 | 13 | ||
14 | #include <opie2/oprocess.h> | 14 | #include <opie2/oprocess.h> |
15 | 15 | ||
16 | #include "senderui.h" | 16 | #include "senderui.h" |
17 | 17 | ||
18 | using namespace Opie::Core; | 18 | using namespace Opie::Core; |
19 | using namespace Opie::Core; | 19 | using namespace Opie::Core; |
20 | SenderUI::SenderUI() | 20 | SenderUI::SenderUI() |
21 | : Sender() { | 21 | : Sender() { |
22 | 22 | ||
23 | /* we do that manually */ | 23 | /* we do that manually */ |
24 | Profile prof; | 24 | Profile prof; |
25 | QString str = "/dev/bty0"; | 25 | QString str = "/dev/bty0"; |
26 | prof.writeEntry("Device",str ); | 26 | prof.writeEntry("Device",str ); |
27 | prof.writeEntry("Baud", 19200 ); | 27 | prof.writeEntry("Baud", 19200 ); |
28 | 28 | ||
29 | qWarning("prof " + prof.readEntry("Device") + " " + str); | 29 | owarn << "prof " + prof.readEntry("Device") + " " + str << oendl; |
30 | ser = new IOSerial(prof); | 30 | ser = new IOSerial(prof); |
31 | connect(ser, SIGNAL(received(const QByteArray&) ), | 31 | connect(ser, SIGNAL(received(const QByteArray&) ), |
32 | this, SLOT(got(const QByteArray&) ) ); | 32 | this, SLOT(got(const QByteArray&) ) ); |
33 | 33 | ||
34 | if ( ser->open() ) | 34 | if ( ser->open() ) |
35 | qWarning("opened!!!"); | 35 | owarn << "opened!!!" << oendl; |
36 | else | 36 | else |
37 | qWarning("could not open"); | 37 | owarn << "could not open" << oendl; |
38 | 38 | ||
39 | 39 | ||
40 | } | 40 | } |
41 | SenderUI::~SenderUI() { | 41 | SenderUI::~SenderUI() { |
42 | 42 | ||
43 | } | 43 | } |
44 | void SenderUI::slotSendFile() { | 44 | void SenderUI::slotSendFile() { |
45 | 45 | ||
46 | sz = new FileTransfer(FileTransfer::SY, ser); | 46 | sz = new FileTransfer(FileTransfer::SY, ser); |
47 | sz->sendFile("/home/ich/bootopie-v06-13.jffs2"); | 47 | sz->sendFile("/home/ich/bootopie-v06-13.jffs2"); |
48 | 48 | ||
49 | connect (sz, SIGNAL(sent()), | 49 | connect (sz, SIGNAL(sent()), |
50 | this, SLOT(fileTransComplete())); | 50 | this, SLOT(fileTransComplete())); |
51 | } | 51 | } |
52 | 52 | ||
53 | void SenderUI::slotSend() { | 53 | void SenderUI::slotSend() { |
54 | QCString str = MultiLineEdit1->text().utf8(); | 54 | QCString str = MultiLineEdit1->text().utf8(); |
55 | qWarning("sending: %s", str.data() ); | 55 | owarn << "sending: " << str.data() << "" << oendl; |
56 | str = str.replace( QRegExp("\n"), "\r"); | 56 | str = str.replace( QRegExp("\n"), "\r"); |
57 | ser->send( str ); | 57 | ser->send( str ); |
58 | } | 58 | } |
59 | void SenderUI::got(const QByteArray& ar) { | 59 | void SenderUI::got(const QByteArray& ar) { |
60 | qWarning("got:"); | 60 | owarn << "got:" << oendl; |
61 | for ( uint i = 0; i < ar.count(); i++ ) { | 61 | for ( uint i = 0; i < ar.count(); i++ ) { |
62 | printf("%c", ar[i] ); | 62 | printf("%c", ar[i] ); |
63 | } | 63 | } |
64 | printf("\n"); | 64 | printf("\n"); |
65 | } | 65 | } |
66 | 66 | ||
67 | void SenderUI::fileTransComplete() { | 67 | void SenderUI::fileTransComplete() { |
68 | 68 | ||
69 | qWarning("file transfer complete"); | 69 | owarn << "file transfer complete" << oendl; |
70 | } | 70 | } |
71 | void SenderUI::send() { | 71 | void SenderUI::send() { |
72 | 72 | ||
73 | } | 73 | } |
74 | void SenderUI::slotRev(){ | 74 | void SenderUI::slotRev(){ |
75 | qWarning("Going to receive!"); | 75 | owarn << "Going to receive!" << oendl; |
76 | FileReceive *rev = new FileReceive( FileReceive::SZ, ser ); | 76 | FileReceive *rev = new FileReceive( FileReceive::SZ, ser ); |
77 | rev->receive(); | 77 | rev->receive(); |
78 | 78 | ||
79 | } | 79 | } |