-
Notifications
You must be signed in to change notification settings - Fork 48
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
Questions around supporting devices with USB serial emulation #71
Comments
Thank you for outlining this scenario.
In today's experimental implementation in the Blink engine a permission grant is attached to the device node path (COM1, /etc/ttyS0, etc.) and lasts until the user agent is quit. This is not the desired end state for a couple of reasons. I envision this will work similarly to WebUSB and be specified in terms of device properties such as USB vendor/product IDs, Bluetooth MAC addresses and physical bus paths. Ideally the user will also be in control of the duration of the permission grant. Some of this can be specified (such as which identifiers are used) and some is up to the user agent implementation.
If from an operating system perspective a new device has connected with different hardware IDs then the original
Yes.
This is a difficult scenario. With a chooser-based permission the user must select a particular device. A site can't ask for permission for a device that, from the user agent's perspective, doesn't exist. The danger here is that the user agent can't properly describe this hypothetical device in a way in which the user can make an informed choice.
That is the intention. |
thanks for answering all of my questions so clearly ✨ |
@reillyeon Would it be possible to reconsider this |
I've broken the request for a |
thanks @reillyeon 👍 |
The context of this issue is that I'm porting AVRGirl-Arduino to work with web serial.
There are some Arduino boards out there sporting an Atmel 32u4 chip that emulates the USB serial port. In order to software reset these boards into "bootloader mode" for uploading new firmware, you connect to them once at a baud rate of 1200 and then immediately disconnect. Once the chip reboots into bootloader mode, the serial emulation also comes back up. The device often presents itself as a different device in this mode by either differences in vendor / product id, or it shows up on a different COM port entirely which is a common occurrence on windows.
Let's walk through a user wanting to flash blink.hex to their 32u4 based Arduino in a browser interface with web serial for the very first time:
My questions here are:
requestDevice
prompt with a slightly different filter?My other question which is slightly related is - does
navigator.serial.getPorts
behave in the same way as the WebUSB spec'snavigator.usb.getDevices
?If it's required to have the two separate permission grants for the same device, perhaps a good flow could be an initial one time only "setup" sequence where the user is asked to run through the two permission prompts, and then they're ready to use the main features of webpage itself for uploading new firmware, etc etc. Even with this solution the 8 second timing requirement could present accessibility difficulties for some users, so I'd prefer for there to be a slightly better flow for that reason.
Thanks for considering these questions and scenarios. The web serial spec is not quite fully fleshed out yet so I got a bit stuck on some of this while porting AVRGirl-Arduino to web serial and supporting some of the Arduino boards.
🙇♀
The text was updated successfully, but these errors were encountered: