USB interface-related API.
Overview
Data structures and operations described here are related to USB interface. Each interface has number of endpoints used for performing transfer operations.
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 interface handle.
This type represents USB interface. An interface is a part of configuration and can have multiple endpoints. This handle can be obtained by usb_host_config_get_interface().
- Since :
- 3.0
Function Documentation
Claims interface.
Claims interface on a device. To perform I/O operations on interface user has to claim it. Remember to call usb_host_release_interface() when communication with the device is finished.
- Since :
- 3.0
- Parameters:
-
[in] | interface | The bInterfaceNumber of interface to claim |
[in] | force | Set to true to auto detach kernel driver, set to false to not detach it |
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
Gets current alternative setting from an interface.
- Since :
- 4.0
- Parameters:
-
[in] | interface | Interface handle |
[out] | altsetting | Index of alternative setting set for the given interface |
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
Gets an endpoint from interface.
Get a USB endpoint from interface by its index.
- Since :
- 3.0
- Parameters:
-
[in] | interface | Interface handle |
[in] | ep_index | index of endpoint to retrieve (counting from 0) |
[out] | ep | Endpoint handle |
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
Gets number of endpoints in given interface.
- Since :
- 3.0
- Parameters:
-
[in] | interface | An interface |
[out] | num_endpoints | Number of endpoints in interface |
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
Gets number of given interface.
- Since :
- 3.0
- Parameters:
-
[in] | interface | An interface |
[out] | number | Number of given interface |
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
Gets string describing an interface.
- Since :
- 3.0
- Parameters:
-
[in] | interface | An interface |
[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:
- device which interface is part of must be opened by usb_host_device_open() or usb_host_device_open_with_vid_pid()
Sets alternative setting for interface.
- Since :
- 3.0
- Parameters:
-
[in] | interface | Interface handle |
[in] | altsetting | Index of new alternative setting for given interface |
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
Releases interface.
Releases interface previously claimed by usb_host_claim_interface(). This is a blocking function.
- Since :
- 3.0
- Parameters:
-
[in] | interface | The bInterfaceNumber of interface to release |
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-