×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    16

    Question Send a file via Bluetooth

    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?

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Re: Send a file via Bluetooth

    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

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    16

    Re: Send a file via Bluetooth

    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?

  4. #4
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,796

    Re: Send a file via Bluetooth

    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
    Pankaj Nathani
    www.croozeus.com

  5. #5
    Registered User
    Join Date
    Apr 2008
    Posts
    16

    Re: Send a file via Bluetooth

    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.

  6. #6
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,796

    Re: Send a file via Bluetooth

    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
    Pankaj Nathani
    www.croozeus.com

  7. #7
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Re: Send a file via Bluetooth

    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

Similar Threads

  1. Send and Receive a File with Bluetooth
    By gerardo.rossi in forum Bluetooth Technology
    Replies: 3
    Last Post: 2008-07-11, 18:28
  2. DRM for sending jar file via Bluetooth
    By yogesh.bhople in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 0
    Last Post: 2007-03-15, 12:14
  3. SEND FILE WITH BLUETOOTH using RFCOMM
    By Mich2424 in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-01-18, 16:54
  4. Send file via Bluetooth?
    By sblider in forum Symbian
    Replies: 1
    Last Post: 2003-02-15, 23:56
  5. Easiest way to send a file over Bluetooth on 7650?
    By MentalBlank in forum Bluetooth Technology
    Replies: 1
    Last Post: 2002-07-11, 06:42

Posting Permissions

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