gofmt
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"flag"
|
"flag"
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/kylelemons/gousb/usb"
|
"github.com/kylelemons/gousb/usb"
|
||||||
|
@@ -32,9 +32,9 @@ func (e Endpoint) Direction() EndpointDirection {
|
|||||||
func (e Endpoint) String() string {
|
func (e Endpoint) String() string {
|
||||||
return fmt.Sprintf("Endpoint %d %-3s %s - %s %s",
|
return fmt.Sprintf("Endpoint %d %-3s %s - %s %s",
|
||||||
e.Number(), e.Direction(),
|
e.Number(), e.Direction(),
|
||||||
TransferType(e.Attributes) & TRANSFER_TYPE_MASK,
|
TransferType(e.Attributes)&TRANSFER_TYPE_MASK,
|
||||||
IsoSyncType(e.Attributes) & ISO_SYNC_TYPE_MASK,
|
IsoSyncType(e.Attributes)&ISO_SYNC_TYPE_MASK,
|
||||||
IsoUsageType(e.Attributes) & ISO_USAGE_TYPE_MASK,
|
IsoUsageType(e.Attributes)&ISO_USAGE_TYPE_MASK,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -9,9 +9,9 @@ type Descriptor struct {
|
|||||||
|
|
||||||
Type DescriptorType // The type of this descriptor
|
Type DescriptorType // The type of this descriptor
|
||||||
Spec BCD // USB Specification Release Number
|
Spec BCD // USB Specification Release Number
|
||||||
Class uint8 // The class of this device
|
Class uint8 // The class of this device
|
||||||
SubClass uint8 // The sub-class (within the class) of this device
|
SubClass uint8 // The sub-class (within the class) of this device
|
||||||
Protocol uint8 // The protocol (within the sub-class) of this device
|
Protocol uint8 // The protocol (within the sub-class) of this device
|
||||||
Vendor ID // The 8-bit Vendor identifer
|
Vendor ID // The 8-bit Vendor identifer
|
||||||
Product ID // The 8-bit Product identifier
|
Product ID // The 8-bit Product identifier
|
||||||
Device BCD // The device version
|
Device BCD // The device version
|
||||||
|
@@ -89,7 +89,8 @@ func (d *Device) Reset() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var ControlTimeout = 5*time.Second
|
var ControlTimeout = 5 * time.Second
|
||||||
|
|
||||||
func (d *Device) Control(rType, request uint8, val, idx uint16, data []byte) (int, error) {
|
func (d *Device) Control(rType, request uint8, val, idx uint16, data []byte) (int, error) {
|
||||||
dataSlice := (*reflect.SliceHeader)(unsafe.Pointer(&data))
|
dataSlice := (*reflect.SliceHeader)(unsafe.Pointer(&data))
|
||||||
n := C.libusb_control_transfer(
|
n := C.libusb_control_transfer(
|
||||||
|
@@ -20,7 +20,7 @@ func (v Vendor) String() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Product struct {
|
type Product struct {
|
||||||
Name string
|
Name string
|
||||||
Interface map[usb.ID]string
|
Interface map[usb.ID]string
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ func (p Product) String() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Class struct {
|
type Class struct {
|
||||||
Name string
|
Name string
|
||||||
SubClass map[uint8]*SubClass
|
SubClass map[uint8]*SubClass
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ func (c Class) String() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SubClass struct {
|
type SubClass struct {
|
||||||
Name string
|
Name string
|
||||||
Protocol map[uint8]string
|
Protocol map[uint8]string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user