<!--
{
  "availability" : [
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreHID",
  "identifier" : "/documentation/CoreHID/HIDDeviceClient/dispatchSetReportRequest(type:id:data:timeout:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core HID"
    ],
    "preciseIdentifier" : "s:7CoreHID15HIDDeviceClientC24dispatchSetReportRequest4type2id4data7timeoutyAA13HIDReportTypeO_AA0M2IDVSg10Foundation4DataVs8DurationVSgtYaKF"
  },
  "title" : "dispatchSetReportRequest(type:id:data:timeout:)"
}
-->

# dispatchSetReportRequest(type:id:data:timeout:)

Send a set report request to the device over the transport.

```
func dispatchSetReportRequest(type: HIDReportType, id: HIDReportID? = nil, data: Data, timeout: Duration? = nil) async throws
```

## Parameters

`type`

The [`HIDReportType`](/documentation/CoreHID/HIDReportType) of the report.

`id`

The ID of the provided report, determined from the report descriptor. This is unnecessary if the descriptor has only one report.

`data`

The bytes to send as a part of the request. Determining the correct values can be aided by referencing the device’s [`descriptor`](/documentation/CoreHID/HIDDeviceClient/descriptor).

`timeout`

The maximum amount of time to wait for the device to receive the report before the calls time out and fails. Not providing a duration causes the call to wait forever.

## Discussion

Many HID devices accept set report requests to send data to the device or alter functionality. Exactly how a device interprets a set report depends on the device specific implementation, but most devices conform to the reports that they declare in their report [`descriptor`](/documentation/CoreHID/HIDDeviceClient/descriptor). This function throws if another client obtains the device.

For more details, see [Human Interface Devices (HID) Specifications and Tools](https://www.usb.org/hid).

> Throws: ``doc://com.apple.CoreHID/documentation/CoreHID/HIDDeviceError`` if there is an issue with the request.

---

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)