---
title: "IOUSBGetNextCapabilityDescriptor(_:_:)"
framework: iousbhost
role: symbol
role_heading: Function
path: "iousbhost/iousbgetnextcapabilitydescriptor(_:_:)"
---

# IOUSBGetNextCapabilityDescriptor(_:_:)

Obtains the next device capability descriptor in a BOS descriptor.

## Declaration

```swift
func IOUSBGetNextCapabilityDescriptor(_ bosDescriptor: UnsafePointer<IOUSBBOSDescriptor>!, _ currentDescriptor: UnsafePointer<IOUSBDeviceCapabilityDescriptorHeader>!) -> UnsafePointer<IOUSBDeviceCapabilityDescriptorHeader>!
```

## Parameters

- `bosDescriptor`: A BOS descriptor that contains the descriptors to iterate through.
- `currentDescriptor`: A descriptor pointer within the bounds of configurationDescriptor, or nil.

## Return Value

Return Value A device capability descriptor pointer, or nil if no descriptor returns.

## Discussion

Discussion This method advances the current descriptor by its length, and validates that the new descriptor fits within the bounds of bosDescriptor. Use nil for currentDescriptor to return the first descriptor after the BOS descriptor.

## See Also

### BOS Descriptor Parsing

- [IOUSBGetUSB20ExtensionDeviceCapabilityDescriptor(_:)](iousbhost/iousbgetusb20extensiondevicecapabilitydescriptor(_:).md)
- [IOUSBGetNextCapabilityDescriptorWithType(_:_:_:)](iousbhost/iousbgetnextcapabilitydescriptorwithtype(_:_:_:).md)
- [IOUSBGetSuperSpeedDeviceCapabilityDescriptor(_:)](iousbhost/iousbgetsuperspeeddevicecapabilitydescriptor(_:).md)
- [IOUSBGetContainerIDDescriptor(_:)](iousbhost/iousbgetcontaineriddescriptor(_:).md)
- [IOUSBGetBillboardDescriptor(_:)](iousbhost/iousbgetbillboarddescriptor(_:).md)
