Interrupt-out with Interrupt-in and libusb1.0
Posted: Sun Jan 03, 2010 4:21 pm
Hi -
The project I'm working on needs both interrupt-in and interrupt-out transfers at the same time, and I'm using libusb 1.0 at the host end, latest vusb at the driver end.
I've got control transfers working ok, and interrupt-in, but now I'm trying to get the host to send interrupt-out packets to the device, it doesn't work.
I've done the following:
USB_CFG_HAVE_INTRIN_ENDPOINT3 = 0
USB_CFG_IMPLEMENT_FN_WRITEOUT = 1
I've implemented a usbFunctionWriteOut() method
At the libusb end:
When I send a couple of characters to the endpoint I get error -5 which is LIBUSB_ERROR_NOT_FOUND
I suspect that the issue is that the endpoint doesn't exist or I'm addressing it wrong. Can anyone help me with what I'm doing wrong - have I missunderstood how to address the interrupt-out endpoint?
Another related question - is an interrupt-in and an interrupt-out endpoint two endpoints or one? The host software reports that configuration as having 1 endpoint (apart from control) so does this mean I'm missing an endpoint?
I've looked for example of interrupt-out endpoints and cannot find any.
Thanks!
Daniel
The project I'm working on needs both interrupt-in and interrupt-out transfers at the same time, and I'm using libusb 1.0 at the host end, latest vusb at the driver end.
I've got control transfers working ok, and interrupt-in, but now I'm trying to get the host to send interrupt-out packets to the device, it doesn't work.
I've done the following:
USB_CFG_HAVE_INTRIN_ENDPOINT3 = 0
USB_CFG_IMPLEMENT_FN_WRITEOUT = 1
I've implemented a usbFunctionWriteOut() method
At the libusb end:
Code: Select all
int send=(buf->size)>8?8:(buf->size);
result = libusb_interrupt_transfer(h, (1 | LIBUSB_ENDPOINT_OUT), buf->buffer, send , &transferred, TIMEOUT);
When I send a couple of characters to the endpoint I get error -5 which is LIBUSB_ERROR_NOT_FOUND
I suspect that the issue is that the endpoint doesn't exist or I'm addressing it wrong. Can anyone help me with what I'm doing wrong - have I missunderstood how to address the interrupt-out endpoint?
Another related question - is an interrupt-in and an interrupt-out endpoint two endpoints or one? The host software reports that configuration as having 1 endpoint (apart from control) so does this mean I'm missing an endpoint?
I've looked for example of interrupt-out endpoints and cannot find any.
Thanks!
Daniel