18 Commits

Author SHA1 Message Date
Kuba Raczkowski
606016adee Android support via fileDescriptor (#130)
Adds a new way to initialize the context, `ContextOptions`, and a new way to open devices, `OpenDeviceWithFileDescriptor`.

Combined they can be used to support Android devices, where device enumeration is not supported (can be now disabled through `ContextOptions`) and where USB devices can be opened in the Android SDK and passed over to gousb through a file descriptor.

Co-authored-by: Juan <994594+juaoose@users.noreply.github.com>
Co-authored-by: Kuba Raczkowski <kuba.raczkowski@spectricity.com>
2024-09-08 21:40:30 +02:00
Sebastian Zagrodzki
5514912016 Go 1.22 (#122)
Update Go & Ubuntu versions in GitHub CI workflows. Pass files through a new version of gofmt. Allow running CI workflow manually.
2024-02-24 21:48:06 +01:00
Sebastian Zagrodzki
bdb184b25c Make golint fail on errors. (#105)
* make lint fail on errors
* fix lint errors
2021-11-02 12:52:11 +01:00
danielpaulus
0ce3a07f8e Dereference device with a defer call to prevent memory leaks (#98)
We should always dereference devices. c.libusb.open is keeping its own internal reference so there is no risk of breaking anything.
2021-11-01 21:40:49 +01:00
Sebastian Zagrodzki
0eba1b1264 Checks for closed/uninitialized context and devices. (#93) 2021-01-15 17:25:29 +01:00
Biling Uliar
04360a5457 Update usb.go (#60)
Possible typo fix
2018-12-22 22:43:27 +01:00
Sebastian Zagrodzki
c6e780971f Support libusb_set_option in additon to libusb_set_debug. (#39)
* Support libusb_set_option in additon to libusb_set_debug.
The latter is deprecated in libusb 1.0.22 and later.

* Move the "debug level constants" todo to the right place. Add a comment
about libusb 1.0.22 exported API version.
2018-05-23 16:07:03 +02: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
Veniamin Albaev
9829f2fcba Fixed libusb: warning [libusb_exit] some libusb_devices were leaked (#7) 2017-07-20 14:09:58 +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
67ddfbabc2 Rename ListDevices to OpenDevices. Add more doc for RemoteWakeup. 2017-06-13 10:55:30 +02:00
Sebastian Zagrodzki
b709988501 Fix typos, more precise example for configurations. 2017-06-13 10:40:01 +02:00
Sebastian Zagrodzki
e117225966 lint fixes 2017-05-06 02:54:22 +02:00
Sebastian Zagrodzki
9f04f7bdf0 Replace anonymous DeviceDesc field import with a named "Desc" field. 2017-05-06 02:47:24 +02:00
Sebastian Zagrodzki
fedc9864dd rename Descriptor to DeviceDesc 2017-05-06 02:36:45 +02:00
Sebastian Zagrodzki
89dc91ef06 Moar documentation and examples. 2017-05-06 02:16:53 +02:00
Sebastian Zagrodzki
1c9a11b1ce Remove "libusb" from the comments. 2017-05-06 00:31:04 +02:00
Sebastian Zagrodzki
5200a36191 Move files from gousb/usb to gousb 2017-05-06 00:11:11 +02:00