【发布时间】:2011-11-21 02:15:33
【问题描述】:
如何通过 python 通过蓝牙发送消息而无需像类型数字这样的密钥认证?
我使用了 pybluez 但我收到了这个错误:
File "./send", line 12, in <module>
connect()
File "./send", line 8, in connect
sock.connect((bd_addr, port))
File "<string>", line 5, in connect
bluetooth.btcommon.BluetoothError: (111, 'Connection refused')
这里是代码
#!/usr/bin/python
import bluetooth
def connect ():
bd_addr = "x:x:x:x:x:x"
port = 1
sock=bluetooth.BluetoothSocket(bluetooth.RFCOMM)
sock.connect((bd_addr, port))
sock.send("hello!!")
sock.close()
connect()
【问题讨论】:
-
请编辑完整的错误消息,包括堆栈跟踪。