Tizen Native API
5.0
|
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:
- http://tizen.org/feature/usb.host
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.
Functions | |
int | usb_host_config_get_num_interfaces (usb_host_config_h config, int *num_interfaces) |
Gets number of interfaces for given configuration. | |
int | usb_host_config_is_self_powered (usb_host_config_h config, bool *self_powered) |
Checks if device is self-powered in given configuration. | |
int | usb_host_config_support_remote_wakeup (usb_host_config_h config, bool *remote_wakeup) |
Checks if device in given configuration supports remote wakeup. | |
int | usb_host_config_get_max_power (usb_host_config_h config, int *max_power) |
Gets maximum power in given configuration, in mA. | |
int | usb_host_device_get_config_str (usb_host_config_h config, int *length, unsigned char *data) |
Gets string describing a configuration. | |
int | usb_host_config_get_interface (usb_host_config_h config, int interface_index, usb_host_interface_h *interface) |
Gets an interface from configuration. | |
int | usb_host_config_destroy (usb_host_config_h config) |
Frees configuration. | |
Typedefs | |
typedef struct usb_host_config_s * | usb_host_config_h |
USB config handle. |
Typedef Documentation
typedef struct usb_host_config_s* usb_host_config_h |
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
int usb_host_config_destroy | ( | usb_host_config_h | config | ) |
Frees configuration.
Frees configuration obtained from usb_host_device_get_config().
- Since :
- 3.0
- Parameters:
-
[in] config Configuration to free
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
USB_HOST_ERROR_NONE Successful USB_HOST_ERROR_INVALID_PARAMETER Invalid parameter was passed
- Precondition:
- config must be obtained by usb_host_device_get_config().
int usb_host_config_get_interface | ( | usb_host_config_h | config, |
int | interface_index, | ||
usb_host_interface_h * | interface | ||
) |
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
- Remarks:
- There is no need to destroy the interface handle. It is no longer valid when config is destroyed.
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
USB_HOST_ERROR_NONE Successful USB_HOST_ERROR_NOT_FOUND Configuration does not exist USB_HOST_ERROR_NOT_SUPPORTED Not supported USB_HOST_ERROR_INVALID_PARAMETER Invalid parameter was passed
int usb_host_config_get_max_power | ( | usb_host_config_h | config, |
int * | max_power | ||
) |
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:
-
USB_HOST_ERROR_NONE Successful USB_HOST_ERROR_NOT_SUPPORTED Not supported USB_HOST_ERROR_INVALID_PARAMETER Invalid parameter was passed
int usb_host_config_get_num_interfaces | ( | usb_host_config_h | config, |
int * | num_interfaces | ||
) |
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:
-
USB_HOST_ERROR_NONE Successful USB_HOST_ERROR_NOT_SUPPORTED Not supported USB_HOST_ERROR_INVALID_PARAMETER Invalid parameter was passed
int usb_host_config_is_self_powered | ( | usb_host_config_h | config, |
bool * | self_powered | ||
) |
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:
-
USB_HOST_ERROR_NONE Successful USB_HOST_ERROR_INVALID_PARAMETER Invalid parameter was passed USB_HOST_ERROR_NOT_SUPPORTED Not supported
int usb_host_config_support_remote_wakeup | ( | usb_host_config_h | config, |
bool * | remote_wakeup | ||
) |
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:
-
USB_HOST_ERROR_NONE Successful @USB_HOST_ERROR_INVALID_PARAMETER Invalid parameter was passed USB_HOST_ERROR_NOT_SUPPORTED Not supported
int usb_host_device_get_config_str | ( | usb_host_config_h | config, |
int * | length, | ||
unsigned char * | data | ||
) |
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:
-
USB_HOST_ERROR_NONE Successful USB_HOST_ERROR_NOT_SUPPORTED Not supported USB_HOST_ERROR_OVERFLOW There was no space in buffer USB_HOST_ERROR_OUT_OF_MEMORY Out of memory USB_HOST_ERROR_INVALID_PARAMETER Invalid parameter was passed
- Precondition:
- config must be configuration of device opened by usb_host_device_open() or usb_host_device_open_with_vid_pid()