vendor: pull in support for USB devices via libusb/gousb

parent 833e4d13
......@@ -13,6 +13,7 @@ github.com/golang/snappy d9eb7a3
github.com/hashicorp/golang-lru 0a025b7
github.com/huin/goupnp 679507a
github.com/jackpal/go-nat-pmp v1.0.1-4-g1fa385a
github.com/karalabe/gousb ffa821b
github.com/maruel/panicparse ad66119
github.com/mattn/go-colorable v0.0.6-9-gd228849
github.com/mattn/go-isatty 30a891c
......
language: go
matrix:
include:
- os: linux
dist: trusty
go: 1.7.4
- os: osx
go: 1.7.4
script:
- go test -v -test.run='BCD|Parse' ./...
This diff is collapsed.
Introduction
============
[![Travis Build Status][travisimg]][travis]
[![AppVeyor Build Status][appveyorimg]][appveyor]
[![GoDoc][docimg]][doc]
The gousb package is an attempt at wrapping the `libusb` library into a Go-like binding in a fully self-contained, go-gettable package. Supported platforms include Linux, macOS and Windows as well as the mobile platforms Android and iOS.
This package is a fork of [`github.com/kylelemons/gousb`](https://github.com/kylelemons/gousb), which at the moment seems to be unmaintained. The current fork is different from the upstream package as it contains code to embed `libusb` directly into the Go package (thus becoming fully self-cotnained and go-gettable), as well as it features a few contributions and bugfixes that never really got addressed in the upstream package, but which address important issues nonetheless.
*Note, if @kylelemons decides to pick development of the upstream project up again, consider all commits made by me to this repo as ready contributions. I cannot vouch for other commits as the upstream repo needs a signed CLA for Google.*
[travisimg]: https://travis-ci.org/karalabe/gousb.svg?branch=master
[travis]: https://travis-ci.org/karalabe/gousb
[appveyorimg]: https://ci.appveyor.com/api/projects/status/84k9xse10rl72gn2/branch/master?svg=true
[appveyor]: https://ci.appveyor.com/project/karalabe/gousb
[docimg]: https://godoc.org/github.com/karalabe/gousb?status.svg
[doc]: https://godoc.org/github.com/karalabe/gousb
Installation
============
Example: lsusb
--------------
The gousb project provides a simple but useful example: lsusb. This binary will list the USB devices connected to your system and various interesting tidbits about them, their configurations, endpoints, etc. To install it, run the following command:
go get -v github.com/karalabe/gousb/lsusb
gousb
-----
If you installed the lsusb example, both libraries below are already installed.
Installing the primary gousb package is really easy:
go get -v github.com/karalabe/gousb/usb
There is also a `usbid` package that will not be installed by default by this command, but which provides useful information including the human-readable vendor and product codes for detected hardware. It's not installed by default and not linked into the `usb` package by default because it adds ~400kb to the resulting binary. If you want both, they can be installed thus:
go get -v github.com/karalabe/gousb/usb{,id}
Documentation
=============
The documentation can be viewed via local godoc or via the excellent [godoc.org](http://godoc.org/):
- [usb](http://godoc.org/github.com/karalabe/gousb/usb)
- [usbid](http://godoc.org/pkg/github.com/karalabe/gousb/usbid)
os: Visual Studio 2015
# Clone directly into GOPATH.
clone_folder: C:\gopath\src\github.com\karalabe\gousb
clone_depth: 5
version: "{branch}.{build}"
environment:
global:
GOPATH: C:\gopath
CC: gcc.exe
matrix:
- GOARCH: amd64
MSYS2_ARCH: x86_64
MSYS2_BITS: 64
MSYSTEM: MINGW64
PATH: C:\msys64\mingw64\bin\;%PATH%
- GOARCH: 386
MSYS2_ARCH: i686
MSYS2_BITS: 32
MSYSTEM: MINGW32
PATH: C:\msys64\mingw32\bin\;%PATH%
install:
- rmdir C:\go /s /q
- appveyor DownloadFile https://storage.googleapis.com/golang/go1.7.4.windows-%GOARCH%.zip
- 7z x go1.7.4.windows-%GOARCH%.zip -y -oC:\ > NUL
- go version
- gcc --version
build_script:
- go install ./...
test_script:
- go test -v -test.run="BCD|Parse" ./...
Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>
Copyright © 2007-2009 Daniel Drake <dsd@gentoo.org>
Copyright © 2010-2012 Peter Stuge <peter@stuge.se>
Copyright © 2008-2016 Nathan Hjelm <hjelmn@users.sourceforge.net>
Copyright © 2009-2013 Pete Batard <pete@akeo.ie>
Copyright © 2009-2013 Ludovic Rousseau <ludovic.rousseau@gmail.com>
Copyright © 2010-2012 Michael Plante <michael.plante@gmail.com>
Copyright © 2011-2013 Hans de Goede <hdegoede@redhat.com>
Copyright © 2012-2013 Martin Pieuchot <mpi@openbsd.org>
Copyright © 2012-2013 Toby Gray <toby.gray@realvnc.com>
Copyright © 2013-2015 Chris Dickens <christopher.a.dickens@gmail.com>
Other contributors:
Akshay Jaggi
Alan Ott
Alan Stern
Alex Vatchenko
Andrew Fernandes
Anthony Clay
Antonio Ospite
Artem Egorkine
Aurelien Jarno
Bastien Nocera
Bei Zhang
Benjamin Dobell
Carl Karsten
Colin Walters
Dave Camarillo
David Engraf
David Moore
Davidlohr Bueso
Federico Manzan
Felipe Balbi
Florian Albrechtskirchinger
Francesco Montorsi
Francisco Facioni
Gaurav Gupta
Graeme Gill
Gustavo Zacarias
Hans Ulrich Niedermann
Hector Martin
Hoi-Ho Chan
Ilya Konstantinov
James Hanko
John Sheu
Joshua Blake
Justin Bischoff
Karsten Koenig
Konrad Rzepecki
Kuangye Guo
Lars Kanis
Lars Wirzenius
Luca Longinotti
Marcus Meissner
Markus Heidelberg
Martin Ettl
Martin Koegler
Matthias Bolte
Mike Frysinger
Mikhail Gusarov
Moritz Fischer
Ларионов Даниил
Nicholas Corgan
Omri Iluz
Orin Eman
Paul Fertser
Pekka Nikander
Rob Walker
Sean McBride
Sebastian Pipping
Simon Haggett
Simon Newton
Thomas Röfer
Tim Hutt
Tim Roberts
Tobias Klauser
Toby Peterson
Tormod Volden
Trygve Laugstøl
Uri Lublin
Vasily Khoruzhick
Vegard Storheil Eriksen
Venkatesh Shukla
Vitali Lovich
Xiaofan Chen
Zoltán Kovács
Роман Донченко
parafin
xantares
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef LIBUSB_POLL_POSIX_H
#define LIBUSB_POLL_POSIX_H
#define usbi_write write
#define usbi_read read
#define usbi_close close
#define usbi_poll poll
int usbi_pipe(int pipefd[2]);
#endif /* LIBUSB_POLL_POSIX_H */
This diff is collapsed.
/* This file is parsed by m4 and windres and RC.EXE so please keep it simple. */
#include "version_nano.h"
#ifndef LIBUSB_MAJOR
#define LIBUSB_MAJOR 1
#endif
#ifndef LIBUSB_MINOR
#define LIBUSB_MINOR 0
#endif
#ifndef LIBUSB_MICRO
#define LIBUSB_MICRO 21
#endif
#ifndef LIBUSB_NANO
#define LIBUSB_NANO 0
#endif
/* LIBUSB_RC is the release candidate suffix. Should normally be empty. */
#ifndef LIBUSB_RC
#define LIBUSB_RC ""
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment