<!--
{
  "availability" : [
    "DriverKit: 19.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "USBDriverKit",
  "identifier" : "/documentation/USBDriverKit/IOUSBHostDevice/SetConfiguration",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "USBDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOUSBHostDevice@F@SetConfiguration#c#b#"
  },
  "title" : "SetConfiguration"
}
-->

# SetConfiguration

Selects a new configuration for the device.

```
virtual kern_return_t SetConfiguration(uint8_t bConfigurationValue, bool matchInterfaces);
```

## Parameters

`bConfigurationValue`

The configuration to select. You can get this value from the [`bConfigurationValue`](/documentation/USBDriverKit/IOUSBConfigurationDescriptor/bConfigurationValue) field of the [`IOUSBConfigurationDescriptor`](/documentation/USBDriverKit/IOUSBConfigurationDescriptor) structure.

`matchInterfaces`

A Boolean value indicating whether you want the system to perform matching on the interfaces of the new configuration. Specify <doc://com.apple.documentation/documentation/Swift/false> to skip the matching process.

## Return Value

<doc://com.apple.documentation/documentation/DriverKit/kIOReturnSuccess> on success, or another value if an error occurs. See <doc://com.apple.documentation/documentation/DriverKit/error-codes>.

## Discussion

This method terminates all previously configured child interfaces and sets the new configuration for the device. This method sends a `SET_CONFIGURATION` control request (USB 2.0, section 9.4.7) to the device. When making the `GET_DESCRIPTOR` control request, this method acquires the service’s workloop lock and may call <doc://com.apple.documentation/documentation/kernel/iocommandgate/1573818-commandsleep>.

---

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)