From: lpx <sin...@ho...> - 2007-04-30 20:55:12
|
Hi, I have tried to change the class value to 0xFF but it brought me problems. Before the change the device appeared to the system as a joystick, and after the change it was not being found as a joystick. Nuno Tim Roberts wrote: > > lpx wrote: >> -> You shouldn't declare yourself as device class 0. That has a specific >> meaning -- it means you are a composite device, which this device is >> not. The "vendor-defined" device class is 0xff, and that's what you >> should use. >> >> I didnt made this device descriptor. I'm just using it. Thx for the >> corrections. >> > > I thought this was a device you were building. > >> Can you tell me something? >> >> Why should it be a vendor-defined instead of composite? >> > > By declaring the device class as one of the known values, you are > promising that your device follows the USB specification for that > class. A composite device acts like a USB hub. It means you have > several different interfaces, each of which can be treated > independently. For example, USB cameras are often composite devices, > with an audio interface and a video interface inside. > > The problem with declaring yourself as a composite is that the operating > system believes it knows how to talk to a composite device, by treating > it like a USB hub. If you plug your device into Windows, for example, > the operating system will assign the USB hub driver to your device > automatically. > > If you don't act like one of the pre-defined device classes, then you > must declare yourself as vendor-defined. USB devices must follow the > rules in the USB specifications. It would be more accurate to declare > your device as being in the HID class, if that's the model you intend to > use. > >> -> If you want 8 bytes, why did you try to read 60 bytes? >> >> You are right! I don't want to read 8 but 60 which is the length of the >> report. Another mistake! >> > > 60 is the length of the report DESCRIPTOR, not the report. This is a > very important distinction. The report descriptor tells you how long > the reports will be. > >> Can you telll me one more thing? >> >> Why does the executable of libusb program look like a shell script? That >> is >> very weird! And if i want to use libusb to access USB devices into >> complex >> programs, they cannot look like a sheel script... What is going on? >> > > libusb is not a program, it is a library that gets linked in to your own > programs. All Unix libraries start out with the text string > "!<arch>\n". This is just how the "ar" program identifies its > products. If you do "file libusb.a", you will clearly see that it is > not mistaken for a shell script. > > -- > Tim Roberts, ti...@pr... > Providenza & Boekelheide, Inc. > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Libusb-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-devel > > -- View this message in context: http://www.nabble.com/How-to-read-reports-with-libusb-tf3663897.html#a10260479 Sent from the LibUSB Dev mailing list archive at Nabble.com. |