Diffstat (limited to 'noncore/apps/opie-console/test') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/test/senderui.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/noncore/apps/opie-console/test/senderui.cpp b/noncore/apps/opie-console/test/senderui.cpp index 2ce3f6d..4026808 100644 --- a/noncore/apps/opie-console/test/senderui.cpp +++ b/noncore/apps/opie-console/test/senderui.cpp @@ -1,75 +1,77 @@ #include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <sys/termios.h> #include <qmultilineedit.h> #include <qsocketnotifier.h> #include "../profile.h" #include "../io_serial.h" #include "../filetransfer.h" #include "../filereceive.h" #include <opie/oprocess.h> #include "senderui.h" SenderUI::SenderUI() : Sender() { /* we do that manually */ Profile prof; - QString str = "/dev/ttyS0"; + QString str = "/dev/bty0"; prof.writeEntry("Device",str ); - prof.writeEntry("Baud", 115200 ); + prof.writeEntry("Baud", 19200 ); 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::slotSendFile() { sz = new FileTransfer(FileTransfer::SY, ser); sz->sendFile("/home/ich/bootopie-v06-13.jffs2"); connect (sz, SIGNAL(sent()), this, SLOT(fileTransComplete())); } void SenderUI::slotSend() { QCString str = MultiLineEdit1->text().utf8(); qWarning("sending: %s", str.data() ); + str = str.replace( QRegExp("\n"), "\r"); ser->send( str ); } void SenderUI::got(const QByteArray& ar) { + qWarning("got:"); for ( uint i = 0; i < ar.count(); i++ ) { printf("%c", ar[i] ); } - //printf("\n"); + printf("\n"); } void SenderUI::fileTransComplete() { qWarning("file transfer complete"); } void SenderUI::send() { } void SenderUI::slotRev(){ qWarning("Going to receive!"); FileReceive *rev = new FileReceive( FileReceive::SZ, ser ); rev->receive(); -}
\ No newline at end of file +} |