[libhid-discuss] help with usage path

Washington Trindade washingtonuesc at gmail.com
Thu Jul 5 23:11:18 UTC 2007


Charles,

Finally, I can write in the usb device. As explain the document you sent me
the packet size is a fixed 8-byte. So the first byte must be the quantity of
data. So the packet seem like this:

char packet[] = {0x02, 0x054, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00};

//And then, to write the device
ret = hid_interrupt_write( hid, 0x02, packet, 8, timeout );

To read from the device is the same process, but I want to read more than 8
bytes, which is the max length of the packet. Then, I think I would to do
many reads in a loop and concatenate the result in a buffer,  but I don't
know how to stop that loop? the hid_interrupt_read says when there is no
more data?


-- 
The best index to a person's character is a) how he treats people who can't
do him any good and b) how he treats people who can't fight back


More information about the libhid-discuss mailing list