<!--
{
  "availability" : [
    "macCatalyst: 14.0.0 -",
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "IOUSBHost",
  "identifier" : "/documentation/IOUSBHost/IOUSBHostObject",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "IOUSBHost"
    ],
    "preciseIdentifier" : "c:objc(cs)IOUSBHostObject"
  },
  "title" : "IOUSBHostObject"
}
-->

# IOUSBHostObject

This class provides basic functionality for sending device requests and retrieving descriptors.

```
class IOUSBHostObject
```

## Topics

### Managing the Object Life Cycle

[`IOUSBHostObjectInitOptions`](/documentation/IOUSBHost/IOUSBHostObjectInitOptions)

Options for initializing the host object.

[`-  initWithIOService:options:queue:error:interestHandler:`](/documentation/IOUSBHost/IOUSBHostObject/initWithIOService:options:queue:error:interestHandler:)

Creates a USB host object and sets up a communication channel to the kernel.

[`-  initWithIOService:queue:error:interestHandler:`](/documentation/IOUSBHost/IOUSBHostObject/initWithIOService:queue:error:interestHandler:)

Creates a USB host object and sets up a default communication channel to the kernel.

[`IOUSBHostInterestHandler`](/documentation/IOUSBHost/IOUSBHostInterestHandler)

The callback that handles underlying service-state changes.

[`ioService`](/documentation/IOUSBHost/IOUSBHostObject/ioService)

A reference to the kernel object.

[`queue`](/documentation/IOUSBHost/IOUSBHostObject/queue)

The queue for servicing input/output requests.

[`-  destroy`](/documentation/IOUSBHost/IOUSBHostObject/destroy())

Removes underlying allocations and connections from the USB host object.

### Retrieving Base Class Descriptors

[Parsing USB Descriptors](/documentation/IOUSBHost/parsing-usb-descriptors)

Extract information from various USB descriptors using helper methods.

[`-  descriptorWithType:length:index:languageID:requestType:requestRecipient:error:`](/documentation/IOUSBHost/IOUSBHostObject/descriptorWithType:length:index:languageID:requestType:requestRecipient:error:)

Retrieves a descriptor from the cache or the device.

[`-  descriptorWithType:length:error:`](/documentation/IOUSBHost/IOUSBHostObject/descriptorWithType:length:error:)

Retrieves a descriptor with default arguments from the cache or the device.

[`-  descriptorWithType:length:index:languageID:error:`](/documentation/IOUSBHost/IOUSBHostObject/descriptorWithType:length:index:languageID:error:)

Retrieves a string descriptor from the cache or the device.

[`-  stringWithIndex:languageID:error:`](/documentation/IOUSBHost/IOUSBHostObject/stringWithIndex:languageID:error:)

Retrieves a string from a string descriptor.

[`-  stringWithIndex:error:`](/documentation/IOUSBHost/IOUSBHostObject/stringWithIndex:error:)

Retrieves an English-language string from a string descriptor.

### Creating I/O Buffers

[`-  ioDataWithCapacity:error:`](/documentation/IOUSBHost/IOUSBHostObject/ioData(withCapacity:))

Allocates a buffer for input/output requests.

### Sending Device Requests

[`IOUSBHostDeviceRequestType`](/documentation/IOUSBHost/IOUSBHostDeviceRequestType(_:_:_:))

Creates the request type field of a device request.

[`IOUSBHostDefaultControlCompletionTimeout`](/documentation/IOUSBHost/IOUSBHostDefaultControlCompletionTimeout)

The default completion timeout for input/output requests.

[`-  sendDeviceRequest:data:bytesTransferred:completionTimeout:error:`](/documentation/IOUSBHost/IOUSBHostObject/sendDeviceRequest:data:bytesTransferred:completionTimeout:error:)

Sends a request on the default control endpoint.

[`-  sendDeviceRequest:data:bytesTransferred:error:`](/documentation/IOUSBHost/IOUSBHostObject/sendDeviceRequest:data:bytesTransferred:error:)

Sends a request on the default control endpoint with a default completion timeout.

[`-  sendDeviceRequest:error:`](/documentation/IOUSBHost/IOUSBHostObject/sendDeviceRequest:error:)

Sends a request on the default control endpoint without a data phase and default completion timeout.

### Enqueueing Device Requests

[`IOUSBHostCompletionHandler`](/documentation/IOUSBHost/IOUSBHostCompletionHandler)

The completion handler for asynchronous control, bulk, and interrupt transfers.

[`-  enqueueDeviceRequest:data:completionTimeout:error:completionHandler:`](/documentation/IOUSBHost/IOUSBHostObject/enqueueDeviceRequest:data:completionTimeout:error:completionHandler:)

Enqueues a request on the default control endpoint.

[`-  enqueueDeviceRequest:data:error:completionHandler:`](/documentation/IOUSBHost/IOUSBHostObject/enqueueDeviceRequest:data:error:completionHandler:)

Enqueues a request on the default control endpoint with a default completion timeout.

[`-  enqueueDeviceRequest:error:completionHandler:`](/documentation/IOUSBHost/IOUSBHostObject/enqueueDeviceRequest:error:completionHandler:)

Enqueues a request on the default control endpoint without a data phase and a default timeout.

### Aborting Device Requests

[`IOUSBHostAbortOption`](/documentation/IOUSBHost/IOUSBHostAbortOption)

Options for aborting pending input/output requests.

[`-  abortDeviceRequestsWithOption:error:`](/documentation/IOUSBHost/IOUSBHostObject/abortDeviceRequestsWithOption:error:)

Aborts device requests.

[`-  abortDeviceRequestsWithError:`](/documentation/IOUSBHost/IOUSBHostObject/abortDeviceRequestsWithError:)

Aborts device requests synchronously.

### Getting Host Information

[`deviceAddress`](/documentation/IOUSBHost/IOUSBHostObject/deviceAddress)

The device’s bus address.

[`-  frameNumberWithTime:`](/documentation/IOUSBHost/IOUSBHostObject/frameNumberWithTime:)

Returns the current frame number of the USB controller.

### Instance Properties

[`capabilityDescriptors`](/documentation/IOUSBHost/IOUSBHostObject/capabilityDescriptors)

[`deviceDescriptor`](/documentation/IOUSBHost/IOUSBHostObject/deviceDescriptor)

### Instance Methods

[`-  configurationDescriptorWithIndex:error:`](/documentation/IOUSBHost/IOUSBHostObject/configurationDescriptor(with:))

[`-  configurationDescriptorWithConfigurationValue:error:`](/documentation/IOUSBHost/IOUSBHostObject/configurationDescriptor(withConfigurationValue:))

### Related Documentation

[`IOUSBHostDevice`](/documentation/IOUSBHost/IOUSBHostDevice)

The class that claims and configures devices, retrieves descriptors, and sends device requests.

[`IOUSBHostInterface`](/documentation/IOUSBHost/IOUSBHostInterface)

The class for accessing USB-related services.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

### Inherited By

[`IOUSBHostInterface`](/documentation/IOUSBHost/IOUSBHostInterface)

[`IOUSBHostDevice`](/documentation/IOUSBHost/IOUSBHostDevice)

---

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)