OpenUSB Developers Guide
Prev |  | Next

# `openusb_get_max_xfer_size`

## Name

`openusb_get_max_xfer_size` -- Get the maximum data transfer size per request based on the bus and type

## Synopsis

``int32_t openusb_get_max_xfer_size`(openusb_handle_t handle, openusb_busid_t bus, openusb_transfer_type_t type, uint32_t * bytes);`

## Parameters

`handle` - Libusb handle.

`bus` - Bus ID.

`type` - Transfer type.

`bytes` - Max allowed size.

## Description

`openusb_get_max_xfer_size()` gets the maximum transfer size that can be specified in openusb_request based on the which bus the target device is on and the desired transfer type. The size value is returned in `bytes`.

## Return Value

`openusb_get_max_xfer_size()` returns OPENUSB_SUCCESS on success. Otherwise, a openusb error is returned.

OPENUSB_SUCCESS - No errors.

OPENUSB_INVALID_HANDLE - Invalid openusb handle.

OPENUSB_UNKNOWN_DEVICE - Bus id`bus` is not valid

OPENUSB_BADARG - `type` is not valid or `bytes` is NULL.

OPENUSB_NOT_SUPPORTED - Operation is not supported.

## See Also

Prev | Home | Next
`openusb_get_lib_handle` | Up | `openusb_get_configuration, openusb_set_configuration`