Make all transfer types use a generic endpoint.transfer() function

that uses libusb's asynchronous interface.
This commit is contained in:
Sebastian Zagrodzki
2017-02-10 22:06:57 +01:00
parent c9c2757fe6
commit 87abb704d7
3 changed files with 13 additions and 43 deletions

View File

@@ -151,16 +151,6 @@ func (d *Device) OpenEndpoint(conf, iface, setup, epoint uint8) (Endpoint, error
}
end.InterfaceSetup = s
end.EndpointInfo = e
switch tt := TransferType(e.Attributes) & TRANSFER_TYPE_MASK; tt {
case TRANSFER_TYPE_BULK:
end.xfer = bulk_xfer
case TRANSFER_TYPE_INTERRUPT:
end.xfer = interrupt_xfer
case TRANSFER_TYPE_ISOCHRONOUS:
end.xfer = isochronous_xfer
default:
return nil, fmt.Errorf("usb: %s transfer is unsupported", tt)
}
goto found
}
return nil, fmt.Errorf("usb: unknown endpoint %02x", epoint)