#Server Code
import bluetooth
port = 1
server_sock=bluetooth.BluetoothSocket(bluetooth.L2CAP)
server_sock.bind(("",port))
server_sock.listen(1)
client_sock, address = server_sock.accept()
print "Accepted connection from ",address
msg=raw_input("#")
client_sock.send(msg)
#Client Code
import bluetooth
s=bluetooth.BluetoothSocket( bluetooth.RFCOMM )
s.connect(("00:19:7e:d8:ec:4b", 1))
print s.recv(1000)
No comments:
Post a Comment