Initiating a put operation from the server

3 views
Skip to first unread message

Nima

unread,
Aug 24, 2008, 9:22:04 PM8/24/08
to bluecove-users
Hi all,

I need to perform a push operation from a bluetooth server upon
receiving a connection from a searching client. I have been searching
the Web to see if it is possible at all but I miserably failed in
finding a concrete yes or no answer.

Basically, what I am implementing is a Bluetooth server on my PC
which, upon receiving a connection from a searching mobile client, can
initiation a put operation to the client. Sending a file using OBEX
put from a client to a server is trivial, but I wonder if it can be
done the other way round?

As I am new to programming for bluetooth devices, I would highly
appreciate any help on this topic.

thanks in advance,
-Nima

Vlad Skarzhevskyy

unread,
Aug 24, 2008, 11:24:24 PM8/24/08
to bluecov...@googlegroups.com
If you write your own client and server application nothing is stopping you from sending any type of data.
But if you want the default obex implementation to run on the client you would need to open another connection from server. For this on your server you would need to capture the address of the client , then use this address in service search (while searching for OBEX) and then open new connection for OBEX put. Most probably you would need to close the original connection when making a second one.
--
Vlad

Nima

unread,
Aug 24, 2008, 11:40:39 PM8/24/08
to bluecove-users
Thanks a lot Vlad for your prompt response.

I understand that using RFCOMM and my own client and server I can
probably do whatever I need by developing my own protocol. But I would
like to try it out using OBEX. Would you kindly let me know how I can
get the address for the searching bluetooth client from the server
without a Put from a client? I hope my question is not too dumb!

I looked into the HeaderSets of an onConnect requst handler method but
they don't carry anything about the address of the client. Nor could I
find anything in Connection or SessionNotifier classes. All I could
infere from the Web was that, for a response you need to first get a
reference to an operation object which should be somehow initiated by
the searching/requesting client through a Put or Get operation. Am I
missing something here?

Thanks a lot,
-Nima

On Aug 24, 8:24 pm, "Vlad Skarzhevskyy" <skarzhevs...@gmail.com>
wrote:

Vlad Skarzhevskyy

unread,
Aug 24, 2008, 11:56:38 PM8/24/08
to bluecov...@googlegroups.com
serverConnection = (SessionNotifier) Connector.open("btgoep://");
Connection cconn = serverConnection.acceptAndOpen(handler);
RemoteDevice remoteDevice  = RemoteDevice.getRemoteDevice(cconn);

remoteDevice  is the device connected to your BT OBEX server
--
Vlad
Reply all
Reply to author
Forward
0 new messages