make addr() part of EndpointInfo

This commit is contained in:
Sebastian Zagrodzki
2017-04-09 18:55:41 +02:00
parent 13f4e95f2f
commit f58798160d
2 changed files with 8 additions and 8 deletions

View File

@@ -374,11 +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)
addr := ep.Number & endpointNumMask
if ep.Direction == EndpointDirectionIn {
addr |= endpointDirectionMask
}
xfer.endpoint = C.uchar(addr)
xfer.endpoint = C.uchar(ep.addr())
xfer.timeout = C.uint(timeout / time.Millisecond)
xfer._type = C.uchar(ep.TransferType)
xfer.num_iso_packets = C.int(isoPackets)