OpenEndpoint for now takes an address - a device can have two endpoints

with the same number...
This commit is contained in:
Sebastian Zagrodzki
2017-04-09 19:08:42 +02:00
parent c44b5b7307
commit f668df87df
4 changed files with 15 additions and 13 deletions

View File

@@ -374,7 +374,7 @@ func (libusbImpl) alloc(d *libusbDevHandle, ep *EndpointInfo, timeout time.Durat
return nil, fmt.Errorf("libusb_alloc_transfer(%d) failed", isoPackets)
}
xfer.dev_handle = (*C.libusb_device_handle)(d)
xfer.endpoint = C.uchar(ep.addr())
xfer.endpoint = C.uchar(endpointAddr(ep.Number, ep.Direction))
xfer.timeout = C.uint(timeout / time.Millisecond)
xfer._type = C.uchar(ep.TransferType)
xfer.num_iso_packets = C.int(isoPackets)