toy / blueutil

CLI for bluetooth on OSX: power, discoverable state, list, inquire devices, connect, info, …
https://github.com/toy/blueutil
Other
1.01k stars 53 forks source link

Can I unpair the device with this tool? #31

Closed arvenil closed 4 years ago

arvenil commented 4 years ago

I can --pair the device, but I don't see how can I unpair it?

toy commented 4 years ago

Unfortunately there is no interface and it seems to be possible only as superuser, have a look at #27 and https://stackoverflow.com/a/20749542/96823

arvenil commented 4 years ago

Hi, thanks for the reply. Yes, I closed this issue because I saw #27. Actually https://stackoverflow.com/a/20749542/96823 gives a hope. I wouldn't mind if this program would require sudo for removing device. However I have a tiny issue so I'm not sure if this is worth the effort. So for now I'm stuck to old method of going to menu, removing the device and then now I re add it from cmd line which is quite helpful. The issue I have is with headphones and sharing osx with win10 (bootcamp). If I pair the device in win10, they won't work in osx, If I pair in osx, they won't work in win10. Known bug, probably related with the fact that the id of bluetooth is the same in both OS, but database of paired devices is not shared. https://github.com/Soorma07/OS-X-Bluetooth-Pairing-Value-To-Windows-Value (but this is not working anymore).

On Sat, Apr 4, 2020 at 2:17 PM Ivan Kuchin notifications@github.com wrote:

Unfortunately there is no interface and it seems to be possible only as superuser, have a look at #27 https://github.com/toy/blueutil/issues/27 and https://stackoverflow.com/a/20749542/96823

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/toy/blueutil/issues/31#issuecomment-609020031, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADN6M434CNIN2O6OU7TTALRK4QMJANCNFSM4L37GE4A .

toy commented 4 years ago

The issue you have is a peculiar one :) The code on stackoverflow gives hope indeed, but as it is only changing the plist, I assume that the bluetooth daemon should be informed to reload (and I doubt that it is possible) or restarted. As I already commented in #27 I wasn't yet successful in digging into bluetooth menu item and preference panes.

toy commented 3 years ago

@arvenil I've stumbled upon an undeclared method allowing unpairing functionality, it is available with just released v2.9.0, details in comment for #46.