OpenUSB Developers Guide
Prev |  | Next

# `openusb_claim_interface, openusb_release_interface, openusb_is_interface_claimed`

## Name

`openusb_claim_interface, openusb_release_interface, openusb_is_interface_claimed` -- Claim interface exclusively, Release an interface, Check if an interface has been claimed

## Synopsis

``int32_t openusb_claim_interface`(openusb_dev_handle_t dev, uint8_t ifc, openusb_init_flag_t flags);`

``int32_topenusb_release_interface`(openusb_dev_handle_t dev, uint8_t ifc);`

``int32_topenusb_is_interface_claimed`(openusb_dev_handle_t dev, uint8_t ifc);`

## Parameters

`dev` - Device handle.

`ifc` - Interface number.

`flags` - Claiming flags.

## Description

`openusb_claim_interface()` claims an interface of device `dev`. See `openusb_open_device` for the meaning of `flags`. Application must call `openusb_claim_interface`() before it further operates on an interface.

`openusb_release_interface`() releases a claimed interface `ifc`.

`openusb_is_interface_claimed` returns if the interface `ifc` has been claimed.

## Return Value

`openusb_claim_interface`() or `openusb_release_interface`() returns 0 on success. `openusb_is_interface_claimed` returns 0 if not claimed and 1 if already claimed. Otherwise, a openusb error is returned.

OPENUSB_SUCCESS No errors.

OPENUSB_BADARG `ifc` is not valid.

OPENUSB_UNKNOWN_DEVICE Device handle is not valid

OPENUSB_BUSY The interface `ifc` has already been claimed.

## See Also

`openusb_open_device,openusb_close_device`

Prev | Home | Next
`openusb_get_configuration, openusb_set_configuration` | Up | `openusb_get_altsetting,openusb_set_altsetting`