Tizen Native API  9.0
USB Endpoint

This API is used to handle tasks related to USB endpoints.

This API is used to handle tasks related to USB endpoints

Overview

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

Overview

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_endpoint_get_number (usb_host_endpoint_h ep, int *number)
 Gets the "number" of the given USB endpoint handle.
int usb_host_endpoint_get_direction (usb_host_endpoint_h ep, usb_host_endpoint_direction_e *direction)
 Gets the direction of the given USB endpoint handle.
int usb_host_endpoint_get_transfer_type (usb_host_endpoint_h ep, usb_host_transfer_type_e *transfer_type)
 Gets transfer type of the given USB endpoint handle.
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 USB endpoint handle.
int usb_host_endpoint_get_usage_type (usb_host_endpoint_h ep, usb_host_usage_type_e *usage_type)
 Gets the usage type of the given USB endpoint handle.
int usb_host_endpoint_get_max_packet_size (usb_host_endpoint_h ep, int *max_packet_size)
 Gets max packet size from given USB endpoint handle.
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 from a given transfer handle.

Typedefs

typedef struct
usb_host_endpoint_s * 
usb_host_endpoint_h
 An opaque handle representing a USB interface endpoint.

Typedef Documentation

typedef struct usb_host_endpoint_s* usb_host_endpoint_h

An opaque handle representing a USB interface endpoint.

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

Since :
3.0

Enumeration Type Documentation

An enumeration representing USB endpoint direction.

Used to control whether an endpoint writes or reads data.

Since :
3.0
Enumerator:
USB_HOST_DIRECTION_IN 

IN direction

USB_HOST_DIRECTION_OUT 

OUT direction

Enumeration of isochronous endpoint's synchronization type.

Used to control how a data transfer request is going to be synchronized.

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

An enumeration representing USB endpoint transfer type.

Used to control how a data transfer request is going to operate.

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

An enumeration representing USB endpoint usage type.

Used to control what sort of tasks an endpoint is up to.

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 the direction of the given USB endpoint handle.

Gets the direction of the given USB endpoint handle.

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.

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 from given USB endpoint handle.

Gets max packet size from given USB endpoint handle.

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 the "number" of the given USB endpoint handle.

Gets the "number" of the given USB endpoint handle.

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 USB endpoint handle.

Gets synchronization type of given USB endpoint handle.

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 the given USB endpoint handle.

Gets transfer type of the given USB endpoint handle.

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 the usage type of the given USB endpoint handle.

Gets the usage type of the given USB endpoint handle.

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 from a given transfer handle.

Gets type of a transfer from a given transfer handle.

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