×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    1

    Question how to send a value from openSUSE Linux to py60 mobile phone via bluetooth?

    Hi! Can anyone help me on how to send a value from my PC running on openSUSE Linux to my mobile phone via bluetooth.. i have developed a server program in C that should send a value to my mobile phone.

    My problem is, it seems that the program in python is indefintely waiting for the signal from the server...so it means that my phone seems not to receive the signal...

    This is the part of the program in Python for the mobile:
    sock = socket.socket(socket.AF_BT, socket.SOCK_STREAM, socket.BTPROTO_RFCOMM)
    target= (rma, port)
    sock.connect(target)
    appuifw.note(u"Connection Initialized!", 'info')
    sock.send('1')
    sock.send(oldpass)
    sock.send(newpass)
    line=sock.recv(32)
    if line == 'ROBERT':
    appuifw.note(u"Working!", 'info')
    else:
    appuifw.note(u"Not Working!", 'info')
    sock.close()

    THis is the code for the server:
    if((fd = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)) < 0) {
    perror("socket");
    exit(1);
    }

    send(fd, "ROBERT",5,1);

    I can send a value from the mobile phone to the server but i cant send a value from the server to the phone...

  2. #2
    Super Contributor
    Join Date
    May 2004
    Location
    Tampere, Finland
    Posts
    524

    Re: how to send a value from openSUSE Linux to py60 mobile phone via bluetooth?

    Quote Originally Posted by jasonxvii View Post
    THis is the code for the server:
    Code:
    if((fd = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)) < 0) {
      perror("socket");
      exit(1);
    }
    
    send(fd, "ROBERT",5,1);
    You seem to be connecting from the phone to the PC, but I don't see any bind(), listen() or accept() calls on the PC side... Those are necessary to have the socket actually listening for incoming connections:

    http://en.wikipedia.org/wiki/Bsd_sockets#Server


    Here's an example of how the address for bind() is constructed with Bluetooth sockets (on page 21):

    http://www.holtmann.org/papers/bluet...003_slides.pdf

Similar Threads

  1. Mobile Podcasting - will it happen?
    By mobile monte in forum News and Announcements
    Replies: 0
    Last Post: 2006-09-22, 23:45
  2. How to send MMS from PC connected to mobile phone?
    By sandude7 in forum General Messaging
    Replies: 5
    Last Post: 2006-07-15, 11:26
  3. Controling a Nokia phone from a Windows Mobile PPC via bluetooth
    By kirkarmon in forum Bluetooth Technology
    Replies: 11
    Last Post: 2006-05-29, 12:49
  4. how to send AT command from PC to Mobile phone
    By zhang_guoqing in forum Bluetooth Technology
    Replies: 0
    Last Post: 2003-05-02, 20:06
  5. Replies: 5
    Last Post: 2003-02-07, 11:25

Posting Permissions

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