use ConfigDesc, InterfaceDesc and EndpointDesc.

This commit is contained in:
Sebastian Zagrodzki
2017-05-06 02:43:16 +02:00
parent e5961a7cc4
commit 4991f9c89b
10 changed files with 35 additions and 35 deletions

View File

@@ -23,7 +23,7 @@ import (
// EndpointInfo contains the information about an interface endpoint, extracted
// from the descriptor.
type EndpointInfo struct {
type EndpointDesc struct {
// Number represents the endpoint number. Note that the endpoint number is different from the
// address field in the descriptor - address 0x82 means endpoint number 2,
// with endpoint direction IN.
@@ -55,7 +55,7 @@ func endpointAddr(n int, d EndpointDirection) int {
}
// String returns the human-readable description of the endpoint.
func (e EndpointInfo) String() string {
func (e EndpointDesc) String() string {
ret := make([]string, 0, 3)
ret = append(ret, fmt.Sprintf("ep #%d %s (address 0x%02x) %s", e.Number, e.Direction, endpointAddr(e.Number, e.Direction), e.TransferType))
switch e.TransferType {
@@ -72,7 +72,7 @@ type endpoint struct {
h *libusbDevHandle
InterfaceSetting
Info EndpointInfo
Info EndpointDesc
Timeout time.Duration
}