jtag_libusb_choose_interface() function
Find the first interface optionally matching class, subclass and protocol and claim it.
Arguments
devh
_libusb_ device handle.
usb_read_ep
A pointer to a variable where the _IN_ endpoint number will be stored.
usb_write_ep
A pointer to a variable where the _OUT_ endpoint number will be stored.
bclass
`bInterfaceClass` to match, or -1 to ignore this field.
subclass
`bInterfaceSubClass` to match, or -1 to ignore this field.
protocol
`bInterfaceProtocol` to match, or -1 to ignore this field.
trans_type
`bmAttributes Bits 0..1 Transfer type` to match, or -1 to ignore this field.
Return value
Returns ERROR_OK on success, ERROR_FAIL otherwise.