-
Notifications
You must be signed in to change notification settings - Fork 188
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
Allow device connections from only one script context at a time. #169
Comments
Let's say I open a browser tab and starts to interact with a nearby BT device. |
We have a few options:
|
I'd personally vote for option 3 but I'd love to hear what other think. |
I'm really reluctant to add this restriction on developers and users. We should prefer making our implementation somewhat more complex so that websites and user experiences can be less complex. If we do it, I think "just disconnect the other page" is the only plausible way: we shouldn't show UI on an event the user might not be expecting, and we can't give the web page enough information for it to tell the user which other page to close. |
If I could add a fourth option here : don't disconnect device (aka NOP™).. Also please consider the fact that other apps will be notified of device disconnection. At Logitech, our devices use to communicate with multiple apps at the same time, leaving underlying app / protocol responsibility to sort its own requests / responses from the whole. If firmware and GATT driver supports it, why should we have to limit number of connections to our peripheral? Furthermore, OS also maintains connections in case your device has Hid over GATT profile. So you might end-up closing connection to those mice / keyboards. I'll also open another issue concerning behavior of GATT server disconnect. |
Connection, notification, read & writes, are all problematic if multiple script contexts can be issuing commands to one device. I propose that the specification only permit connection to a device from one context.
The text was updated successfully, but these errors were encountered: