LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Writing to "/dev/usb/hiddev*" and to "/proc/bus/usb/00B/00S" throw an arror EI (http://www.linuxquestions.org/questions/programming-9/writing-to-dev-usb-hiddev%2A-and-to-proc-bus-usb-00b-00s-throw-an-arror-ei-204841/)

stpg 07-14-2004 06:44 AM

Writing to /dev/usb/hiddevX and to /proc/bus/usb/00B/00S throw an arror EINVAL
 
Ok. I want READ/WRITE to my PIC16 (usb hid )and can't do this. maybe ill must use ioctl but cant find any examples. Here the my suxx code

unsigned char outbuff[USB_BUFFSIZE]; //USB output buffer. 1 byte for report, 8 bytes for the PIC

//char * dev = "/dev/usb/hiddev0"; <--- this is real my device
char * dev = "/proc/bus/usb/003/001"; <-- too


if ((fd = open(dev, O_RDWR|O_NONBLOCK|O_SYNC)) < 0) {
////
}
int bytes = write(dev,outbuff,USB_BUFFSIZE);
//------------------------------------/
executing
bytes == -1; :))
errno == EINVAL;

BTW i have a root permissions.


All times are GMT -5. The time now is 03:45 PM.