10 Commits

Author SHA1 Message Date
Sebastian Zagrodzki
e4c3f66a15 Document the recommendations/restrictions around the buffer size (#81)
* Document the recommendations/restrictions around the buffer size
2020-04-29 21:51:05 +02:00
Sebastian Zagrodzki
18f4c1d8a7 Don't skip empty transfers. In isochronous transfers, make sure (#72)
Don't skip empty transfers.
Update the fake libusb to honor the endpoint max packet sizes.
Update tests that were taking advantage of the fact that libusb
allowed unlimited amount of data in any transfer packet.
2019-08-12 21:38:32 +02:00
Sebastian Zagrodzki
da849d96b5 Add context-aware read/write (#57)
Adds ReadContext/WriteContext methods to endpoints and to streams. Update rawread example tool to use ReadContext for implementation of "timeout" flag.
2018-11-05 15:33:31 +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
1aaa100bdb Allocate libusb buffers in C (#11)
* add alloc/free_transfer_and_buffer. Manages the buffer memory on the C
side.

* switch libusb.go to use the new alloc/free_transfer_and_buffer. Add
a new buffer() call to get access to the allocated buffer as a Go slice.

* Fake USB transfer uses the new alloc/free/buffer interface.

* Switch to the new libusb.alloc signature, where libusb owns the buffer.

* newUSBTransfer now allocates a separate buffer, do a copy on
endpoint.transfer.

* newUSBTransfer will now allocate it's own buffer.

* Enable autodetach in rawread.
2017-08-29 12:11:04 +02:00
Sebastian Zagrodzki
2b78100ce3 Allow the same endpoint number to be reused for IN and OUT endpoints
separately, effectively allowing two endpoints with the same number
- numbers are no unique, only endpoint addresses are.
2017-06-13 23:04:34 +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
86c8e27edf moar comments. Add a done callback to DefaultInterface return values. 2017-05-06 02:30:16 +02:00
Sebastian Zagrodzki
5200a36191 Move files from gousb/usb to gousb 2017-05-06 00:11:11 +02:00