String of the endpoint should use EndpointInfo, not the default mapping

from InterfaceInfo.
This commit is contained in:
Sebastian Zagrodzki
2017-04-09 00:18:54 +02:00
parent ca02c03241
commit ab6b612d1b

View File

@@ -30,6 +30,10 @@ type Endpoint struct {
writeTimeout time.Duration
}
func (e *Endpoint) String() string {
return e.Info.String()
}
func (e *Endpoint) Read(buf []byte) (int, error) {
if e.Info.Direction != EndpointDirectionIn {
return 0, fmt.Errorf("usb: read: not an IN endpoint")