---
title: "IOUSBGetEndpointMaxPacketSize(_:_:)"
framework: iousbhost
role: symbol
role_heading: Function
path: "iousbhost/iousbgetendpointmaxpacketsize(_:_:)"
---

# IOUSBGetEndpointMaxPacketSize(_:_:)

Obtains the maximum packet size from an endpoint descriptor.

## Declaration

```swift
func IOUSBGetEndpointMaxPacketSize(_ usbDeviceSpeed: UInt32, _ descriptor: UnsafePointer<IOUSBEndpointDescriptor>!) -> UInt16
```

## Parameters

- `usbDeviceSpeed`: The operational speed of the device.
- `descriptor`: The endpoint descriptor to parse.

## Return Value

Return Value The maximum packet size in bytes.

## Discussion

Discussion This method parses an endpoint descriptor to determine its maximum packet size, which doesn’t include mult or burst factors.

## See Also

### Endpoint Descriptor Parsing

- [IOUSBGetNextEndpointDescriptor(_:_:_:)](iousbhost/iousbgetnextendpointdescriptor(_:_:_:).md)
- [IOUSBGetEndpointDirection(_:)](iousbhost/iousbgetendpointdirection(_:).md)
- [IOUSBGetEndpointAddress(_:)](iousbhost/iousbgetendpointaddress(_:).md)
- [IOUSBGetEndpointNumber(_:)](iousbhost/iousbgetendpointnumber(_:).md)
- [IOUSBGetEndpointType(_:)](iousbhost/iousbgetendpointtype(_:).md)
- [IOUSBGetEndpointIntervalEncodedMicroframes(_:_:)](iousbhost/iousbgetendpointintervalencodedmicroframes(_:_:).md)
- [IOUSBGetEndpointIntervalMicroframes(_:_:)](iousbhost/iousbgetendpointintervalmicroframes(_:_:).md)
- [IOUSBGetEndpointIntervalFrames(_:_:)](iousbhost/iousbgetendpointintervalframes(_:_:).md)
- [IOUSBGetEndpointMaxStreamsEncoded(_:_:_:)](iousbhost/iousbgetendpointmaxstreamsencoded(_:_:_:).md)
- [IOUSBGetEndpointMaxStreams(_:_:_:)](iousbhost/iousbgetendpointmaxstreams(_:_:_:).md)
