---
title: DeviceRequest
framework: usbdriverkit
role: symbol
role_heading: Instance Method
path: usbdriverkit/iousbhostinterface/devicerequest
---

# DeviceRequest

Sends a synchronous request to the device on the default control endpoint.

## Declaration

```occ
virtual kern_return_t DeviceRequest(uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint16_t wLength, IOMemoryDescriptor *dataBuffer, uint16_t *bytesTransferred, uint32_t completionTimeoutMs);
```

## Parameters

- `bmRequestType`: The characteristics of the device request. See the doc://com.apple.documentation/documentation/iokit/usbmakebmrequesttype macro for information about how to construct this request.
- `bRequest`: The request you want to make.
- `wValue`: Request-specific data.
- `wIndex`: Request-specific data.
- `wLength`: The number of bytes to transfer, if there’s a data stage.
- `dataBuffer`: The memory descriptor to use for the request’s data phase, if any.
- `bytesTransferred`: A pointer to a variable. On return, this variable contains the number of bytes that the method actually transferred during the data phase.
- `completionTimeoutMs`: The timeout duration in milliseconds. If you specify 0, the request never times out.

## Return Value

Return Value kIOReturnSuccess if the request completed successfully, or another value if an error occurs. See Error Codes.

## Discussion

Discussion This method acquires the service’s workloop lock and performs a USB device request (USB 2.0, section 9.3). The method waits for the request to complete, and may call commandSleep during that time.

## See Also

### Requesting Data from the Default Control Endpoint

- [AsyncDeviceRequest](usbdriverkit/iousbhostinterface/asyncdevicerequest.md)
- [AbortDeviceRequests](usbdriverkit/iousbhostinterface/abortdevicerequests.md)
