Hi I need to send data to USB PIC16c745 this is my c code.

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 = 1;
               bulk.len = 1024;
               bulk.data = data;
               bulk.timeout = 1000;
               ret = ioctl(fd, USBDEVFS_BULK, &bulk);
               perror("ioctl");
               if (ret < 0)
                       printf("Error in bulk transfer\n");
               /*else {

               }*/
               close(fd);
       }
       return 0;
}

But it send to me a ioctl device or resource busy. I try too with libusb:

usb_interrupt_write(udev,1,byte,8,10)

but i got the same message device or resource busy. In win98 I can
send data to USB PIC16745 with the same firmware. I got the firmware
and control OCX in this page
http://www.alecmcnamara.freeserve.co.uk/piccalc/.

But I need to make it on GNU/Linux.

Thank you


-------------------------------------------------------
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_ids93&alloc_id281&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to