Adds a new way to initialize the context, `ContextOptions`, and a new way to open devices, `OpenDeviceWithFileDescriptor`.
Combined they can be used to support Android devices, where device enumeration is not supported (can be now disabled through `ContextOptions`) and where USB devices can be opened in the Android SDK and passed over to gousb through a file descriptor.
Co-authored-by: Juan <994594+juaoose@users.noreply.github.com>
Co-authored-by: Kuba Raczkowski <kuba.raczkowski@spectricity.com>
* Store a reference to libusb implementation in the context, transfers
and some more places. Remove the global libusb variable.
* Parallelize tests.
* Fix the link in README.
* Add APIs for config and interface descriptors. Split out the common
parts of selecting a config descriptor from device desc and
selecting a setting descriptor from a config desc.
* Parallelize the few tests that actually can be parallelized safely.
Add comments where they can't. Note to self: it would be beneficial
to restructure the fakelibusb to index all properties of the lib
with the used context. That way a libusb implementation wouldn't need
to be referred via a shared variable.