IanHarvey / bluepy

Python interface to Bluetooth LE on Linux
Other
1.59k stars 491 forks source link

Failed Peripheral.pair() causes bluetooth helper to be stopped #393

Open TonyArmitstead opened 4 years ago

TonyArmitstead commented 4 years ago

If I try to pair with a device I have already previously paired with, the pair() method fails (as expected?) but halts the bluetooth helper (unexpected). Any subsequent method which requires the helper then fails with an internal error.

I can work round this in my code by checking for a BTLEManagementError exception with estat == 19 to trigger a (re) connect. However for me, the halting of the helper was unexpected and so should either be documented - or the pair method itself should handle the re-connect (or not cause a problem in the first place). One could argue that a failed pair - because already paired, should be a nop.

Thoughts?