Reputation: 284
How do I initiate pairing of a bluetooth device with PyBluez in Python? I see ways to discover, but not pair.
Upvotes: 2
Views: 5285
Reputation: 478
PyBluez does not support cross-platform pairing management. This is because some operating systems, like Windows, require super-user level permissions to programatically pair devices.
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).
However, you can make your own super user tools or improve PyBluez to do the same.
For example, you can make your own command line tools using .NET for Windows to pair and unpair devices, then run these from Python. An implementation of some command line pairing tools can be found here for Windows: http://bluetoothinstaller.com/bluetooth-command-line-tools/
Upvotes: 2