Sorry but I was wrong compiling.

This is my programa

int main(){
        struct usbdevfs_bulktransfer bulk;
        struct usbdevfs_ioctl ctrl;
        int fd;
        int ret,*data,dato=0xFF,interface=0x00,*inter;
        //data=&dato;
        inter=&interface;
        fd = open("/proc/bus/usb/002/003", O_RDWR);
        if(fd != -1) {
                //bulk.ep = USB_DIR_IN | 1;
                bulk.ep = 1;
                bulk.len = 4;
                bulk.data = data;
                bulk.timeout = 1000;
                //bulk.data = malloc(1024);
                ioctl(fd, USBDEVFS_CLAIMINTERFACE, &interface);
                perror("ioctl");
                ret=ioctl(fd, USBDEVFS_BULK, &bulk);
                perror("ioctl");
                close(fd);
        } 
        return 0;
}

I received this:
ioctl: Success
ioctl: Invalid argument

syslog
kernel: usb 2-2: usbfs: USBDEVFS_BULK failed ep 0x1 len 4 ret -22


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to