---
title: "IOUSBGetNextAssociatedDescriptorWithType(_:_:_:_:)"
framework: iousbhost
role: symbol
role_heading: Function
path: "iousbhost/iousbgetnextassociateddescriptorwithtype(_:_:_:_:)"
---

# IOUSBGetNextAssociatedDescriptorWithType(_:_:_:_:)

Obtains the next associated descriptor in a configuration descriptor and matches the type.

## Declaration

```swift
func IOUSBGetNextAssociatedDescriptorWithType(_ configurationDescriptor: UnsafePointer<IOUSBConfigurationDescriptor>!, _ parentDescriptor: UnsafePointer<IOUSBDescriptorHeader>!, _ currentDescriptor: UnsafePointer<IOUSBDescriptorHeader>!, _ type: UInt8) -> UnsafePointer<IOUSBDescriptorHeader>!
```

## Parameters

- `configurationDescriptor`: A configuration descriptor that contains the descriptors to iterate through.
- `parentDescriptor`: A descriptor pointer within the bounds of configurationDescriptor.
- `currentDescriptor`: A descriptor pointer within the bounds of configurationDescriptor, or nil.
- `type`: The descriptor type to find.

## Return Value

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

## Discussion

Discussion This method uses IOUSBGetNextAssociatedDescriptor(_:_:_:), and further validates that the returned descriptor’s bDescriptorType field matches the type that the parameter passes.

## See Also

### Configuration Descriptor Parsing

- [IOUSBGetNextDescriptor(_:_:)](iousbhost/iousbgetnextdescriptor(_:_:).md)
- [IOUSBGetNextDescriptorWithType(_:_:_:)](iousbhost/iousbgetnextdescriptorwithtype(_:_:_:).md)
- [IOUSBGetNextAssociatedDescriptor(_:_:_:)](iousbhost/iousbgetnextassociateddescriptor(_:_:_:).md)
- [IOUSBGetNextInterfaceAssociationDescriptor(_:_:)](iousbhost/iousbgetnextinterfaceassociationdescriptor(_:_:).md)
- [IOUSBGetNextInterfaceDescriptor(_:_:)](iousbhost/iousbgetnextinterfacedescriptor(_:_:).md)
- [IOUSBGetConfigurationMaxPowerMilliAmps(_:_:)](iousbhost/iousbgetconfigurationmaxpowermilliamps(_:_:).md)
