According to : https://wicg.github.io/webusb/#endpoints The endpointNumber MUST equal the 4 least significant bits of the bEndpointAddress field of the endpoint descriptor defining the endpoint.
When the direction is in, I think we need to add 0x80 to the endpointNumber when comparing it to usbEndpoint.endpointNumber
When doing a device.getEndpoint('in', 5), the resulting comparison would be 133 instead of 5
According to : https://wicg.github.io/webusb/#endpoints
The endpointNumber MUST equal the 4 least significant bits of the bEndpointAddress field of the endpoint descriptor defining the endpoint.
When the direction is
in
, I think we need to add0x80
to the endpointNumber when comparing it to usbEndpoint.endpointNumberWhen doing a
device.getEndpoint('in', 5)
, the resulting comparison would be133
instead of5