Move files from gousb/usb to gousb

This commit is contained in:
Sebastian Zagrodzki
2017-05-06 00:11:11 +02:00
parent acb9ee3242
commit 5200a36191
33 changed files with 79 additions and 79 deletions

View File

@@ -21,7 +21,7 @@ import (
"fmt"
"log"
"github.com/google/gousb/usb"
"github.com/google/gousb"
"github.com/google/gousb/usbid"
)
@@ -33,14 +33,14 @@ func main() {
flag.Parse()
// Only one context should be needed for an application. It should always be closed.
ctx := usb.NewContext()
ctx := gousb.NewContext()
defer ctx.Close()
// Debugging can be turned on; this shows some of the inner workings of the libusb package.
ctx.Debug(*debug)
// ListDevices is used to find the devices to open.
devs, err := ctx.ListDevices(func(desc *usb.Descriptor) bool {
devs, err := ctx.ListDevices(func(desc *gousb.Descriptor) bool {
// The usbid package can be used to print out human readable information.
fmt.Printf("%03d.%03d %s:%s %s\n", desc.Bus, desc.Address, desc.Vendor, desc.Product, usbid.Describe(desc))
fmt.Printf(" Protocol: %s\n", usbid.Classify(desc))