Alan Stern wrote:
On Mon, 16 May 2005, coin wrote:


I changed the address for the variable containing 0 and I changed of
the number of bytes 1024 to 1 byte or 4 bytes like you said me. But
the result is the same

int main(){
        struct usbdevfs_bulktransfer bulk;
        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 = 1;
                bulk.len = 1;
                bulk.data = data;
                bulk.timeout = 1000;
                ioctl(fd, USBDEVFS_CLAIMINTERFACE, *inter);
^^^^^^
I think you missed the obvious bug. You don't pass the value, you pass the pointer.


So something like:

>>              ioctl(fd, USBDEVFS_CLAIMINTERFACE, &interface);

should do the trick. I hope this helps,

--
Paulo Marques - www.grupopie.com

An expert is a person who has made all the mistakes that can be
made in a very narrow field.
Niels Bohr (1885 - 1962)


------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&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