When ever I'm trying to read from a bulk end-point fewer bytes then the
ones which are available I get a broken-pipe signal.
My program is something like:
fd = open("/proc/bus/usb/001/007",O_RDWR);
int interface = 0;
ret = ioctl(fd, USBDEVFS_CLAIMINTERFACE, &interface);
// Write something to the write end-point
// .
// .
// .
// Read the response
struct usbdevfs_bulktransfer bulk;
char buf[255];
bulk.ep = 0x8a;
bulk.len = 1;
bulk.timeout = 500;
bulk.data= (void*)&buf;
int ret = ioctl(fd,USBDEVFS_BULK,&bulk);
Since there are 10 bytes waiting for me in the buffer, I get a broken-pipe
error message. If I change the bulk.len line to be >=10 then it works fine.
What should I do in-order to support "short" reads?
Thanks,
-- Gilad
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel