From c437b39ef7c420f719befb7ca4b68d54ba3fea74 Mon Sep 17 00:00:00 2001 From: Sebastian Zagrodzki Date: Sun, 9 Apr 2017 16:56:36 +0200 Subject: [PATCH] comments for endpointinfo type fields --- usb/config.go | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/usb/config.go b/usb/config.go index 570ab37..2d599a0 100644 --- a/usb/config.go +++ b/usb/config.go @@ -21,14 +21,27 @@ import ( "time" ) +// EndpointInfo contains the information about an interface endpoint, collected +// from the descriptor. type EndpointInfo struct { - Number uint8 - Direction EndpointDirection + // 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. + Number uint8 + // Direction defines whether the data is flowing IN or OUT from the host perspective. + Direction EndpointDirection + // MaxPacketSize is the maximum USB packet size for a single frame/microframe. MaxPacketSize uint32 - TransferType TransferType - PollInterval time.Duration - IsoSyncType IsoSyncType - UsageType UsageType + // TransferType defines the endpoint type - bulk, interrupt, isochronous. + TransferType TransferType + // PollInterval is the maximum time between transfers for interrupt and isochronous transfer, + // or the NAK interval for a control transfer. See endpoint descriptor bInterval documentation + // in the USB spec for details. + PollInterval time.Duration + // IsoSyncType is the isochronous endpoint synchronization type, as defined by USB spec. + IsoSyncType IsoSyncType + // UsageType is the isochronous or interrupt endpoint usage type, as defined by USB spec. + UsageType UsageType } func (e EndpointInfo) String() string {