The current serial.js assumed all WebUSB device has an interface number of 2, in endpoint of 5 and out endpoint of 4, hard coded.
This is correct if the device is just acting as WebUSB alone. When a device has a few other interfaces, the WebUSB interface might not be on interface number 2.
This pull request will loop through the this.device_ and detect a class of 0xFF (I can't find any other differentiation for other device interface other than this to guess if the interface is WebUSB), loop through the endpoints and get the correct interface number, ID for in and out endpoints .
The current
serial.js
assumed all WebUSB device has an interface number of 2, in endpoint of 5 and out endpoint of 4, hard coded.This is correct if the device is just acting as WebUSB alone. When a device has a few other interfaces, the WebUSB interface might not be on interface number 2.
This pull request will loop through the
this.device_
and detect a class of 0xFF (I can't find any other differentiation for other device interface other than this to guess if the interface is WebUSB), loop through the endpoints and get the correct interface number, ID for in and out endpoints .Hope this helps.
Cheers JP