Tizen Native API
5.0
|
This module provides an API for raw access to USB devices.
#include <usb_host.h>
USB host API provides direct access to USB devices. Before using it, become familiar with USB protocol specification. Note, that this API is created for *host* mode USB, i.e. communication with connected devices.
Before using any of usb_host API functions you must initialize API context. Also you must cleanup context after using USB host API.
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.
Functions | |
int | usb_host_create (usb_host_context_h *ctx) |
Initializes usb_host context. | |
int | usb_host_destroy (usb_host_context_h ctx) |
Deinitializes usb_host context. | |
Typedefs | |
typedef struct usb_host_context_s * | usb_host_context_h |
Context handle to USB host. |
typedef struct usb_host_context_s* usb_host_context_h |
Context handle to USB host.
This structure represents usb_host session. Using own session allows to use this API independently. For example calling usb_host_destroy() will not destroy resources that are being used by another user of the library.
To create session there is need to call usb_host_create(), to destroy call usb_host_destroy(). Each session created by usb_host_create() has to be destroyed using usb_host_destroy()
enum usb_host_error_e |
Enumeration of error codes reported by USB host API.
int usb_host_create | ( | usb_host_context_h * | ctx | ) |
Initializes usb_host context.
This function must be called before any other function from this module.
[out] | ctx | Context pointer |
USB_HOST_ERROR_OUT_OF_MEMORY | Out of memory |
USB_HOST_ERROR_INVALID_PARAMETER | Invalid parameter was passed |
USB_HOST_ERROR_NONE | Successful |
int usb_host_destroy | ( | usb_host_context_h | ctx | ) |
Deinitializes usb_host context.
This function must be called after closing all devices and before application close. It has to be called to clean the memory used by library.
[in] | ctx | Context to deinitialize |
USB_HOST_ERROR_NONE | Success |
USB_HOST_ERROR_INVALID_PARAMETER | Invalid parameter was passed |