<!--
{
  "availability" : [
    "DriverKit: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "HIDDriverKit",
  "identifier" : "/documentation/HIDDriverKit/IOHIDInterface",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "HIDDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOHIDInterface"
  },
  "title" : "IOHIDInterface"
}
-->

# IOHIDInterface

A provider object for a HID device’s interface.

```
class IOHIDInterface;
```

## Overview

An `IOHIDInterface` object represents a specific interface of the HID device. Typically, you don’t create `IOHIDInterface` objects directly. Instead, you specify that your driver relies on an `IOHIDInterface` as its provider, and the system creates the interface object for you during the matching process.

To use a HID interface object directly, call [`Open`](/documentation/HIDDriverKit/IOHIDInterface/Open) to create a new session between the interface and your custom driver. When calling that method, you specify an <doc://com.apple.documentation/documentation/DriverKit/OSAction> object to execute each time a new report is ready to process. When a new report arrives, the `IOHIDInterface` object parses the device’s report data, puts the data into a set of [`IOHIDElement`](/documentation/HIDDriverKit/IOHIDElement) objects, and notifies your action object. Use your action object’s [`ReportAvailable`](/documentation/HIDDriverKit/IOHIDInterface/ReportAvailable) method to parse the element objects and dispatch events.

## Topics

### Running the Interface

[`virtual bool init();`](/documentation/HIDDriverKit/IOHIDInterface/init)

Handles the basic initialization of the interface.

[`virtual void free();`](/documentation/HIDDriverKit/IOHIDInterface/free)

### Managing the Session

[`virtual kern_return_t Open(IOService *forClient, IOOptionBits options, OSAction *action);`](/documentation/HIDDriverKit/IOHIDInterface/Open)

Opens a session to the device and begins the delivery of input reports.

[`virtual kern_return_t Close(IOService *forClient, IOOptionBits options);`](/documentation/HIDDriverKit/IOHIDInterface/Close)

Closes the interface and stops the delivery of input reports.

### Getting and Setting Input Reports

[`virtual void ReportAvailable(uint64_t timestamp, uint32_t reportID, uint32_t reportLength, IOHIDReportType type, IOMemoryDescriptor *report, OSAction *action);`](/documentation/HIDDriverKit/IOHIDInterface/ReportAvailable)

Notifies the interface that an updated report is available from the HID device.

[`virtual kern_return_t AddReportToPool(IOBufferMemoryDescriptor *report);`](/documentation/HIDDriverKit/IOHIDInterface/AddReportToPool)

Adds a memory descriptor to the report pool.

[`virtual void processReport(uint64_t timestamp, uint8_t *report, uint32_t reportLength, IOHIDReportType type, uint32_t reportID);`](/documentation/HIDDriverKit/IOHIDInterface/processReport)

Parses the contents of the specified report and updates the interface’s elements.

[`virtual kern_return_t GetReport(IOMemoryDescriptor *report, IOHIDReportType reportType, uint32_t reportID, IOOptionBits options);`](/documentation/HIDDriverKit/IOHIDInterface/GetReport)

Retrieves a new input report from the HID device.

[`virtual kern_return_t SetReport(IOMemoryDescriptor *report, IOHIDReportType reportType, uint32_t reportID, IOOptionBits options);`](/documentation/HIDDriverKit/IOHIDInterface/SetReport)

Sends a report to the HID device.

### Accessing the Elements of a Report

[`virtual OSArray * getElements();`](/documentation/HIDDriverKit/IOHIDInterface/getElements)

Returns the array of elements that the interface uses to store  parsed report data.

[`virtual kern_return_t commitElements(OSArray *elements, IOHIDElementCommitDirection direction);`](/documentation/HIDDriverKit/IOHIDInterface/commitElements)

Gets or sets the contents of the interface’s stored elements.

## Relationships

### Inherits From

[`IOService`](/documentation/DriverKit/IOService)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)