Sorry but I did not understand you.
Once that I disconnect with this program:

nt main(){
       struct usbdevfs_ioctl ctrl;
       int fd;
       fd = open("/proc/bus/usb/002/003", O_RDWR);
       if(fd != -1) {
               ctrl.ifno = 0;
               ctrl.ioctl_code = USBDEVFS_DISCONNECT;
               ioctl(fd, USBDEVFS_IOCTL, &ctrl);
               perror("ioctl");
               close(fd);
       }
       return 0;
}

I received that:
ioctl: Success
syslog said:
udev[9242]: removing device node '/dev/usb/hiddev0'

when I claim with this program:

int main(){
       int fd;
       int interface=0,*inter;
       inter=&interface;
       fd = open("/proc/bus/usb/002/003", O_RDWR);
       if(fd != -1) {
               ioctl(fd, USBDEVFS_CLAIMINTERFACE, &interface);
               perror("ioctl");
               close(fd);
       }
       return 0;
}

I received that:
ioctl: Success
And syslog did not said anything

when I try to send data with:
int main(){
       struct usbdevfs_bulktransfer bulk;
       int fd;
       int ret,*data,dato=0xFF;
       data=&dato;
       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_BULK, &bulk);
               perror("ioctl");
               close(fd);
       }
       return 0;
}


I received:
ioctl: Invalid argument
And syslog said that:
kernel: usb 2-1: usbfs: process 9272 (enviar) did not claim interface
0 before use
kernel: usb 2-1: usbfs: USBDEVFS_BULK failed ep 0x1 len 4 ret -22


Thank you
And sorry but my english is not good.


-------------------------------------------------------
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