USB configuration-related API.
Overview
Data structures and operations described here are related to USB configuration.
Related Features
This API is related with the following features:
It is recommended to design feature related codes in your application for reliability.
You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature List.
Typedef Documentation
USB config handle.
This type represents USB device configuration. Device can have multiple configurations, a configuration can have multiple interfaces. This handle can be obtained by usb_host_device_get_config().
- Since :
- 3.0
Function Documentation
Gets an interface from configuration.
Gets a USB interface from configuration by its index.
- Since :
- 3.0
- Parameters:
-
[in] | config | Configuration handle |
[in] | interface_index | index of interface to retrieve (counting from 0) |
[out] | interface | Interface handle |
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
Gets maximum power in given configuration, in mA.
- Since :
- 3.0
- Parameters:
-
[in] | config | A configuration |
[out] | max_power | Maximum power, in mA |
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
Gets number of interfaces for given configuration.
- Since :
- 3.0
- Parameters:
-
[in] | config | A configuration |
[out] | num_interfaces | Number of interfaces |
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
Checks if device is self-powered in given configuration.
- Since :
- 3.0
- Parameters:
-
[in] | config | A configuration |
[out] | self_powered | True if device is self-powered in given configuration, false otherwise |
- Returns:
- 0 on success, negative error code otherwise
- Return values:
-
Checks if device in given configuration supports remote wakeup.
- Since :
- 3.0
- Parameters:
-
[in] | config | A configuration |
[out] | remote_wakeup | True if device supports remote wakeup in given configuration, false otherwise |
- Returns:
- 0 on success, negative error code otherwise
- Return values:
-
Gets string describing a configuration.
- Since :
- 3.0
- Parameters:
-
[in] | config | A configuration |
[in,out] | length | Data buffer size/how much was actually used |
[out] | data | Buffer to store string |
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
- Precondition:
- config must be configuration of device opened by usb_host_device_open() or usb_host_device_open_with_vid_pid()