openusb_set_default_timeout

OpenUSB Developers Guide
Prev |  | Next

# `openusb_set_default_timeout`

## Name

`openusb_set_default_timeout` -- Set default timeout for USB transfer

## Synopsis

``int32_t openusb_set_default_timeout`(openusb_handle_t handle , openusb_transfer_type_t type , uint32_t timeout );`

## Parameters

`handle` - An openusb instance handle, obtained in `openusb_init`.

`type` - Transfer type.

`timeout` - Timeout value, in millisecond unit.

## Description

Application can call `openusb_set_default_timeout()` to set default timeout for individual transfer type. `timeout` = 0 represents infinite timeout value. OpenUSB supported transfer types are:

              typedef enum openusb_transfer_type {
                USB_TYPE_ALL = 0,
                USB_TYPE_CONTROL,
                USB_TYPE_INTERRUPT,
                USB_TYPE_BULK,
                USB_TYPE_ISOCHRONOUS,
              } openusb_transfer_type_t;

## Return Value

OPENUSB_SUCCESS - New timeout was successfully set.

OPENUSB_INVALID_HANDLE - Invalid openusb handle.

OPENUSB_BADARG - Invalid argument. Type is not a valid transfer type.

## See Also

`openusb_init, openusb_fini`

Prev | Home | Next
`openusb_set_event_callback, openusb_coldplug_callbacks_done` | Up | Bus and Device Operations