Tizen Native API  5.0
USB Endpoint

USB endpoint-related API.

Overview

Data structures and operations described here are related to USB endpoint. Endpoints are used to perform USB transfers.

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.

Functions

int usb_host_endpoint_get_number (usb_host_endpoint_h ep, int *number)
 Gets number of given endpoint.
int usb_host_endpoint_get_direction (usb_host_endpoint_h ep, usb_host_endpoint_direction_e *direction)
 Gets direction of an endpoint.
int usb_host_endpoint_get_transfer_type (usb_host_endpoint_h ep, usb_host_transfer_type_e *transfer_type)
 Gets transfer type of given endpoint.
int usb_host_endpoint_get_synch_type (usb_host_endpoint_h ep, usb_host_iso_sync_type_e *synch_type)
 Gets synchronization type of given endpoint.
int usb_host_endpoint_get_usage_type (usb_host_endpoint_h ep, usb_host_usage_type_e *usage_type)
 Gets usage type of given endpoint.
int usb_host_endpoint_get_max_packet_size (usb_host_endpoint_h ep, int *max_packet_size)
 Gets max packet size of given endpoint.
int usb_host_endpoint_get_interval (usb_host_endpoint_h ep, int *interval)
 Gets interval for polling endpoint for data transfers.
int usb_host_transfer_get_type (usb_host_transfer_h transfer, usb_host_transfer_type_e *transfer_type)
 Gets type of a transfer.

Typedefs

typedef struct
usb_host_endpoint_s * 
usb_host_endpoint_h
 USB endpoint handle.

Typedef Documentation

typedef struct usb_host_endpoint_s* usb_host_endpoint_h

USB endpoint handle.

This type represents USB endpoint. This handle can be obtained by usb_host_interface_get_endpoint().

Since :
3.0

Enumeration Type Documentation

Enumeration of an endpoint's direction.

Since :
3.0
Enumerator:
USB_HOST_DIRECTION_IN 

IN direction

USB_HOST_DIRECTION_OUT 

OUT direction

Enumeration of isochronous endpoint's synchronization type.

Since :
3.0
Enumerator:
USB_HOST_ISO_SYNC_TYPE_NONE 

No synchronization

USB_HOST_ISO_SYNC_TYPE_ASYNC 

Asynchronous

USB_HOST_ISO_SYNC_TYPE_ADAPTIVE 

Adaptive

USB_HOST_ISO_SYNC_TYPE_SYNC 

Synchronous

Enumeration of transfer type.

Since :
3.0
Enumerator:
USB_HOST_TRANSFER_TYPE_CONTROL 

Control transfer

USB_HOST_TRANSFER_TYPE_ISOCHRONOUS 

Isochronous transfer

USB_HOST_TRANSFER_TYPE_BULK 

Bulk transfer

USB_HOST_TRANSFER_TYPE_INTERRUPT 

Interrupt transfer

Enumeration of an endpoint's usage type.

Since :
3.0
Enumerator:
USB_HOST_USAGE_TYPE_DATA 

Data endpoint

USB_HOST_USAGE_TYPE_FEEDBACK 

Feedback endpoint

USB_HOST_USAGE_TYPE_IMPLICIT 

Implicit feedback Data endpoint


Function Documentation

Gets direction of an endpoint.

Since :
3.0
Parameters:
[in]epAn endpoint
[out]directionDirection of endpoint (a value from enum usb_host_endpoint_direction_e)
Returns:
0 on success, otherwise a negative error value
Return values:
USB_HOST_ERROR_NONESuccessful
USB_HOST_ERROR_NOT_SUPPORTEDNot supported
USB_HOST_ERROR_INVALID_PARAMETERInvalid parameter was passed
int usb_host_endpoint_get_interval ( usb_host_endpoint_h  ep,
int *  interval 
)

Gets interval for polling endpoint for data transfers.

Since :
3.0
Parameters:
[in]epAn endpoint
[out]intervalInterval for polling, in frame counts (refer to USB protocol specification)
Returns:
0 on success, otherwise a negative error value
Return values:
USB_HOST_ERROR_NONESuccessful
USB_HOST_ERROR_INVALID_PARAMETERInvalid parameter was passed
int usb_host_endpoint_get_max_packet_size ( usb_host_endpoint_h  ep,
int *  max_packet_size 
)

Gets max packet size of given endpoint.

Since :
3.0
Parameters:
[in]epAn endpoint
[out]max_packet_sizeMax packet size, in bytes
Returns:
0 on success, otherwise a negative error value
Return values:
USB_HOST_ERROR_NONESuccessful
USB_HOST_ERROR_INVALID_PARAMETERInvalid parameter was passed
int usb_host_endpoint_get_number ( usb_host_endpoint_h  ep,
int *  number 
)

Gets number of given endpoint.

Since :
3.0
Parameters:
[in]epAn endpoint
[out]numberNumber of given endpoint
Returns:
0 on success, otherwise a negative error value
Return values:
USB_HOST_ERROR_NONESuccessful
USB_HOST_ERROR_NOT_SUPPORTEDNot supported
USB_HOST_ERROR_INVALID_PARAMETERInvalid parameter was passed

Gets synchronization type of given endpoint.

Since :
3.0
Parameters:
[in]epAn endpoint
[out]synch_typeSynch type (a value from enum usb_host_iso_sync_type_e)
Returns:
0 on success, otherwise a negative error value
Return values:
USB_HOST_ERROR_NONESuccessful
USB_HOST_ERROR_NOT_SUPPORTEDNot supported
USB_HOST_ERROR_INVALID_PARAMETERInvalid parameter was passed

Gets transfer type of given endpoint.

Since :
3.0
Parameters:
[in]epAn endpoint
[out]transfer_typeTransfer type (a value from enum usb_host_transfer_type_e)
Returns:
0 on success, otherwise a negative error value
Return values:
USB_HOST_ERROR_NONESuccessful
USB_HOST_ERROR_NOT_SUPPORTEDNot supported
USB_HOST_ERROR_INVALID_PARAMETERInvalid parameter was passed

Gets usage type of given endpoint.

Since :
3.0
Parameters:
[in]epAn endpoint
[out]usage_typeUsage type (a value from enum usb_host_usage_type_e)
Returns:
0 on success, otherwise a negative error value
Return values:
USB_HOST_ERROR_NONESuccessful
USB_HOST_ERROR_NOT_SUPPORTEDNot supported
USB_HOST_ERROR_INVALID_PARAMETERInvalid parameter was passed

Gets type of a transfer.

Since :
5.0
Parameters:
[in]transferTransfer handle
[out]transfer_typeTransfer type (a value from enum usb_host_transfer_type_e)
Returns:
0 on success, otherwise a negative error value
Return values:
USB_HOST_ERROR_NONESuccessful
USB_HOST_ERROR_NOT_SUPPORTEDNot supported
USB_HOST_ERROR_INVALID_PARAMETERInvalid parameter was passed