Commit Graph

117 Commits

Author SHA1 Message Date
Kyle Lemons
f70c565a72 Merge pull request #33 from kylelemons/kylelemons-travis-update
Bump the Ubuntu and Go versions for Travis
2017-02-16 09:37:53 -08:00
Kyle Lemons
a6b5026fe9 Bump the Ubuntu and Go versions for Travis 2017-02-16 09:33:10 -08:00
zagrodzki
09150fc318 Merge pull request #28 from kylelemons/async_transfers_everywhere
Use async transfer API everywhere
2017-02-15 18:31:12 +01:00
Sebastian Zagrodzki
ef932806ed more comments about transfer protocol. 2017-02-15 18:20:32 +01:00
Sebastian Zagrodzki
0ba09a9942 Move device handle to newUSBTransfer args, remove separate attach() 2017-02-14 01:24:20 +01:00
Sebastian Zagrodzki
16f99ed0b0 Merge remote-tracking branch 'origin/master' into async_transfers_everywhere 2017-02-14 01:12:35 +01:00
zagrodzki
8f68b3d966 Merge pull request #30 from kylelemons/pkg_config
Don't assume libusb headers are always in libusb-1.0.
2017-02-13 19:51:23 +01:00
Sebastian Zagrodzki
1b4014cb28 Set the pointer type, to make the compiler happy, otherwise it might
complain about the incompatible pointer types.
2017-02-13 19:25:24 +01:00
Sebastian Zagrodzki
d4d7011a44 Don't assume libusb headers are always in libusb-1.0.
Use pkg-config to add correct include paths for libusb regardless of the
platform.
2017-02-13 17:08:46 +01:00
Sebastian Zagrodzki
e9d2ce49f0 Add missing attach. 2017-02-13 03:17:29 +01:00
Sebastian Zagrodzki
931a15849b set the same channel in t.xfer.user_data as in t.done. 2017-02-13 03:14:38 +01:00
Sebastian Zagrodzki
ea1db2d56a move to updated transfer init protocol 2017-02-13 03:02:32 +01:00
Sebastian Zagrodzki
4a64c18350 move newUSBTransfer as a vanilla function to transfer.go.
Initialize all static params at new.
2017-02-13 03:01:30 +01:00
Sebastian Zagrodzki
a47809fda8 Simplify the C part even more - the buffer that xfer uses for
transferring data is the same as the one that was created in
newUSBTransfer.
2017-02-13 02:50:47 +01:00
Sebastian Zagrodzki
83a4778988 wait() does not need the buffer passed explicitly, it's already stored
in t.buf.
2017-02-10 22:32:16 +01:00
Sebastian Zagrodzki
1860441a7b iso.go is no longer needed, the only iso-specific part lives in
transfer.c
2017-02-10 22:12:21 +01:00
Sebastian Zagrodzki
31b3ac1c67 move iso.c to transfer.c, as it's used for all transfers.
move transfer callback to transfer.go.
2017-02-10 22:11:54 +01:00
Sebastian Zagrodzki
d7ed6d67e6 Rename iso_callback to transfer_callback, it's used for all transfer
types.
2017-02-10 22:08:39 +01:00
Sebastian Zagrodzki
87abb704d7 Make all transfer types use a generic endpoint.transfer() function
that uses libusb's asynchronous interface.
2017-02-10 22:06:57 +01:00
Sebastian Zagrodzki
c9c2757fe6 Replace the libusb_bulk_transfer with the same prepare-submit-wait
routine iso transfers use.
2017-02-10 21:46:12 +01:00
Sebastian Zagrodzki
9e50cd8c1c Rename extract_data to extract_iso_data, add extract_data for use by
other transfer types.
2017-02-10 21:45:26 +01:00
Sebastian Zagrodzki
9018981e65 Merge remote-tracking branch 'origin/master' into async_transfers_everywhere 2017-02-10 13:16:04 +01:00
zagrodzki
d2b5956929 Merge pull request #27 from kylelemons/rawread_benchmark
Rawread improvements
2017-02-10 13:09:44 +01:00
Sebastian Zagrodzki
0588c4e512 Remove the bench option, add num_reads instead for controlling how many
reads to send. Default is read forever.
2017-02-10 13:02:48 +01:00
Sebastian Zagrodzki
66db4a686b Merge flags vid/pid and bus/addr into single flags, vidpid and busaddr. 2017-02-10 12:48:44 +01:00
Sebastian Zagrodzki
a5290248de Merge vid/pid and bus/addr into single flags vidpid and busaddr. 2017-02-10 12:43:56 +01:00
Sebastian Zagrodzki
b4393ac372 Merge branch 'rawread_benchmark' 2017-02-09 22:52:55 +01:00
Sebastian Zagrodzki
c792f8e028 replace allocTransfer with a new more generic newUSBTransfer 2017-02-09 22:51:28 +01:00
Sebastian Zagrodzki
de92c7047b make methods of usbTransfer private 2017-02-09 22:38:16 +01:00
Sebastian Zagrodzki
80b2741a2c Rename Transfer to usbTransfer, it's internal to gousb.
Move usbTransfer and it's methods to transfer.go, it's not only used by
iso transfers.
2017-02-09 22:36:51 +01:00
Sebastian Zagrodzki
66a1f45cd9 Remove the artificial limit. The worst case is a longer timeout for the
transfer is required.
2017-02-08 23:29:17 +01:00
Sebastian Zagrodzki
91119ca790 Add a benchmark option. 2017-02-08 23:28:52 +01:00
Sebastian Zagrodzki
c27a77b547 Pass the max buffer size down to the alloc_transfer. Use the number
of iso packets matching the buffer size. This guarantees that the
transfer size is smaller or equal to the buffer.
Device will transfer less data if iso transfer response does not utilize the
maximum available number of iso packets per microframe or doesn't fill
the packets entirely.
2017-02-08 23:02:08 +01:00
Sebastian Zagrodzki
a35725f4fb When extracting transfer data, pay attention to the size of the buffer
provided by the user, which may be smaller than the length of data
received in the transfer.
2017-02-08 22:37:12 +01:00
Sebastian Zagrodzki
a19ac0f654 Per http://www.beyondlogic.org/usbnutshell/usb5.shtml#EndpointDescriptors:
bits 0-3 are endpoint number, 4-6 reserved, set to zero, bit 7 is
direction. Bits 0-3 is 0x0f.
2017-02-08 22:35:45 +01:00
Sebastian Zagrodzki
1755936932 Change how device is addressed, add alternative --bus/--addr flags.
Print all diagnostics to the log (stderr). Capture the data from
the specified endpoint and print it to stdout.
2017-02-08 22:30:03 +01:00
zagrodzki
edeaa30938 Merge pull request #26 from kylelemons/authors_and_contributing
Authors and contributing
2017-02-07 19:20:29 +01:00
Sebastian Zagrodzki
9e9783177a Add Kyle's mail addr. 2017-02-07 19:17:34 +01:00
Sebastian Zagrodzki
1800586f77 Merge branch 'master' into authors_and_contributing 2017-02-07 09:44:41 +01:00
Sebastian Zagrodzki
94519ea824 Add a list of contributors. 2017-02-07 09:37:52 +01:00
zagrodzki
cd91046028 Merge pull request #21 from thorduri/iso-callback-prototype
Appease C99 by providing a prototype for iso_callback().
2017-02-07 08:24:36 +01:00
Sebastian Zagrodzki
8258ffe0a7 Define the contribution process. 2017-02-07 08:04:38 +01:00
Sebastian Zagrodzki
beb4fdbac5 Update copyright notes for multiple contributors. 2017-02-07 07:37:57 +01:00
zagrodzki
1445b71bed Merge pull request #24 from zagrodzki/master
Use the calculated max iso packet size.
2017-02-06 20:43:46 +01:00
Sebastian Zagrodzki
397a363de1 Revert "Ditto for device_test, move to usb_test package."
This reverts commit c1b87403fa.
2017-02-06 20:26:32 +01:00
Sebastian Zagrodzki
aafad620e6 Revert "Move usb_test to a separate package, in line with opensource Go"
This reverts commit 4d60ebb065.
2017-02-06 20:26:23 +01:00
Sebastian Zagrodzki
9849c8088e Add a reference to libusb ticket on incorrect max iso packet size. 2017-02-05 16:49:02 +01:00
Sebastian Zagrodzki
c1b87403fa Ditto for device_test, move to usb_test package. 2017-02-05 16:46:56 +01:00
Sebastian Zagrodzki
4d60ebb065 Move usb_test to a separate package, in line with opensource Go
expectations. Multiple packages per directory are not supported in this
realm ;) And with a separate package, the dot import seems unnecessary.
2017-02-05 16:29:22 +01:00
Sebastian Zagrodzki
f13728c6e1 Set the MaxIsoPacket field in the endpoint info if the endpoint is
an isochronous endpoint. Use MaxIsoPacket as the iso packet size
when preparing the iso transfer.
2017-02-05 16:20:58 +01:00