-
Notifications
You must be signed in to change notification settings - Fork 185
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
Should requestDevice
automatically connect to the device?
#2
Comments
Yeah, there is no need to return un-connected BluetoothDevice object. Currently requestDevice() defines two behaviors--connect and discovery services, after that I assume it cached everything, and it doesn't provide discover service method. It doesn't give application refresh trees. |
I'm having trouble following how your comment after the first sentence relates to the subject of this issue. If it's a separate concern, could you open a separate issue? |
This also explains what to do if the user cancels the device picker. It's still uncertain whether this is the right decision: see #2.
I think the API should provide the programmer 2 options, [1] to get a list of known and paired devices and if they are inrange and connected, and [2] find nearby devices, which should be a list of different devices to [1], and then give the option to connect and pair with if needed. |
@pzboyz, I don't see how that's related to the topic of this issue? If it's a separate suggestion, and is compatible with the security and privacy risks, could you file a new issue about it, with a justification? |
Your last paragraph states it is not obvious what requestdevice() should return, I was stating it needs to return two types of lists of devices. |
It's a bit hard for me to follow all the ideas proposed by @shawnjohnjr and @pzboyz, but I'd like to add my coins here as well. For me, returning un-connected devices is preferred since we might want to retrieve device(s) and communicate with them later on in time. Suppose we have some control panel, we can stick with device name and AD uuids as a start; enumerating services requires connection, but we know those devices already are of interest, so we can keep enumeration on-demand while, say, opening device details. This agains saves wireless communication. A second remark IMO is for coherency with function's responsibility (though highly subject to debate). I feel that providing un-connected devices is still as understandable as connecting automatically. After all, we have a connect() method which we would have to call in any case. If device has gone out of range, it would fail, as it would if popup appeared then device goes out of range, then user selects device, no? Please also consider devices which expose services handled at OS level. My Logitech-bias make me focus to HID over GATT profile. We indeed have a couple of HID mice and keyboards for which pairing will be handled by OS (bluetooth) device manager. I think my concern meets @shawnjohnjr here; devices requiring encryption and authentication are to be looked into as well. |
The idea is that a user might connect multiple devices to their control panel, but then not actually use some of the devices they connected? That'll make more sense once we add a way to reconnect to already-allowed devices without bugging the user again, a'la #31, but we do need to anticipate it in this API. I agree that separating out connection makes the If we separate the steps, we should consider making
instead of
Of course, if we switch to |
@jracle I agree with your thinking and rationale. |
Thanks @pzboyz ! @jyasskin, the idea is to present all devices to the user with their basic information (once we have device name, we don't always need to connect to the device to fill a list view item). If user selects the device, then we can enumerate service(s) lazily. @jyasskin it would be great that |
Let's remove the By the way, @pzboyz, could you introduce yourself on the list? |
Have requestDevice() open a dialog within the current document instead of creating a new window. This doesn't compromise any security inside a Chrome App, since the App isn't getting any additional capabilities from the user interaction with the requestDevice() UI, and avoiding new windows plays better with Cordova.
…13c6-086f492 Merge 23213c6 086f492 Chromium changes based on spec changes: bluetooth: Update security text copy from latest spec. https://codereview.chromium.org/1108503002/ bluetooth: Update to spec changes in IDL case and URL case. https://codereview.chromium.org/1109433002/ Added new BluetoothUUID files. (Changes UUID case) https://codereview.chromium.org/1081813005 closes #2
This comment has been minimized.
This comment has been minimized.
@alainmanigat Asking this question is best done on https://stackoverflow.com/questions/tagged/web-bluetooth. Replying to an unrelated closed spec issue isn't a good method. |
Discovery and connection are separate steps in the Bluetooth spec and in most APIs that access Bluetooth. However, these APIs generally don't expose as compressed a discovery flow as this one, nor do they involve an "open-like" dialog where the user selects a device.
I don't know of a use for getting a handle to an un-connected device, but if you know of one please mention it here.
If there's a use, we need to expose that possibility. It's not clear whether we should expose it by having
requestDevice()
return an un-connected device regardless and making all developers callconnect()
explicitly, or by havingrequestDevice()
default to returning a connected device, but with an option to override that default.The text was updated successfully, but these errors were encountered: