You Are Here:

Community: Developer Discussion Boards

#1 Old Reverse file transfer from obex server to obex client - 2008-12-02, 06:21

Join Date: Apr 2008
Posts: 459
Location: India
pawan_G's Avatar
pawan_G
Online
Regular Contributor
Hello All,

My requirement is ...

first i have to transfer the file from CObexClient (Master) to CObexServer (Listener)...... Which normal one....

When this transfer is complete and connection is same (establised by the client ) .. now i want to transfer a file from server to client....

Hw can i do this...
Reply With Quote

#2 Old Re: Reverse file transfer from obex server to obex client - 2008-12-02, 06:57

Join Date: Apr 2008
Posts: 459
Location: India
pawan_G's Avatar
pawan_G
Online
Regular Contributor
i Found something in SDK

COBexServer::GetRequestIndication() : CObexBufObject*

GetPacketIndication() : TInt

GetCompleteIndication() : TInt

and CObexClient::Get(CObexBaseObject &aObject, TRequestStatus &aStatus);

but i dont know hw to use them....
Last edited by pawan_G : 2008-12-02 at 07:44.
Reply With Quote

#3 Old Re: Reverse file transfer from obex server to obex client - 2008-12-02, 07:10

Join Date: Mar 2004
Posts: 1,926
Location: Czech Republic
stenlik's Avatar
stenlik
Offline
Forum Nokia Champion
Hi,

I'm not sure this is what you are looking for. This is the part of the new OBEX API added in Symbian 9.2. to hav asynchronous behavior of the MObexServerNotify - check new mixin class MObexServerNotifyAsync. Your method is used to complete the call of a Put(Get)RequestIndication().

BR
STeN
Reply With Quote

#4 Old Re: Reverse file transfer from obex server to obex client - 2008-12-02, 08:02

Join Date: Apr 2008
Posts: 459
Location: India
pawan_G's Avatar
pawan_G
Online
Regular Contributor
yes that is the thing i want .... i read SDK and found that Get() API will request to send the file from the Server.... and in response to Get()....
Quote:
COBexServer::GetRequestIndication() : CObexBufObject*

GetPacketIndication() : TInt

GetCompleteIndication() : TInt
these functions are called .... but now i have to return the object from server in
Quote:
COBexServer CObexBufObject*::GetRequestIndication()
... and i have one file which i have to send back to the client.... how can i conver the file to the CObexBufObject type object...
Reply With Quote

#5 Old Re: Reverse file transfer from obex server to obex client - 2008-12-02, 12:26

Join Date: Apr 2008
Posts: 459
Location: India
pawan_G's Avatar
pawan_G
Online
Regular Contributor
i Got it.... that how to use Get() and hw to get the response in server... but getting some prob.. as soon as i will resolve it.. i will give detail of it..
thanx
Reply With Quote

#6 Old Re: Reverse file transfer from obex server to obex client - 2008-12-02, 13:50

Join Date: Apr 2008
Posts: 459
Location: India
pawan_G's Avatar
pawan_G
Online
Regular Contributor
Hello All,

I got stuch at the last point ... nw m able to Use the Get() API in client side successfully... and i m getting notification at server side also.....

my Get() request complete successfully but file is not updating...

here is the code

For Client side
Code:
RFs fs;
	RFile file;
	fs.Connect();
	file.Replace(fs,_L("C:\\Data\\ContDB.DB"),EFileWrite);
	file.Close();
	fs.Close();
	_LIT(aName,"C:\\Data\\ContDB.DB");
	TBuf <256> buf(aName);
	iObexMasterBufObject=NULL;
	CBufFlat *aDataBuf = CBufFlat::NewL(1024);
	iObexMasterBufObject = CObexBufObject::NewL(aDataBuf);
	iObexMasterBufObject->SetNameL(buf);
	iObexClientMaster->Get(*iObexMasterBufObject, iStatus);
	SetActive();
and Server code

Code:
CObexBufObject* CBTCommEngineSlave::GetRequestIndication(
		CObexBaseObject *aRequiredObject)
	{
	RFs fs;
	RFile file;
	fs.Connect();
	file.Open(fs,_L("C:\\Data\\ContDB.DB"),EFileRead);
	TInt Size;
	file.Size(Size);
	iObject = CBufFlat::NewL(Size);
	HBufC8* fileBuf = HBufC8::NewLC (Size);
	TPtr8 fileBufPtr = fileBuf->Des ();
	//HBuf8 ptr = HBuf8::New(Size);
	file.Read(fileBufPtr);
	TInt i=0;
	//iObject->Write(i,fileBufPtr);
	iObject->InsertL(0,fileBufPtr);
	iObexBufObject = CObexBufObject::NewL(iObject);
	CleanupStack::PopAndDestroy();
	return iObexBufObject;
	}

TInt CBTCommEngineSlave::GetPacketIndication()
	{
return KErrNone;
	}

TInt CBTCommEngineSlave::GetCompleteIndication()
	{
return KErrNone;
	}
Reply With Quote

#7 Old Re: Reverse file transfer from obex server to obex client - 2008-12-03, 04:57

Join Date: Apr 2008
Posts: 459
Location: India
pawan_G's Avatar
pawan_G
Online
Regular Contributor
Finally i did it......

This was the line which created trouble... when i add this call every thing was fine....

iObexMasterBufObject->SetDataBufL(buf/*Name of the File*/);
Last edited by pawan_G : 2008-12-03 at 05:36.
Reply With Quote

#8 Old Re: Reverse file transfer from obex server to obex client - 2008-12-03, 12:24

Join Date: Oct 2008
Posts: 26
markwilson
Offline
Registered User
hi pawan ,

i want help from u , if u dnt mine can u tell me
how u done this ,

File Transferring form server to client and vice versa.
hei but one thing im using Netbeas6.0 IDE for development .

plz help me ,
Thank You,

or can u send me sample code on my mail id
markwilson1@mail.com

Thanx again
Reply With Quote

#9 Old Re: Reverse file transfer from obex server to obex client - 2008-12-08, 05:03

Join Date: Apr 2008
Posts: 459
Location: India
pawan_G's Avatar
pawan_G
Online
Regular Contributor
Hello markwilson,
An example is thr using Obex file transfer on forum... for both C++ and J2ME... u can try that.....
Reply With Quote

#10 Old Re: Reverse file transfer from obex server to obex client - 2008-12-11, 05:45

Join Date: Oct 2008
Posts: 26
markwilson
Offline
Registered User
hi pawan ,

thanx for reply , can u give me link of that application
my requirement is i want to send a file on another machine /mobile
but i m using j2me ,Netbeans6.0 IDE,


ya i have also seen ur file transfer example using C++ but dear i want in j2me ,

so plz specify that application link
or can u send me any other source on my mail id markwilson1@mail.com
thankx waiting for reply.

Mark
Reply With Quote

#11 Old Re: Reverse file transfer from obex server to obex client - 2008-12-15, 05:05

Join Date: Apr 2008
Posts: 459
Location: India
pawan_G's Avatar
pawan_G
Online
Regular Contributor
Sorry... i did only for C++.. no idea abt J2ME
Reply With Quote

#12 Old Re: Reverse file transfer from obex server to obex client - 2008-12-15, 08:09

Join Date: Jul 2008
Posts: 3
shcdsp
Offline
Registered User
Hi Pawan,

I am relatively new to Symbian C++ yet I am have been assigned to look into the Bluetooth application.

I request your help. If you dont mind could you please share your code for C++ with me. The code for Receiving files through OBEX in the mobile.

Thanks and Regards,

Shomik.
Reply With Quote

#13 Old Re: Reverse file transfer from obex server to obex client - 2008-12-15, 08:10

Join Date: Jul 2008
Posts: 3
shcdsp
Offline
Registered User
Hi Pawan,

I am relatively new to Symbian C++ yet I am have been assigned to look into the Bluetooth application.

I request your help. If you dont mind could you please share your code for C++ with me. The code for Receiving files through OBEX in the mobile.

My e-mail Id is shc.dsp@gmail.com

Thanks and Regards,

Shomik.
Reply With Quote

#14 Old Re: Reverse file transfer from obex server to obex client - 2008-12-16, 04:56

Join Date: Apr 2008
Posts: 459
Location: India
pawan_G's Avatar
pawan_G
Online
Regular Contributor
You can follow the following link to understand the Obex framework... it will help u to Send the file from client to server...

http://discussion.forum.nokia.com/fo...d.php?p=505141

and to receive the file in server try this out

Quote:
CObexBufObject* PutRequestIndication()
{
delete iObexBufObject;
iObexBufObject = NULL;
iFs.Delete( *iTempFile);
TRAPD(err,
{
iObexBufObject = CObexBufObject::NewL( NULL );
//The file is created if it doesn't exist
iObexBufObject->SetDataBufL( *iTempFile );
}
)
;
if (err)
{
delete iObexBufObject;
iObexBufObject=NULL;
return NULL;
}

return iObexBufObject;
}

TInt CBTCommEngineSlave::PutPacketIndication()
{
return KErrNone;
}

TInt PutCompleteIndication()
{
TFileName file = KTempFile();
TParsePtr parsePtr(file);
TFileName filename = parsePtr.DriveAndPath();
filename.Append(iObexBufObject->Name());

delete iObexBufObject;
iObexBufObject = NULL;

TInt err2 = BaflUtils::RenameFile(iFs, KTempFile, filename,
CFileMan::EOverWrite);
if (err2)
{
User::InfoPrint(_L("Rename Err occured"));
}
User::InfoPrint(_L("File Received Slave"));
return KErrNone;
}
at last sorry i dont have the actual link of the example... u can search for example u ll find.....

Thanx and Regards,
Pawan Gupta
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Tranfering file by bluetooth hassan83 Python 5 2008-04-18 18:01
[announce] PyUIQ. Python for UIQ 2.1 and 3.x OscarBernabeu Python 35 2008-01-17 10:12
Big problem in Obex File transfer lal.rajan Symbian Networking & Messaging 1 2007-03-31 06:17
client server programming in j2me mottaisami Mobile Java Networking & Messaging & Security 2 2006-09-05 15:43
What is the error in my code here? Unable to Save document to file yuva69 General Symbian C++ 1 2005-05-26 15:22

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia