15 Commits

Author SHA1 Message Date
Sebastian Zagrodzki
e840be9d06 Do not assume interface numbers follow the slice indices. (#134)
Do not assume interface numbers follow the slice indices.

This is a continuation of
9ad54830f4
which tried to solve the problem of non-contiguous interface indices;
this commit modifies another code path that had the same assumption.
2024-09-13 20:43:01 +02:00
Sebastian Zagrodzki
9ad54830f4 Support malformed interface descriptors (#79)
* Add an invalid interface descriptor to one of the test devices.
* Add a test for getting that interface description.
* Handle the malformed interface/alternate setting descriptors, where
interface/alt numbers don't follow the spec (not 0-based, not contiguous
etc.)

Addresses issue #65.
2020-04-28 11:32:10 +02:00
Sebastian Zagrodzki
21b0ed46ae Set alternate setting for the interface only if required. (#38)
Spec says devices must support "set interface" if they have more than
one alternate setting.
2018-05-23 10:08:10 +02:00
Sebastian Zagrodzki
d0366361a2 Add missing arguments to Interface() error on failed descriptor
retrieval.
2017-11-12 03:32:09 +01:00
zagrodzki
c113a5e0de Parallelize tests (#17)
* 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.
2017-09-04 16:55:47 +02:00
zagrodzki
f9aba6fab5 Config and interface description (#16)
* 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.
2017-09-04 14:17:34 +02:00
Sebastian Zagrodzki
67ddfbabc2 Rename ListDevices to OpenDevices. Add more doc for RemoteWakeup. 2017-06-13 10:55:30 +02:00
Sebastian Zagrodzki
e1fd376a2e more comment updates, rename "intf" parameter of Interface to "num" 2017-06-13 10:48:28 +02:00
Sebastian Zagrodzki
d68d0c1a41 Rename more "Info" fields to "Desc" 2017-05-06 02:52:19 +02:00
Sebastian Zagrodzki
4991f9c89b use ConfigDesc, InterfaceDesc and EndpointDesc. 2017-05-06 02:43:16 +02:00
Sebastian Zagrodzki
e5961a7cc4 rename ConfigInfo to ConfigDesc 2017-05-06 02:40:09 +02:00
Sebastian Zagrodzki
86c8e27edf moar comments. Add a done callback to DefaultInterface return values. 2017-05-06 02:30:16 +02:00
Sebastian Zagrodzki
c6b9a04e9f Document Interface parameters. 2017-05-06 02:19:57 +02:00
Sebastian Zagrodzki
eb5500f387 Move Control from Config to Device.
Rename Default to DefaultInterface.
2017-05-06 02:16:22 +02:00
Sebastian Zagrodzki
5200a36191 Move files from gousb/usb to gousb 2017-05-06 00:11:11 +02:00