简体   繁体   English

PyBluez 配对蓝牙设备

[英]PyBluez pairing bluetooth device

How do I initiate pairing of a bluetooth device with PyBluez in Python?如何在 Python 中启动蓝牙设备与 PyBluez 的配对? I see ways to discover, but not pair.我看到了发现的方法,但不是配对。

PyBluez does not support cross-platform pairing management. PyBluez 不支持跨平台配对管理。 This is because some operating systems, like Windows, require super-user level permissions to programatically pair devices.这是因为某些操作系统(如 Windows)需要超级用户级别的权限才能以编程方式配对设备。

On most operating systems, when PyBluez attempts to connect to the socket using the connect method, the operating system will try to pair (often asking the user for permission).在大多数操作系统上,当 PyBluez 尝试使用 connect 方法连接到套接字时,操作系统会尝试配对(通常会询问用户的权限)。

However, you can make your own super user tools or improve PyBluez to do the same.但是,您可以制作自己的超级用户工具或改进 PyBluez 来做同样的事情。

For example, you can make your own command line tools using .NET for Windows to pair and unpair devices, then run these from Python.例如,您可以使用 .NET for Windows 制作自己的命令行工具来配对和取消配对设备,然后从 Python 运行这些工具。 An implementation of some command line pairing tools can be found here for Windows: http://bluetoothinstaller.com/bluetooth-command-line-tools/可以在此处找到适用于 Windows 的一些命令行配对工具的实现: http : //bluetoothinstaller.com/bluetooth-command-line-tools/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM