我正试图通过蓝牙将一个文件从我的笔记本电脑(win10)发送到我的手机(android)。我遵循了this answer,我正在用python 3.6做同样的事情
我正在使用PyOBEX Python 3 Package,这就是我尝试过的
import sys
from PyOBEX.client import Client
from bluetooth import *
addr = '60:7E:DD:A7:42:43'
print("Searching for OBEX service on {}".format(addr))
services = find_service(address=addr, name=b'OBEX Object Push\x00')
if len(services) == 0:
sys.exit()
first_match = services[0]
port = first_match["port"]
client = Client(addr, port)
client.connect()
client.put("test.txt", "Hello world\n")
client.disconnect()
当我运行此操作时,会发现设备,但它不会建立连接或发送文件。这就是它给出的错误
我试图通过将socket.recv返回的数据类型更改为str来搞乱PyOBEX包,但它给了我另一个错误,
我被卡住了,以前从未使用过蓝牙或插座。谢谢你的帮助
目前没有回答
相关问题 更多 >
编程相关推荐