[libhid-discuss] Trying to repair a program using libhid to configure an Ultimarc Joystick
Andrew Silverman
andrewsi at microsoft.com
Wed Mar 25 04:12:18 UTC 2015
What I don't really understand is the 0x43/0xC3 bytes for requesttype and the E9/EA/EB values in request. (Assuming that I am correctly understanding those param mappings in the existing calls to usb_control_msg, anyway.) I can't seem to find anything in the description of USB control messages that makes those values make sense.
-----Original Message-----
From: Xiaofan Chen [mailto:xiaofanc at gmail.com]
Sent: Tuesday, March 24, 2015 8:57 PM
To: Andrew Silverman
Cc: libhid-discuss at lists.alioth.debian.org
Subject: Re: [libhid-discuss] Trying to repair a program using libhid to configure an Ultimarc Joystick
On Wed, Mar 25, 2015 at 11:43 AM, Andrew Silverman <andrewsi at microsoft.com> wrote:
> I’m having some trouble understanding how to set up the destination
> bits correctly for requesttype/request – When I looked at the USB 2
> spec tables that describe these, they just don’t seem to correspond in
> a sensible way to the values the original author was using, and so I’m
> a bit lost.
>
Ref: Ch7 of the HID spec should be good for you.
http://www.usb.org/developers/hidpage/HID1_11.pdf
Some cheat codes for you, from Linux USB developer Alan Stern. It might help you to translate HID report read/write to control IN/OUT transfer.
Standard device requests
RQtype Req Value Index Length
----------------------------------------------
0 1 dev-feat 0 0 Clear device feature
0 3 dev-feat 0 0 Set device feature
0 5 address 0 0 Set device address
0 9 config-value 0 0 Set configuration
1 b altsetting intf 0 Set interface
1 1 intf-feat intf 0 Clear interface feature
1 3 intf-feat intf 0 Set interface feature
2 1 ep-feat ep 0 Clear endpoint feature
2 3 ep-feat ep 0 Set endpoint feature
80 0 0 0 2 Get device status
80 6 descr-type/ 0/ len Get descriptor
index lang-ID
80 8 0 0 1 Get configuration
81 0 0 intf 2 Get interface status
81 a 0 intf 1 Get interface (altsetting)
82 0 0 ep 2 Get endpoint status
Device features: 0 = self-powered, 1 = remote wakeup Interface features: None Endpoint features: 0 = halt Descriptor types: 1 = device, 2 = config, 3 = string, (4 = interface,
5 = endpoint), 6 = device qualifier, 7 = other-speed config
HID class requests
RQtype Req Value Index Length
----------------------------------------------
21 9 report-type/ID intf len Set report
21 a duration/ID intf 0 Set idle
21 b proto intf 0 Set protocol
81 6 descr-type/set intf len Get class descriptor
a1 1 report-type/ID intf len Get report
a1 2 0/ID intf 1 Get idle
a1 3 0 intf 1 Get protocol
Report type: 1 = input, 2 = output, 3 = feature Descriptor type: 21 = HID, 22 = Report, 23 = Physical
Protocol: 0 = boot, 1 = report
--
Xiaofan
More information about the libhid-discuss
mailing list