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

# IOUserUSBHostHIDDevice

A provider object for USB devices that support HID interactions.

```
class IOUserUSBHostHIDDevice;
```

## Overview

An `IOUserUSBHostHIDDevice` object is a fully functional provider object that represents a USB-based HID device. Typically, you don’t create `IOUserUSBHostHIDDevice` objects directly. Instead, you specify that your driver relies on an `IOUserUSBHostHIDDevice` as its provider, and the system creates the interface object for you during the matching process.

When implementing a custom driver, use this provider object to manage the connection to the underlying device. Specifically, use it to get reports from the device and to manage the device’s configuration. For example, use the object to configure the USB device’s idle policy.

Subclass `IOUserUSBHostHIDDevice` only when you want to customize the interactions with the USB device. For example, you might use a custom subclass to initialize the USB device in a particular way or support a custom transport mechanism. You can also use a custom subclass to perform additional processing on the report data.

### Specify the Driver’s Personality Information

When you subclass `IOUserUSBHostHIDDevice`, update the `IOKitPersonalities` key of your driver extension’s `Info.plist` file with information to match your driver to appropriate hardware. For this class, always include the keys and values in the following table.

|Key                                                                                                       |Discussion                                                                                                                                        |
|----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
|`IOClass`                                                                                                 |The value `AppleUserHIDDevice`.                                                                                                                   |
|`IOProviderClass`                                                                                         |The provider class information. For a USB-based HID device, specify <doc://com.apple.documentation/documentation/USBDriverKit/IOUSBHostInterface>.|
|`IOUserClass`                                                                                             |The name of your custom subclass.                                                                                                                 |
|<doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/CFBundleIdentifier>|The bundle identifier of your driver.                                                                                                             |

You may add other keys to assist with the matching process. For example, you might include the `VendorID`, `ProductID`, `PrimaryUsagePage`, and `PrimaryUsage` keys to match against specific USB devices and HID usage types. The USB specification defines which keys to include when matching your driver to a USB device. For information about the specific key combinations, see *Universal Serial Bus Common Class Specification* at <https://www.usb.org>.

## Topics

### Running the Service

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

Handles the basic initialization of the event service.

[`virtual kern_return_t Start(IOService *provider);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/Start)

Starts the current device service and associates it with the specified provider object.

[`virtual bool handleStart(IOService *provider);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/handleStart)

Performs any custom initialization associated with starting the device service.

[`virtual kern_return_t Stop(IOService *provider);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/Stop)

Stops the device service associated with the specified provider.

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

Performs any final cleanup for the service.

### Getting the Device Description

[`virtual OSDictionary * newDeviceDescription();`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/newDeviceDescription)

Creates and returns a new dictionary that describes the HID device.

### Managing Device Reports

[`virtual OSData * newReportDescriptor();`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/newReportDescriptor)

Returns the data in the HID device’s report descriptor.

[`virtual kern_return_t getReport(IOMemoryDescriptor *report, IOHIDReportType reportType, IOOptionBits options, uint32_t completionTimeout, OSAction *action);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/getReport-6stqs)

Gets a report from the HID device.

[`kern_return_t getReport(IOMemoryDescriptor *report, IOHIDReportType reportType, IOOptionBits options, uint32_t completionTimeout, uint32_t *bytesTransferred);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/getReport-2v8zk)

Gets a report from the HID device.

[`virtual kern_return_t setReport(IOMemoryDescriptor *report, IOHIDReportType reportType, IOOptionBits options, uint32_t completionTimeout, OSAction *action);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/setReport)

Sends a report to the HID device.

[`virtual kern_return_t initInputReport();`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/initInputReport)

Starts reading the input report from the device.

[`virtual void CompleteInputReport(OSAction *action, IOReturn status, uint32_t actualByteCount, uint64_t completionTimestamp);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/CompleteInputReport)

Processes the results of an asynchronous request for an input report.

[`virtual void scheduleInputReportRetry(kern_return_t reason);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/scheduleInputReportRetry)

Retries a previous request for an input report.

[`virtual void cancelInputReportRetry();`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/cancelInputReportRetry)

Cancels a retry attempt for an input report request.

[`virtual void TimerOccurred(OSAction *action, uint64_t time);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/TimerOccurred)

Handles timeout-related actions when retrying input report requests.

### Configuring the Device

[`virtual kern_return_t setProtocol(uint16_t protocol);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/setProtocol)

Sets the active protocol to use for communicating with the USB device.

[`virtual kern_return_t setIdle(uint16_t idleTimeMs);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/setIdle)

Sets the device’s idle time.

[`virtual kern_return_t setIdlePolicy(USBIdlePolicyType type, uint16_t idleTimeMs);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/setIdlePolicy)

Sets the amount of idle time that must pass before suspending the device.

[`virtual void setProperty(OSObject *key, OSObject *value);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/setProperty)

Updates the specified property on the corresponding kernel object.

[`virtual void reset();`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/reset)

Resets the USB device.

[`typedef enum { ... } USBIdlePolicyType;`](/documentation/HIDDriverKit/USBIdlePolicyType)

Constants that specify whether to apply the idle policy to an interface or pipe.

### Configuring Private Settings

[`kern_return_t initPipes();`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/initPipes)

[`kern_return_t getHIDDescriptorInfo(uint8_t type, const IOUSBHostHIDDescriptorInfo **info, uint8_t *index);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/getHIDDescriptorInfo)

[`virtual void CompleteZLP(OSAction *action, IOReturn status, uint32_t actualByteCount, uint64_t completionTimestamp);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/CompleteZLP)

[`OSString * copyStringAtIndex(uint8_t index, uint16_t lang);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/copyStringAtIndex)

### Instance Methods

[`virtual void CompleteOutputReport(OSAction *action, IOReturn status, uint32_t actualByteCount, uint64_t completionTimestamp);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/CompleteOutputReport)

[`virtual void CompleteOutputRequest(OSAction *action, IOReturn status, uint32_t bytesTransferred);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/CompleteOutputRequest)

[`OSAction * getAction(HIDActionType type);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/getAction)

[`bool isBulkPipeSupported(const IOUSBDeviceDescriptor *desc);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/isBulkPipeSupported)

[`void returnAction(OSAction *action);`](/documentation/HIDDriverKit/IOUserUSBHostHIDDevice/returnAction)

## Relationships

### Inherits From

[`IOUserHIDDevice`](/documentation/HIDDriverKit/IOUserHIDDevice)

---

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)