I am trying to do a control transfer on the infineon fx3 but when I call libusb_control_transfer()
I get LIBUSB_ERROR_PIPE
.
Can anyone help with this please?
int BulkTransferLoopback::sendControl(uint8_t data[], int length, uint8_t rx[]) {
int numdevs = cyusb_open();
if (numdevs > 0)
{
int r = cyusb_open(VENDORID, PRODUCTID);
if (r != 1) {
// check for errors
printf("Could not open device!\n");
}
_handle = cyusb_gethandle(0);
findEndpoints();
// Send data
// I think error is coming from parameters 1-3.
int err = libusb_control_transfer(_handle, 0x40, 42, 0x1234, 0, data, 2, 1000);
printf("%s\n", libusb_error_name(err));
cyusb_close();
}
return numdevs;
}