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

Question on HID over Bluetooth #75

Open
davisford opened this issue Aug 6, 2021 · 1 comment
Open

Question on HID over Bluetooth #75

davisford opened this issue Aug 6, 2021 · 1 comment

Comments

@davisford
Copy link

I know HID over Bluetooth is possible, but how would it work with the WICG APIs?

I have a BTLE device that does not advertise itself to the OS (e.g. scanning with Mac OS Bluetooth dialog it is not discoverable), but if I use WebBluetooth APIs I can find it and connect to it. Once I do that, it shows up in OS list as connected.

What I'd like to know is if I can then turn around and use the WebHID APIs using Bluetooth LE as the transport? How would that work, even? If I use the WebHID API to requestDevice with the appropriate filter and it were not attached via USB but it was connected via Bluetooth, would it even show up? If it did, this would seemingly require two pop-up dialogs to make the user affirm connecting to the device (one for WebBT, and one for WebHID), which would be an awkward experience.

Thanks in advance!

@nondebug
Copy link
Collaborator

nondebug commented Aug 6, 2021

Once a BLE HID device shows up in the macOS Bluetooth device list then it should also be enumerated by WebHID, but you'll need to request permission again since the WebHID and Web Bluetooth permissions aren't connected in any way.

I agree this is awkward and I don't think it helps users to track permissions on such a granular level. I think it would be better to unify permissions so users are only prompted once per physical device. Getting that right will take some careful thought since it's not always easy to identify the physical device that's exposing a particular HID interface and making a mistake can potentially allow access to more devices than the user intended.

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

No branches or pull requests

2 participants