summaryrefslogtreecommitdiff
path: root/core/obex/btobex.cpp
Side-by-side diff
Diffstat (limited to 'core/obex/btobex.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/obex/btobex.cpp60
1 files changed, 46 insertions, 14 deletions
diff --git a/core/obex/btobex.cpp b/core/obex/btobex.cpp
index a5bfe5f..212a084 100644
--- a/core/obex/btobex.cpp
+++ b/core/obex/btobex.cpp
@@ -1 +1,31 @@
+/*
+               =. This file is part of the OPIE Project
+             .=l. Copyright (c) 2002 Maximilian Reiss <max.reiss@gmx.de>
+           .>+-=
+ _;:,     .>    :=|. This library is free software; you can
+.> <,   >  .   <= redistribute it and/or modify it under
+:=1 )Y*s>-.--   : the terms of the GNU Library General Public
+.="- .-=="i,     .._ License as published by the Free Software
+ - .   .-<_>     .<> Foundation; version 2 of the License.
+     ._= =}       :
+    .%+i>       _;_.
+    .i_,=:_.      -<s. This library is distributed in the hope that
+     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    : ..    .:,     . . . without even the implied warranty of
+    =_        +     =;=| MERCHANTABILITY or FITNESS FOR A
+  _.=:.       :    :=>: PARTICULAR PURPOSE. See the GNU
+..}^=.=       =       ; Library General Public License for more
+++=   -.     .     .: details.
+ :     =  ...= . :.=-
+ -.   .:....=;==+<; You should have received a copy of the GNU
+  -_. . .   )=.  = Library General Public License along with
+   --        :-= this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+/*
+ * The Bluetooth OBEX manipulating class implementation
+ */
@@ -22,3 +52,3 @@ using namespace OpieTooth;
BtObex::BtObex( QObject *parent, const char* name )
- : QObject(parent, name )
+ : ObexBase(parent, name )
{
@@ -26,8 +56,2 @@ BtObex::BtObex( QObject *parent, const char* name )
m_send=0;
- m_count = 0;
- m_receive = false;
- connect( this, SIGNAL(error(int) ), // for recovering to receive
- SLOT(slotError() ) );
- connect( this, SIGNAL(sent(bool) ),
- SLOT(slotError() ) );
btManager = NULL;
@@ -42,8 +66,7 @@ BtObex::~BtObex() {
void BtObex::receive() {
- m_receive = true;
- m_outp = QString::null;
- m_rec = new OProcess();
+ ObexBase::receive();
+ m_rec = new ObexServer();
+ odebug << "BT OBEX do receive" << oendl;
// TODO mbhaynie: No idea if this actually works -- maybe opd is better.
- *m_rec << "obexftpd" << "-b";
// connect to the necessary slots
@@ -63,6 +86,4 @@ void BtObex::receive() {
void BtObex::send( const QString& fileName, const QString& bdaddr) {
+ ObexBase::send(fileName, bdaddr);
// if currently receiving stop it send receive
- m_count = 0;
- m_file = fileName;
- m_bdaddr = bdaddr;
if (m_send != 0) {
@@ -152,2 +173,6 @@ void BtObex::sendNow(){
+ /*
+ * FIXME: this delay is made because some cell phones understands an error
+ * later.
+ */
::sleep(4);
@@ -173,2 +198,3 @@ void BtObex::slotExited(OProcess* proc ){
received();
+
}
@@ -179,2 +205,4 @@ void BtObex::slotStdOut(OProcess* proc, char* buf, int len){
m_outp.append( ar );
+ QCString str(buf, len);
+ odebug << str << oendl;
}
@@ -209,2 +237,3 @@ void BtObex::received() {
QString filename = parseOut();
+ odebug << "OBEX " << filename << " received" << oendl;
emit receivedFile( filename );
@@ -242,2 +271,3 @@ QString BtObex::parseOut(){
void BtObex::slotError() {
+ ObexBase::slotError();
if ( m_receive )
@@ -246,2 +276,4 @@ void BtObex::slotError() {
void BtObex::setReceiveEnabled( bool receive ) {
+ odebug << "BT OBEX setReceiveEnabled " << receive << oendl;
+ ObexBase::setReceiveEnabled(receive);
if ( !receive ) { //