Description
When there are robots available near by, inform users about robot presence and ask if they would like to connect to any of those.
Comments
-
Daniel Cho commented
2019-11-26T09:53:52.997-0500 Without a user gesture, i.e, without manually triggering web bluetooth API’s requestDevice, bluetooth connect window will not appear. Also, builtin connect window from browsers (this API is only available in Chrome and Opera) seem not modifiable, which means there’s no way for us to create customized modal with messages.
-
Colin Clark commented
2019-11-26T15:09:46.845-0500 Hi @@Daniel Cho, thanks for clarifying. Just so I fully understand (I think I’m familiar with this kind of issue but I might be misunderstanding), is it the case that you can’t even start scanning for a bluetooth device until a user event (click, keypress, etc.) is fired?
If that’s the case, we should have a “Find Robots” or something similar (@@Sepideh Shahi can decide) button that starts the process. But the best case situation, if it were possible, is that we’d start scanning as soon as the application is first loaded.
-
Daniel Cho commented
2019-11-26T15:22:07.359-0500 Thank you Colin,
Unfortunately, user gesture is a must, this is an information from the developer documentation: “User Gesture Required
As a security feature, discovering Bluetooth devices with navigator.bluetooth.requestDevice must be triggered by a user gesture such as a touch or a mouse click. We’re talking about listening to pointerup, click, and touchend events.”Our current model has a button for user gesture, with name Connect to Dash and we can definitely change the name to more generic one like “Find Robots” in the future.
-
Colin Clark commented
2019-11-26T15:28:41.922-0500 Great, thanks. Yes, this is a way of preventing personal “fingerprinting” (sites tracking you without cookies by doing things like figuring out what devices are near you) on the web platform.
@@Sepideh Shahi may have some other ideas, but I think it’s reasonable to have a button that starts the process. ideally, it wouldn’t be completely modal (so that it doesn’t interrupt the process of making a program) but it may be easier for users if we walk them through the process of finding and connecting to one or more robots.
-
Daniel Cho commented
2019-11-26T15:39:29.046-0500 Yeah that’s a good idea, we definitely need to create some kind of tutorial for users to use our coding environment. The modal idea was only for the case where we need to ask users without gestures, but since we can’t use the API without user gesture, we don’t need a modal for this. Thank you for your comments!
-
Simon Bates commented
2019-11-27T13:44:39.069-0500 Potentially in the future, we could use the Web Bluetooth Scanning API:
If this page is up-to-date, it looks like it’s currently in development for Chrome:
-
Simon Bates commented
2019-11-27T13:59:24.591-0500 The Web Bluetooth spec includes a feature
navigator.permissions.query
:https://webbluetoothcg.github.io/web-bluetooth/#example-permission-api-query
Which I think is worth taking a look at:
“Once a site has been granted access to a set of devices, it can use navigator.permissions.query({name: “bluetooth”, …}) to retrieve those devices after a reload.”
We’ll need to try it, but this may enable us to connect to devices that have been previously authorized (‘paired’). For these previously authorized devices, we could potentially provide a more direct user experience without having to prompt with the Chome connection interface.
-
Simon Bates commented
2019-11-27T14:02:53.678-0500 Looks like navigator.permissions.query isn’t available yet:
-
Simon Bates commented
2019-11-27T14:17:41.160-0500 It looks like Chrome Apps have a richer API available: