Human Interface Device (HID) Class Decoder

来源:互联网 发布:python pywin32 编辑:程序博客网 时间:2024/05/20 18:50

Human Interface Device (HID) class is one of the most frequently used USB classes. The HID class consists primarily of devices that are used by humans to control the operation of computer systems. Examples of HID class devices include keyboards, pointing devices (such as mouse devices, joysticks and trackballs), control devices (such as steering wheels, throttles, rudder pedals, and data gloves), the devices that humans use to enter data directly into a computer (such as telephones, VCR remote controls, games and simulation devices), and other devices that may not require direct human interaction but provide data in a similar to HID class devices format (such as bar code readers, voltmeters, and thermometers).

The HID device class specification defines the configuration and communication protocols for human interface devices. USBlyzer includes fully comprehensive USB HID class decoder that helps you easily visualize various HID class specific requests. HID Descriptor, HID Report Descriptor and HID Reports are also decoded.


HID Class-Specific Protocols

All HID Class, SubClass and Protocols below are supported:

ClassSubClassProtocolMeaning03h00h - None
01h - Boot Interface00hNone01hKeyboard02hMouse


HID Class-Specific Descriptors

HID class devices use class-specific descriptors which are differ from standard USB descriptors. USBlyzer decodes and displays the following HID class-specific descriptors:

  • HID Descriptor

    A HID Descriptor specifies the number, type, and size of HID Report Descriptors and Physical Descriptors that are associated with a HID class device.

  • HID Report Descriptor

    The format of the data a HID class device can send or receive is not defined by the HID class specification. Instead, a HID device is required to provide HID Report Descriptor which enumerates all the data fields of a particular HID report the device can use. For each field in the HID report, the HID Report Descriptor defines how many bits the particular data item occupies, which usage it has, what range of values it uses, etc.

Below is an example of decoding Mouse HID Report Descriptor.

HID Class-Specific Requests

HID class-specific requests allow the host to inquire about the capabilities and state of a HID compliant device and to set the state of output and feature items.

All HID class-specific requests below are supported:

  • Get Report (GET_REPORT)

  • Set Report (SET_REPORT)

  • Get Idle (GET_IDLE)

  • Set Idle (SET_IDLE)

  • Get Protocol (GET_PROTOCOL)

  • Set Protocol (SET_PROTOCOL)

For complete description of USB HID class requests, refer to Device Class Definition for Human Interface Devices Specification.

Below are examples of decoding Get Descriptor (HID Report Descriptor) and Set Idle requests.

HID Reports

The basic communication mechanism for HID class devices is a HID Reports that is used to transfer HID control data. HID Report Descriptor defines the format of each report. Input and Output Reports specify control data and Feature Reports specify configuration data. A device may support more than one report type and more than one report of the same type.

USBlyzer extracts the individual items from the HID Report based on the HID Report Descriptor and displays them in an easy to view form. Since USBlyzer uses its own HID Parser it's possible to decode HID Reports at any time, even after the device has been unplugged or even if you analize previously saved capture file.

Below is an example of Joystick HID Input Report analysis.

HID Usage Pages

HID usages are organized into usage pages of related controls. The usage page and usage ID define a unique constant that describes a particular type of control. The following table lists the currently supported usage pages.

Page IDPage Name01hGeneric Desktop Controls02hSimulation Controls03hVR Controls04hSport Controls05hGame Controls06hGeneric Device Controls07hKeyboard/Keypad08hLEDs09hButton0AhOrdinal0BhTelephony Devices0ChConsumer Devices0DhDigitizer0FhPhysical Input Device (PID)10hUnicode14hAlphanumeric Display40hMedical Instruments80hMonitor Devices81hMonitor Enumerated Values82hVESA Virtual Controls83hVESA Command84hPower Device85hBattery System

Composite USB Device with Single or Multiple HID Class Interfaces

A composite USB device exposes multiple functions to a host by using multiple interfaces which are separately managed by different drivers. Each interface of a composite device is, in many respects, like a separate device that has its own configuration descriptor and, in the case of HID class interface(s), HID report descriptor(s). The default control endpoint is shared by all the interfaces while separate HID class interfaces require non-shareable interrupt endpoint(s).

USBlyzer provides support for USB composite devices with single or multiple HID interfaces.


原创粉丝点击