Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also search paired devices to get device by name #88

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

azuwis
Copy link
Contributor

@azuwis azuwis commented Mar 26, 2024

IOBluetoothDevice.recentDevices return empty list in macOS Monterey and
later, also search paired devices to make

--info "BY NAME"
--connect "BY NAME"
--disconnect "BY NAME"
...

work again.

Fix #62

@toy
Copy link
Owner

toy commented Apr 4, 2024

Thank you for creating the PR

I think it would be better to search both lists, first paired, then recent devices (maybe easiest is to concat arrays to not do it separately).
Please update documentaation describing the search by name (line starting with "ID can be either address").
I think it resolves #62, but not #58 - only addresses are used in all commands

@azuwis azuwis changed the title Use IOBluetoothDevice.pairedDevices to get device by name Also search paired devices to get device by name Apr 8, 2024
@azuwis
Copy link
Contributor Author

azuwis commented Apr 8, 2024

@toy Please review the new changes.

@toy
Copy link
Owner

toy commented Apr 8, 2024

Nice

I think it will be better to still show a separate error if there are no paired or recent devices, it will fail anyway, but error about empty list is more precise than one about not being able to find a device by name.

Also please run ./update_usage (to copy the change in help to readme) and add an entry to CHANGELOG.md

@azuwis
Copy link
Contributor Author

azuwis commented Apr 12, 2024

@toy Done.

@toy
Copy link
Owner

toy commented Apr 13, 2024

I think it is still better to print error and exit if searchDevices is empty, not just show a warning if one of pairedDevices and recentDevices is nil. As is, if recent devices returns nil, but there are paired devices and there is a device by searched name, there will be a probably confusing warning message, but finding device will succeed. Sorry if I was not clear enough in previous message.

IOBluetoothDevice.recentDevices return empty list in macOS Monterey and
later, also search paired devices to make

  --info "BY NAME"
  --connect "BY NAME"
  --disconnect "BY NAME"
  ...

work again.

Fix toy#62
@toy
Copy link
Owner

toy commented Apr 15, 2024

Wanted to merge, but realised that you didn't add an entry to CHANGELOG.md, please write something following examples and please link there both this PR and the issue #62

@toy toy merged commit dfe7fb2 into toy:main Apr 17, 2024
@toy
Copy link
Owner

toy commented Apr 17, 2024

@azuwis Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't connect/disconnect by device name on Monterey
2 participants