Commit Graph

20 Commits

Author SHA1 Message Date
Sebastian Zagrodzki
d85a738414 a new fakelibusb will overwrite libusb and restore it automatically on
done()
2017-04-27 03:25:36 +02:00
Sebastian Zagrodzki
462651f20f use the new fakeTransferPointer function to allocate a fake transfer
struct.
2017-04-27 03:12:25 +02:00
Sebastian Zagrodzki
ae8627a890 update tests with the new "transfer done" logic. 2017-04-26 21:40:51 +02:00
Sebastian Zagrodzki
aaef575b06 rename Setups to AltSettings 2017-04-09 20:45:35 +02:00
Sebastian Zagrodzki
56162d0105 Remove 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.
2017-04-09 20:25:16 +02:00
Sebastian Zagrodzki
168b501d53 Rename IfClass/IfSubClass/IfProtocol to Class/SubClass/Protocol, these
fields occur within an interface descriptor.
2017-04-09 18:44:32 +02:00
Sebastian Zagrodzki
3e59eeac6c replace class/subclass with Class type 2017-04-09 16:41:38 +02:00
Sebastian Zagrodzki
ca02c03241 since this is the only usecase, return a *libusbDevice for a new
pointer.
2017-04-09 00:12:39 +02:00
Sebastian Zagrodzki
3ec748db4c An 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

Use an arbitrary C-allocated pointer instead.
2017-04-09 00:10:15 +02:00
Sebastian Zagrodzki
e0f30623b3 Modify 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.
2017-04-08 23:49:10 +02:00
Sebastian Zagrodzki
36241e869e more constants 2017-03-27 22:29:24 +02:00
Sebastian Zagrodzki
b70848cf73 start renaming the constants to Go-style. 2017-03-27 22:23:47 +02:00
Sebastian Zagrodzki
0a7fc9fb53 Merge branch 'master' of https://github.com/kylelemons/gousb into libusb_wrappers_tests 2017-03-26 17:46:12 +02:00
Sebastian Zagrodzki
1f977a94aa Update 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.
2017-03-26 17:44:25 +02:00
Sebastian Zagrodzki
4c5589cffb Moar comments. 2017-03-23 18:07:55 +01:00
Sebastian Zagrodzki
991e1b6cc6 completed interface, no more references to real usb from fake. 2017-03-10 08:33:14 -05:00
Sebastian Zagrodzki
4add66ae0e move things around, to keep list of the devices at the beginning. 2017-03-10 07:39:51 -05:00
Sebastian Zagrodzki
8af7ddc71b add two device descriptors 2017-03-10 07:07:44 -05:00
Sebastian Zagrodzki
0099228bc3 started adding fakelibusb functions for testing device.go 2017-03-06 11:38:03 +01:00
Sebastian Zagrodzki
c2167157be Move transfer_fakelibusb to fakelibusb, used in other tests too.
Change the interface a bit.
2017-02-26 21:08:08 +01:00