On Wed, Oct 27, 2004 at 05:03:50PM +0200, Patrick Boettcher wrote: > I try to get the mentioned USB device to run in Linux. It is a small (USB > stick sized) device, which only passes through the radio signal to the > line in. Control is done via USB. > > I did some reverse engineering in Windows and I think I determined all > important functions (i.e. bytes :) ). > > As it is a HID device I started to read something about HID on usb.org and > in linux/Documentation and I began to write a user space program which > accesses the device through the /dev/usb/hiddev*-file. > > My problem now is, I don't know how to control the device using the > ioctl-calls. I see the bytes from the rev-eng. but I don't know what > they mean regarding to the HID-specs. Report_id, -_type, or something.
The report structure of any HID device is described by its Report Descriptor. You can get a dump of this descriptor using "lsusb -v", but the usbhid module (it was named "hid" in older kernels) must be unloaded. > For example: > > setting a frequency looks like this: > > buffer > to ep 2: 00 55 aa 03 a4 00 00 08 (0xa4 probably mean tunetofreq) > to ep 2: 20 2e 01 00 00 00 00 00 (mean 102750 kHz) > > switching mono/stereo like this: > > buffer > to ep 2: 00 55 aa 00 ae 01 00 00 (0xae mono/stereo, 0x01 mean mono) > > So sometimes an extra buffer is necessary sometimes not. > > I would very much appreciate if someone could point me out, how I have to > write the buffer above using the ioctl-calls for the hiddev. hiddev works at a higher level - you will need to find out the report structure from the report descriptor and set report fields using the appropriate usage codes and such.
pgphtg9z4k0wm.pgp
Description: PGP signature