Redigera

Dela via


HID application programming interface (API)

There are three categories of HID APIs:

  1. Device discovery and setup
  2. Data movement
  3. Report creation and interpretation

Device discovery and setup

These HID APIs are used to identify the properties of a HID device and to establish communication with that device. Applications use these APIs to identify a top level collection.

Data movement

The following HID APIs are used to move data between an application and a selected device.

Report creation and interpretation

Developers of custom hardware know the size and format of each report issued by their device. In this case, the application can cast the input and output report buffers as structs and consume the data.

Developers of HID applications intended to communicate with all devices that expose common functionality might not know the size and format of the HID reports. This category of application understands certain top level collections and certain usages.

To interpret the reports received from a device or to create reports to be sent the application must use the report descriptor to determine if and where a particular usage is located in the reports and the units of values in the reports. In these cases, HID parsing is required. Windows provides a HID parser for use by drivers and applications via APIs (HidP_*) that can be used to discover the types of usages supported by a device, determine the state of such usages in a report, or to build a report to change the state of a usage in the device.

Here's the list of HID parser APIs: