gousb

module
v0.0.0-...-a9213a2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2016 License: Apache-2.0

README

Introduction

[![Build Status][ciimg]][ci] [![GoDoc][docimg]][doc]

The gousb package is an attempt at wrapping the libusb library into a Go-like binding.

Supported platforms include:

  • linux
  • darwin
  • openbsd (no hotplug)

Installation on Linux

Dependencies

You must first install libusb-1.0. On Darwin/OS X only brew install libusb is tested.

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/giddyinc/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/giddyinc/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/giddyinc/gousb/usb{,id}

Documentation

The documentation can be viewed via local godoc or via the excellent godoc.org:

Directories

Path Synopsis
lsusb lists attached USB devices.
lsusb lists attached USB devices.
rawread attempts to read from the specified USB device.
rawread attempts to read from the specified USB device.
Package usb provides a wrapper around libusb-1.0.
Package usb provides a wrapper around libusb-1.0.
Package usbid provides human-readable text output for the usb package.
Package usbid provides human-readable text output for the usb package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL