You Are Here:

Community: Developer Discussion Boards

#1 Old Question Send a file via Bluetooth - 2008-05-15, 19:41

Join Date: Apr 2008
Posts: 16
bmichel's Avatar
bmichel
Offline
Registered User
I have successfully established a connection already between two mobile phones. This way I am able to send text.

For the server, the code looks like that:
Code:
server = socket.socket(socket.AF_BT, socket.SOCK_STREAM)
channel = socket.bt_rfcomm_get_available_server_channel(server)
server.bind(("", channel))
server.listen(1)
socket.bt_advertise_service(unicode(SERVICE_NAME), server, True, socket.RFCOMM)
socket.set_security(server, socket.AUTH | socket.AUTHOR)
conn, client_addr = server.accept()
fd = conn.makefile("rw", 0)
To read text, I simply use fd.readline() and to send text print >> fd, msg

What I'd like to do is send an image.
I don't want to use bt_obex_send_file because it requires the user to accept the file first although he already accepted the connection request earlier.

1- Is there some way to send the image via the already set up connection?
2- If not, is it possible to use bt_obex_send_file silently, without bothering the user? If yes, how do I do that and where are the received files stored?
Note: The mobile phones are not necessarily paired devices.

Any thoughts?
Reply With Quote

#2 Old Re: Send a file via Bluetooth - 2008-05-15, 21:00

Join Date: Mar 2003
Posts: 937
Location: Espoo, Finland
JOM's Avatar
JOM
Offline
Forum Nokia Champion
Quote:
Originally Posted by bmichel View Post
Note: The mobile phones are not necessarily paired devices.
Like you just said: pairing devices removes those dialogs and just moves the file(s). Without pairing I don't think it's possible?

Sorry,

--jouni
Reply With Quote

#3 Old Re: Send a file via Bluetooth - 2008-05-16, 12:50

Join Date: Apr 2008
Posts: 16
bmichel's Avatar
bmichel
Offline
Registered User
Isn't there some way to convert the Image to text format and send it from one end, and then receive the text and parse it back to an image on the other end?

Btw, regarding sending a file using obex, where does the file go to (the disk location) on the destination phone?
Reply With Quote

#4 Old Re: Send a file via Bluetooth - 2008-05-16, 13:04

Join Date: May 2007
Posts: 2,738
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Online
Forum Nokia Champion
Quote:
Originally Posted by bmichel View Post
Isn't there some way to convert the Image to text format and send it from one end, and then receive the text and parse it back to an image on the other end?

Btw, regarding sending a file using obex, where does the file go to (the disk location) on the destination phone?
This is a way of encoding. You can encode the image in form of text and decode it at the other end.

As Jouni already quoted, the bluetooth transfer on devices which are not paired cannot take place without the Dialog box approval on the client device. However, if the devices are paired and authorized to receive data from the other without approval then the dialogbox would not appear.

Best Regards,
Croozeus
Reply With Quote

#5 Old Re: Send a file via Bluetooth - 2008-05-16, 18:11

Join Date: Apr 2008
Posts: 16
bmichel's Avatar
bmichel
Offline
Registered User
Quote:
Originally Posted by croozeus View Post
This is a way of encoding. You can encode the image in form of text and decode it at the other end.Croozeus
Could you please elaborate? How do I do it code-wise, what library / method should I be using?

Quote:
Originally Posted by croozeus View Post
As Jouni already quoted, the bluetooth transfer on devices which are not paired cannot take place without the Dialog box approval on the client device. However, if the devices are paired and authorized to receive data from the other without approval then the dialogbox would not appear.Croozeus
A connection already exists between the two mobile phones (and the mobile already accepted the incoming connection), so there's no need to make the user do this a second time.
Reply With Quote

#6 Old Re: Send a file via Bluetooth - 2008-05-16, 18:25

Join Date: May 2007
Posts: 2,738
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Online
Forum Nokia Champion
Quote:
Originally Posted by bmichel View Post
A connection already exists between the two mobile phones (and the mobile already accepted the incoming connection), so there's no need to make the user do this a second time.
Right, if the connection already exists, then there is no need of further authorization.

Quote:
Originally Posted by bmichel View Post
Could you please elaborate? How do I do it code-wise, what library / method should I be using?
I can only guide you, write me an email through my screen name and I will try to help you.

Best Regards,
Croozeus
Reply With Quote

#7 Old Re: Send a file via Bluetooth - 2008-05-20, 21:40

Join Date: Mar 2003
Posts: 937
Location: Espoo, Finland
JOM's Avatar
JOM
Offline
Forum Nokia Champion
Quote:
Originally Posted by bmichel View Post
A connection already exists between the two mobile phones (and the mobile already accepted the incoming connection), so there's no need to make the user do this a second time.
Would be nice, but it doesn't work quite like that. User gave permission to ONE connection, not to ALL. Devices have to be paired to allow unlimited number of connections.

Cheers,

--jouni
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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
Send and Receive a File with Bluetooth gerardo.rossi Bluetooth Technology 3 2008-07-11 19:28
DRM for sending jar file via Bluetooth yogesh.bhople Installation, Certification and Security 0 2007-03-15 13:14
SEND FILE WITH BLUETOOTH using RFCOMM Mich2424 Symbian Networking & Messaging 0 2006-01-18 17:54
Send file via Bluetooth? sblider General Symbian C++ 1 2003-02-16 00:56
Easiest way to send a file over Bluetooth on 7650? MentalBlank Bluetooth Technology 1 2002-07-11 07:42

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