author | korovkin <korovkin> | 2006-07-06 16:28:08 (UTC) |
---|---|---|
committer | korovkin <korovkin> | 2006-07-06 16:28:08 (UTC) |
commit | 43cd66c08de4447998028179d20fd4817aaf16ca (patch) (unidiff) | |
tree | 87888aadc3398c3c633e332cda46d92bb0522d6a /core/obex/obex.cpp | |
parent | adcfc6f4afe184a9eb6fbf458616494dfe0dadda (diff) | |
download | opie-43cd66c08de4447998028179d20fd4817aaf16ca.zip opie-43cd66c08de4447998028179d20fd4817aaf16ca.tar.gz opie-43cd66c08de4447998028179d20fd4817aaf16ca.tar.bz2 |
Added OBEX Push functionality for Bluetooth.
- Added ObexBase - asic class for IR and BT Obex
- Added ObexServer - OBEX Push server.
-rw-r--r-- | core/obex/obex.cpp | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/core/obex/obex.cpp b/core/obex/obex.cpp index 36634ec..95c561a 100644 --- a/core/obex/obex.cpp +++ b/core/obex/obex.cpp | |||
@@ -1,2 +1,32 @@ | |||
1 | /* | ||
2 | =. This file is part of the OPIE Project | ||
3 | .=l. Copyright (c) 2002 Maximilian Reiss <max.reiss@gmx.de> | ||
4 | .>+-= | ||
5 | _;:, .> :=|. This library is free software; you can | ||
6 | .> <, > . <= redistribute it and/or modify it under | ||
7 | :=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
8 | .="- .-=="i, .._ License as published by the Free Software | ||
9 | - . .-<_> .<> Foundation; version 2 of the License. | ||
10 | ._= =} : | ||
11 | .%+i> _;_. | ||
12 | .i_,=:_. -<s. This library is distributed in the hope that | ||
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
14 | : .. .:, . . . without even the implied warranty of | ||
15 | =_ + =;=| MERCHANTABILITY or FITNESS FOR A | ||
16 | _.=:. : :=>: PARTICULAR PURPOSE. See the GNU | ||
17 | ..}^=.= = ; Library General Public License for more | ||
18 | ++= -. . .: details. | ||
19 | : = ...= . :.=- | ||
20 | -. .:....=;==+<; You should have received a copy of the GNU | ||
21 | -_. . . )=. = Library General Public License along with | ||
22 | -- :-= this library; see the file COPYING.LIB. | ||
23 | If not, write to the Free Software Foundation, | ||
24 | Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | ||
26 | |||
27 | */ | ||
28 | /* | ||
29 | * The Infrared OBEX handling class implementation | ||
30 | */ | ||
1 | 31 | ||
2 | #include "obex.h" | 32 | #include "obex.h" |
@@ -17,14 +47,8 @@ using namespace Opie::Core; | |||
17 | 47 | ||
18 | Obex::Obex( QObject *parent, const char* name ) | 48 | Obex::Obex( QObject *parent, const char* name ) |
19 | : QObject(parent, name ) | 49 | : ObexBase(parent, name ) |
20 | { | 50 | { |
21 | m_rec = 0; | 51 | m_rec = 0; |
22 | m_send=0; | 52 | m_send=0; |
23 | m_count = 0; | ||
24 | m_receive = false; | ||
25 | connect( this, SIGNAL(error(int) ), // for recovering to receive | ||
26 | SLOT(slotError() ) ); | ||
27 | connect( this, SIGNAL(sent(bool) ), | ||
28 | SLOT(slotError() ) ); | ||
29 | }; | 53 | }; |
30 | Obex::~Obex() { | 54 | Obex::~Obex() { |
@@ -33,6 +57,5 @@ Obex::~Obex() { | |||
33 | } | 57 | } |
34 | void Obex::receive() { | 58 | void Obex::receive() { |
35 | m_receive = true; | 59 | ObexBase::receive(); |
36 | m_outp = QString::null; | ||
37 | m_rec = new OProcess(); | 60 | m_rec = new OProcess(); |
38 | *m_rec << "irobex_palm3"; | 61 | *m_rec << "irobex_palm3"; |
@@ -51,7 +74,7 @@ void Obex::receive() { | |||
51 | } | 74 | } |
52 | 75 | ||
53 | void Obex::send( const QString& fileName) { // if currently receiving stop it send receive | 76 | // if currently receiving stop it send receive |
54 | m_count = 0; | 77 | void Obex::send(const QString& fileName, const QString& addr) { |
55 | m_file = fileName; | 78 | ObexBase::send(fileName, addr); |
56 | if (m_rec != 0 ) { | 79 | if (m_rec != 0 ) { |
57 | if (m_rec->isRunning() ) { | 80 | if (m_rec->isRunning() ) { |
@@ -166,8 +189,10 @@ QString Obex::parseOut( ){ | |||
166 | */ | 189 | */ |
167 | void Obex::slotError() { | 190 | void Obex::slotError() { |
191 | ObexBase::slotError(); | ||
168 | if ( m_receive ) | 192 | if ( m_receive ) |
169 | receive(); | 193 | receive(); |
170 | }; | 194 | }; |
171 | void Obex::setReceiveEnabled( bool receive ) { | 195 | void Obex::setReceiveEnabled( bool receive ) { |
196 | ObexBase::setReceiveEnabled(receive); | ||
172 | if ( !receive ) { // | 197 | if ( !receive ) { // |
173 | m_receive = false; | 198 | m_receive = false; |