mazin
Posts: 2
Joined: Sat Oct 15, 2005 4:54 am

Sending a File from a PC to phone

Sat Oct 15, 2005 4:59 am

Hi I am new to this so take it easy on me. I want to ask u if have a sample code on sending a file from the PC to the phone. I looked in the samples and the Object Push in the FindAndConnect seems to connect but not send anything. can u post some code that would make it send a Picture or a txt file to the phone?

Thx in Advance!

Mazin

mazin
Posts: 2
Joined: Sat Oct 15, 2005 4:54 am

RE: Sending a File from a PC to phone

Sat Oct 15, 2005 4:53 pm

By the way I am using C#.

Mazin

ppsihoza
Posts: 5
Joined: Thu Oct 20, 2005 2:16 pm
Location: Romania

RE: Sending a File from a PC to phone

Thu Oct 20, 2005 2:18 pm

Hello. I also need to receive files from mobile phones. How can i do this? my application is a desktop c# app. Is possible to do this with this devKit?

Andreas2
Posts: 108
Joined: Sun Feb 13, 2005 3:19 pm

RE: Sending a File from a PC to phone

Thu Oct 20, 2005 3:35 pm

Hi!

There is currently on explicit support for file transfers. File transfers rely on a protocol called Object Exchange Protocol (OBEX), which is a high level protocol. This is required, so the devices can understand eachother on a higher level than the supported low level protocols.

The protocol stack looks like this (simplified):

OBEX File Transfer (Agreement on how to respond to packages)
OBEX (Protocol for sending get/put packages)
RFCOMM (Binary connection)

So OBEX File Transfer relies on OBEX. OBEX is currently not supported, but RFCOMM is. Therefore, you can look at the OBEX specification available at http://www.irda.org to implement OBEX communication. You can then look at http://www.bluetooth.org to find out which packets to send to initiate a file transfer.

Regards,
Andreas Nilsson
Franson Support

ppsihoza
Posts: 5
Joined: Thu Oct 20, 2005 2:16 pm
Location: Romania

RE: Sending a File from a PC to phone

Thu Oct 20, 2005 4:11 pm

Then how can i send and receive binary data.Is this provided by BlueTools beta4 ? and what are the methods. thx.

ppsihoza
Posts: 5
Joined: Thu Oct 20, 2005 2:16 pm
Location: Romania

RE: Sending a File from a PC to phone

Fri Oct 21, 2005 12:41 pm

has anyone managed to implement obex? or to transfer files from a MobilePhone to the Pc. I have to make an application that runs on a PC, and waits for users with phones to copy files to it. And the only thing that the mobile user have to do is to use send file via bluetooth from phone, no interaction with the server. Can this be done by this SDK? becouse i searched and tried different solutions and with poor results.
Thx.

SurferMatti
Posts: 27
Joined: Tue Mar 01, 2005 11:04 pm

RE: Sending a File from a PC to phone

Mon Oct 24, 2005 11:28 pm

I'm also trying to do a something simliar. I would like to write a small app that makes a connection to a nearby bluetooth device (hopefully the cloestest one) and then pushes it a file via bluetooth.
I've used fransons gps sdk in the past to do some work and it worked out really well, but the gps stuff has some really good examples to help out...
Im working on the rfcomm thing and trying to figure how to make the connection... Ill let you guys know if i figure it out...


~SurferMatti

jnowaskey
Posts: 1
Joined: Thu Oct 27, 2005 6:23 pm
Location: USA

RE: Sending a File from a PC to phone

Thu Oct 27, 2005 6:26 pm

I am trying to do a similar app - to push files from a pc to a phone.
I also used Franson's GPS software with excellent results. I am not concerned with the transfer mechanism (obex or rfcomm or another) and I could write the app in C# or VB (but would prefer VB). Any help or advice would be greatly appreciated.

ppsihoza
Posts: 5
Joined: Thu Oct 20, 2005 2:16 pm
Location: Romania

RE: Sending a File from a PC to phone

Fri Oct 28, 2005 3:41 pm

Hi. I have a question. In the FindAndConnect example, when i click a service, the code is this:
// Connect to service by reading its Stream
currentStream = currentService.Stream;

currentStream.BeginRead(m_buffer, 0, m_buffer.Length,
new AsyncCallback(readCallback),m_buffer);

closeConnection.Enabled = true;
serviceList.Enabled = false;
lStatus.Text = "Receiving data...";
.
My question is: what hapands? I tested with an IPaq, and the iPaq ask if i'm agree to make data transfer. I select ok, and after that nothing happens.
What kind of data come thru this stream? the code never reach the readCallBack.
I'm a little confused about how data are transmited.

The iPaq ask me also, when i connect with widcomm software to iPaq Obex File transfer, if i'm agree to make data transfer. I select ok to the iPaq, and then a windows pop up with the files contained by my iPaq.

I don't know if i expressed myself clearly, i'm not so good at writing and speaking english.

Thx.

ppsihoza
Posts: 5
Joined: Thu Oct 20, 2005 2:16 pm
Location: Romania

RE: Sending a File from a PC to phone

Mon Oct 31, 2005 4:21 pm

Hi. I got one more question. I want to implement Obex protocol, and then file transfer. I want to know if this can be done using this sdk. So my question is:
How can i send a connect reguest
I'm using Find and Connect example and at this line:

currentStream = currentService.Stream;

i guess i have a stream witch send and receive data from rfcomm...

What bytes should i write down to stream to make a Obex Connect request.


currentStream.Write( bytes );
currentStream.Flush();


Thanks for your attention, and please reply.

Return to “BlueTools”