Page 1 of 1

Send file via bluetooth.

Posted: Tue Mar 14, 2006 8:57 am
by tlongbk
Hi everyone!!!
I'm a beginner in Bluetooth. I'm writing a program which can send file from my computer to my mobile via Bluetooth. I don't know how to do it. Please help me.
I write by Visual basic and Visual C#.NET

Thanks a lot.
tlongbk
University of Technology.

RE: Send file via bluetooth.

Posted: Tue Mar 14, 2006 9:47 am
by Jonas
Look at the samples provided with BlueTools v1.1.
Object Push and Obex FTP Client is two ways of sending files to your cell phone via Bluetooth.


Regards,
Jonas
Franson Support

RE: Send file via bluetooth.

Posted: Thu Mar 16, 2006 8:20 pm
by wangll
I have 2 question :
1) I am using OBEXObjectPush service and PushFileAsync to push files to Remote devices. I am trying to get the remote device name in PutFileEnd event function, is it possible? If yes, how can i do it?

2) I realised for my codes if i send file the second time, event such as "ServiceDiscoveryCompleted" will called twice. Is there a way i can clear all events before the next send?

Thanks
Best Regards

RE: Send file via bluetooth.

Posted: Thu Mar 16, 2006 8:38 pm
by Jonas
1. No, the only thing that is available on PutFileEnd is the Stream that is used to retrieve the bytes being sent.

2. It's because you are adding the event handler several times. Either remove the event handlers on ServiceDiscoveryCompleted or don't add the event handlers more than once :)

Regards,
Jonas
Franson Support

RE: Send file via bluetooth.

Posted: Thu Mar 16, 2006 8:47 pm
by wangll
I am actually looping through a list of remote devices then sending out a file to these devices. How can i know the status for each device whether they accepted or aborted?

Then as i loop through the devices I added in the event handlers, for eg if 2 devices detected I will add in the event handlers twice, so that the 2 devices can received the file or is there a better way of doing?

Please advise.

Thanks :)
Best Regards

RE: Send file via bluetooth.

Posted: Fri Mar 17, 2006 7:45 pm
by Jonas
1. If you mean accepting the actual connection (to a cell phone for example) you'll know that the device accepted when you receive the actual Stream. Otherwise getting the stream will throw an exception.

2. If you want to send one file to each device and want to identify each successful send seperately you should create a new ObexObjectPush object for each send. Adding several event handlers only means that you will call the event handler as many times. It won't just use the latest event handler for the next send.

Regards,
Jonas
Franson Support