d5a8179068Exit libusb context when done.
Sebastian Zagrodzki
2017-04-27 03:12:47 +02:00
462651f20fuse the new fakeTransferPointer function to allocate a fake transfer struct.
Sebastian Zagrodzki
2017-04-27 03:12:25 +02:00
b9dabf4da9Add a method to return a fake allocated transfer.
Sebastian Zagrodzki
2017-04-27 03:12:06 +02:00
76df46148eFix typo in log args.
Sebastian Zagrodzki
2017-04-27 03:11:36 +02:00
7ee11b48c5Close the Context
Sebastian Zagrodzki
2017-04-27 03:01:35 +02:00
60ee821dd6Close the Context
Sebastian Zagrodzki
2017-04-27 03:01:20 +02:00
2bcc25f8d0Close the Context
Sebastian Zagrodzki
2017-04-27 03:01:10 +02:00
a1b915080eClose returns error, to satisfy the io.Closer interface.
Sebastian Zagrodzki
2017-04-27 02:48:43 +02:00
76f4548b85Add info about concurrency safety for stream.
Sebastian Zagrodzki
2017-04-26 22:49:37 +02:00
6c9e76f578s/USB involving/USB transfers involving/
Sebastian Zagrodzki
2017-04-26 22:27:46 +02:00
93355e7490replace uint32 in MaxPacketSize with int
Sebastian Zagrodzki
2017-04-26 22:27:12 +02:00
22ff844a3ds/DeviceSpeed/Speed/
Sebastian Zagrodzki
2017-04-26 22:24:46 +02:00
6c60468e06Update to use ints instead of uint8s
Sebastian Zagrodzki
2017-04-26 22:23:58 +02:00
83276566fcReplace uint8 with Go-idiomatic int, where it makes sense.
Sebastian Zagrodzki
2017-04-26 22:22:07 +02:00
a55abe9076Disable Write streams for now.
Sebastian Zagrodzki
2017-04-26 21:51:00 +02:00
cdd4223813Handle a case where transfers channel was not closed properly.
Sebastian Zagrodzki
2017-04-26 21:50:10 +02:00
ae8627a890update tests with the new "transfer done" logic.
Sebastian Zagrodzki
2017-04-26 21:40:51 +02:00
fbd26497e6NewStream takes int now.
Sebastian Zagrodzki
2017-04-26 21:36:14 +02:00
eed8b77a16NewStream takes int now.
Sebastian Zagrodzki
2017-04-26 21:35:50 +02:00
eed6d08423Re-use the same done channel for every callback of a single transfer.
Sebastian Zagrodzki
2017-04-26 21:35:26 +02:00
c1009ed25dCall back to Go function directly, it will know how to deal with an xfer pointer.
Sebastian Zagrodzki
2017-04-26 21:33:45 +02:00
550fe8d1f2Introduce xferMap, avoid passing Go pointer into the C code. Weirdness with memory barriers.
Sebastian Zagrodzki
2017-04-26 21:32:49 +02:00
dacae32d83Tests for read transfers, starting on write transfers.
Sebastian Zagrodzki
2017-04-23 22:58:30 +02:00
b50bc8761fFirst version of streaming transfers.
Sebastian Zagrodzki
2017-04-23 10:45:04 +02:00
d92ea14c33Add a test to catch invalud endpoint info.
Sebastian Zagrodzki
2017-04-10 03:25:32 +02:00
9cecdec977Fix a bug where EndpointInfo would always be picked from the last alternative setting.
Sebastian Zagrodzki
2017-04-10 03:16:59 +02:00
b0d5519c67Change the iso packet size if the buffer is very small. Previously number of iso packets could have amounted to a transfer buffer larger than passed buffer, which could lead to overflow.
Sebastian Zagrodzki
2017-04-10 02:45:16 +02:00
961f271746rename setup to alternate, print endpoint description first.
Sebastian Zagrodzki
2017-04-10 02:44:23 +02:00
5efb68e45eiota used on the second line of const block starts from 1, not from 0...
Sebastian Zagrodzki
2017-04-10 01:41:36 +02:00
5150242633Set slice length, since we don't use append.
Sebastian Zagrodzki
2017-04-10 01:41:12 +02:00
453e3832b2Add tests for failed open. Add tests for OutEndpoint.Write
Sebastian Zagrodzki
2017-04-10 01:28:21 +02:00
b6794b7d45Add a test for InEndpoint.Read. Use ID for vid/pid in OpenDevice...
Sebastian Zagrodzki
2017-04-10 01:25:51 +02:00
b1dcaa1195Add Device.OutEndpoint, simplify endpoint test.
Sebastian Zagrodzki
2017-04-10 01:11:38 +02:00
57b10f0dd3Remove OpenEndpoint, add InEndpoint for Read transfers.
Sebastian Zagrodzki
2017-04-10 01:00:53 +02:00
dd405348e9move tests around
Sebastian Zagrodzki
2017-04-09 20:55:37 +02:00
128c206986Move EndpointInfo to endpoint.go
Sebastian Zagrodzki
2017-04-09 20:51:47 +02:00
b7b8fbb50areferences to gousb2.0-dev...
Sebastian Zagrodzki
2017-04-09 20:48:07 +02:00
aaef575b06rename Setups to AltSettings
Sebastian Zagrodzki
2017-04-09 20:45:35 +02:00
8364724ca4lint fixes.
Sebastian Zagrodzki
2017-04-09 20:28:26 +02:00
188fd8382dmore comments
Sebastian Zagrodzki
2017-04-09 20:27:37 +02:00
56162d0105Remove BCD.Int, add BCD.Major/Minor. Remove USB spec versions - I don't expect them to get much use, and reuse of BCD for USB spec version and device revision makes it somewhat confusing.
Sebastian Zagrodzki
2017-04-09 20:25:16 +02:00
a5c4de3a29more comments. Rename USBError to just Error.
Sebastian Zagrodzki
2017-04-09 19:41:44 +02:00
87c7a873e9Go naming for error codes. Export USBError type.
Sebastian Zagrodzki
2017-04-09 19:27:33 +02:00
54aed557d8more comments
Sebastian Zagrodzki
2017-04-09 19:18:11 +02:00
b09de1cf09more comments
Sebastian Zagrodzki
2017-04-09 19:17:13 +02:00
f668df87dfOpenEndpoint for now takes an address - a device can have two endpoints with the same number...
Sebastian Zagrodzki
2017-04-09 19:08:42 +02:00
c44b5b7307OpenEndpoint now uses endpoint number, not endpoint address.
Sebastian Zagrodzki
2017-04-09 18:57:43 +02:00
f58798160dmake addr() part of EndpointInfo
Sebastian Zagrodzki
2017-04-09 18:55:41 +02:00
13f4e95f2fUnexport bitmasks, they are only used internally. All values present in exported structs are meaningful and the users should not need to use bitmasks.
Sebastian Zagrodzki
2017-04-09 18:53:49 +02:00
3d62929e05Replace EndpointDirection with a bool
Sebastian Zagrodzki
2017-04-09 18:51:51 +02:00
168b501d53Rename IfClass/IfSubClass/IfProtocol to Class/SubClass/Protocol, these fields occur within an interface descriptor.
Sebastian Zagrodzki
2017-04-09 18:44:32 +02:00
f91d53931aUse Protocol type for USB interface protocol.
Sebastian Zagrodzki
2017-04-09 18:42:04 +02:00
d3428d9b35Use Class for classes in usbid.
Sebastian Zagrodzki
2017-04-09 18:29:16 +02:00
af00028b97more comments, add Milliamperes type.
Sebastian Zagrodzki
2017-04-09 18:15:48 +02:00
e6f6a4f76eUse golint
Sebastian Zagrodzki
2017-04-09 18:05:46 +02:00
c437b39ef7comments for endpointinfo type fields
Sebastian Zagrodzki
2017-04-09 16:56:36 +02:00
3e59eeac6creplace class/subclass with Class type
Sebastian Zagrodzki
2017-04-09 16:41:38 +02:00
6d9ea8e966testDBPath is a const, not var...
Sebastian Zagrodzki
2017-04-09 01:05:09 +02:00
f2c4300ad5testDBPath to package variables
Sebastian Zagrodzki
2017-04-09 01:04:43 +02:00
0566e701f6add tests for URL fetching
Sebastian Zagrodzki
2017-04-09 00:58:47 +02:00
aa9661f705move static data to testdata files
Sebastian Zagrodzki
2017-04-09 00:38:42 +02:00
fc9b74ed82error.go is a C mapping file, like libusb.go
Sebastian Zagrodzki
2017-04-09 00:24:32 +02:00
83302ae558add test for an interrupt endpoint.
Sebastian Zagrodzki
2017-04-09 00:22:11 +02:00
ab6b612d1bString of the endpoint should use EndpointInfo, not the default mapping from InterfaceInfo.
Sebastian Zagrodzki
2017-04-09 00:18:54 +02:00
ca02c03241since this is the only usecase, return a *libusbDevice for a new pointer.
Sebastian Zagrodzki
2017-04-09 00:12:39 +02:00
3ec748db4cAn invalid pointer triggers a runtime failure when passed as argument in Go1.7: runtime: bad pointer in frame github.com/kylelemons/gousb/usb.(*fakeLibusb).open at 0xc420045ce0: 0x1 fatal error: invalid stack pointer
Sebastian Zagrodzki
2017-04-09 00:10:15 +02:00
648d3af9d8use gousb2.0-dev for badges
Sebastian Zagrodzki
2017-04-08 23:53:37 +02:00
e0f30623b3Modify EndpointInfo to provide meaningful data rather than raw USB descriptor values. E.g. for the user, the distinction between MaxIsoPkt and MaxPktSize is irrelevant, only the calculated max packet size matters.
Sebastian Zagrodzki
2017-04-08 23:49:10 +02:00
d982ef5a37Add constants for device speed.
Sebastian Zagrodzki
2017-03-27 23:01:02 +02:00
f3b2f37e3aRename the rest of the constants.
Sebastian Zagrodzki
2017-03-27 22:33:29 +02:00
36241e869emore constants
Sebastian Zagrodzki
2017-03-27 22:29:24 +02:00
b70848cf73start renaming the constants to Go-style.
Sebastian Zagrodzki
2017-03-27 22:23:47 +02:00
341fde410ereplace Endpoint interface with a real Endpoint struct.
Sebastian Zagrodzki
2017-03-27 22:15:45 +02:00
3b8abbe38bPoint to gousb2.0 for that branch.
Sebastian Zagrodzki
2017-03-26 18:48:36 +02:00
7631ae4158Merge pull request #42 from nkovacs/ignore-binaries
zagrodzki
2017-03-26 18:46:22 +02:00
f19e934f9fIgnore rawread and usbid/regen binaries
Nikola Kovacs
2017-03-26 16:06:46 +02:00
926e8d0ea6point to master branch for coverage, duh...
Sebastian Zagrodzki
2017-03-26 18:37:57 +02:00
0d18ae2f82Merge pull request #45 from kylelemons/coveralls
zagrodzki
2017-03-26 18:34:31 +02:00
57244bb162Remove coveralls token entirely, is supposed to "just work" for public repositories.
Sebastian Zagrodzki
2017-03-26 18:28:51 +02:00
927ef57ca7Gah. Of course it doesn't work, since the exit status from test is 1. Replace "&&" with an "if".
Sebastian Zagrodzki
2017-03-26 18:16:12 +02:00
e1279ed840Merge pull request #44 from kylelemons/coverage
zagrodzki
2017-03-26 18:08:41 +02:00
90a47eb448If the coveralls token is not set, don't try to push the coverage report.
Sebastian Zagrodzki
2017-03-26 17:58:30 +02:00
03533e78edMerge pull request #43 from kylelemons/libusb_wrappers_tests
zagrodzki
2017-03-26 17:56:24 +02:00
1f977a94aaUpdate the comment - there's no way to create a new pointer to struct libusb_device, since the struct is not defined in libusb headers (only name is declared), as such the compiler doesn't know the size of the struct to allocate.
Sebastian Zagrodzki
2017-03-26 17:44:25 +02:00
2bc8acd1c7Merge pull request #41 from kylelemons/libusb_wrappers_tests
zagrodzki
2017-03-23 18:15:31 +01:00
4c5589cffbMoar comments.
Sebastian Zagrodzki
2017-03-23 18:07:55 +01:00
1008e7c3c0Merge branch 'master' into libusb_wrappers_tests
Sebastian Zagrodzki
2017-03-22 19:16:29 +01:00
79b30d4535Merge pull request #40 from kylelemons/coverage
zagrodzki
2017-03-22 19:13:57 +01:00
fc41761879Remove the alloc test that used real libusb allocation.
Sebastian Zagrodzki
2017-03-10 09:25:57 -05:00
e0cfdc52ddupdated USB IDs
Sebastian Zagrodzki
2017-03-10 09:09:34 -05:00
ea2a438ec0ignore libusb.go, as explicitly not covered due to poor C code testability.
Sebastian Zagrodzki
2017-03-10 09:00:37 -05:00
81f2998055Merge branch 'coverage' into libusb_wrappers_tests
Sebastian Zagrodzki
2017-03-10 08:55:45 -05:00
389ae4e2b3EndpointInfo tests
Sebastian Zagrodzki
2017-03-10 08:48:21 -05:00
a221bef905ensure the vid/pid match
Sebastian Zagrodzki
2017-03-10 08:36:00 -05:00
ff7995c159Add endpoint open test
Sebastian Zagrodzki
2017-03-10 08:35:50 -05:00
991e1b6cc6completed interface, no more references to real usb from fake.
Sebastian Zagrodzki
2017-03-10 08:33:14 -05:00
4add66ae0emove things around, to keep list of the devices at the beginning.
Sebastian Zagrodzki
2017-03-10 07:39:51 -05:00
d392ad305dTests for OpenVidPid
Sebastian Zagrodzki
2017-03-10 07:38:54 -05:00
4b17678362remove a call to libusb_open_device_with_vid_pid, as it's just a convenience wrapper. Reimplement the same trivial wrapper in Go.
Sebastian Zagrodzki
2017-03-10 07:22:04 -05:00