Contents

IOUSBGetNextCapabilityDescriptorWithType(_:_:_:)

Obtains the next descriptor matching a specific type within a BOS descriptor.

Declaration

func IOUSBGetNextCapabilityDescriptorWithType(_ bosDescriptor: UnsafePointer<IOUSBBOSDescriptor>!, _ currentDescriptor: UnsafePointer<IOUSBDeviceCapabilityDescriptorHeader>!, _ type: UInt8) -> 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.

  • type:

    The descriptor type to find.

Return Value

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

Discussion

This method uses IOUSBGetNextCapabilityDescriptor(_:_:), and further validates that the returned descriptor’s bDevCapabilityType field matches the type parameter.

See Also

BOS Descriptor Parsing