openusb_get_configuration, openusb_set_configuration

OpenUSB Developers Guide
Prev |  | Next

# `openusb_get_configuration, openusb_set_configuration`

## Name

`openusb_get_configuration, openusb_set_configuration` -- Get the current bConfigurationValue of a device, Set a device's bConfigurationValue

## Synopsis

``int32_t openusb_get_configuration`(openusb_dev_handle_t dev, uint8_t* cfg);`

``int32_topenusb_set_configuration`(openusb_dev_handle_t dev, uint8_t cfg);`

## Parameters

`dev` - Device handle.

`cfg` - Configuration value.

## Description

`openusb_get_configuration()` gets the current active configuration value of the device specified by dev. The bConfigurationValue is returned in `cfg`.

`openusb_set_configuration`() sets a device's bConfigurationValue to `cfg`.

## Return Value

`openusb_get_configuration`() or `openusb_set_configuration`() returns 0 on success. Otherwise, a openusb error is returned.

OPENUSB_SUCCESS No errors.

OPENUSB_BADARG `cfg` is an invalid address for openusb_get_configuration(), or not a valid bConfigurationValue for openusb_set_configuration()

OPENUSB_UNKNOWN_DEVICE Device handle is not valid

## See Also

Prev | Home | Next
`openusb_get_max_xfer_size` | Up | `openusb_claim_interface, openusb_release_interface, openusb_is_interface_claimed`