ShaoyuLee / pybluez

Automatically exported from code.google.com/p/pybluez
GNU General Public License v2.0
0 stars 0 forks source link

Client Program not working in Bluetooth ! #47

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run the server program
2. Modify the Bluetooth Address in the client program wrt BT dongle's BT 
address,(same port number in server and client )
3. Run the Client program

What is the expected output? What do you see instead?
I want Client to send data to server,But client program shows  
Traceback (most recent call last):
  File "client.py", line 6, in <module>
    client_socket.connect(("00:15:83:15:A3:10", 3))
File "C:\Python26\Lib\site-packages\bluetooth\msbt.py", line 53, in connect
   bt.connect (self._sockfd, addr, port)

What version of the product are you using? On what operating system?
Python 2.6 ,with XP

Please provide any additional information below.

client.py

from bluetooth import *

# Create the client socket
client_socket=BluetoothSocket( RFCOMM )

client_socket.connect(("00:15:83:15:A3:10", 3))

client_socket.send("Hello World")

print "Finished"

client_socket.close()

server.py

from bluetooth import *

server_socket=BluetoothSocket( RFCOMM )
print "Server Started"
server_socket.bind(("", 3 ))
server_socket.listen(1)

client_socket, address = server_socket.accept()

data = client_socket.recv(1024)

print "received [%s]" % data

client_socket.close()
server_socket.close()

BUT the strange thing when i give some other BT address of mobile Phone ,client 
program works ,but it not when i give the BT address of the PC's BT dongle ! 

Original issue reported on code.google.com by sacoelse...@gmail.com on 29 Jul 2011 at 8:42

GoogleCodeExporter commented 8 years ago
If it is still valid issue please feel free to reopen

Original comment by karu...@wp.pl on 19 Jan 2014 at 6:19