小编csn*_*ewb的帖子

如何将我的蓝牙 python 脚本设置为高于 Ubuntu 请求的优先级?

我在 Ubuntu 上有一个蓝牙 Python 服务器脚本来连接来自智能手机设备的传入请求。但是,Ubuntu 的蓝牙在我的脚本对其做出反应之前就收到了请求。如何将我的脚本设置为第一优先级?

简单的服务器脚本:

import bluetooth

server_sock=bluetooth.BluetoothSocket( bluetooth.RFCOMM )

port = 1
server_sock.bind(("",port))
server_sock.listen(1)

client_sock,address = server_sock.accept()
print "Accepted connection from ",address

data = client_sock.recv(1024)
print "received [%s]" % data

client_sock.close()
server_sock.close()
Run Code Online (Sandbox Code Playgroud)

server python scripts bluetooth

5
推荐指数
1
解决办法
1073
查看次数

标签 统计

bluetooth ×1

python ×1

scripts ×1

server ×1