webusb/arduino

Question about usage of controlTransferOut() at connect() and disconnect() in serial.js

Kazhuu opened this issue · 3 comments

Hi and thanks for this awesome project. I'm currently learning to use WebUSB and this repo is really a gold mine. I've been looking through the code and saw controlTransferOut() in serial.js at connect() and disconnect(). Like here. And kept wondering what are the request and value numbers here exactly in this context?

I read found that they are vendor specific. So then I looked through WebUSB code on arduino side but could't find anything resembling these values from there. Could you please shed some light what are these and are they required? Event point to further reading would be helpful! Thanks you a lot!

Hi @Kazhuu this link will provide you more information https://www.beyondlogic.org/usbnutshell/usb6.shtml

This looks like a good resource to read. Thank you a lot!

The code which handles these SET_CONTROL_LINE_STATE requests is here: https://github.com/webusb/arduino/blob/gh-pages/library/WebUSB/WebUSB.cpp#L242