UniPRT SDK  v2.0.0.1
com.UniPRT.Sdk.Comm.UsbHandler Class Reference

Manages USB connections and communication. More...

Public Member Functions

 UsbHandler (Context context)
 Constructor that initializes the USB manager. More...
 
boolean setupDevice (UsbDevice device)
 Sets up the USB device and finds suitable endpoints for communication. More...
 
void close ()
 Closes the USB connection and releases the interface. More...
 
UsbDeviceConnection getUsbConnection ()
 Gets the current USB device connection. More...
 
UsbEndpoint getUsbEndpointIn ()
 Gets the IN endpoint for USB communication. More...
 
UsbEndpoint getUsbEndpointOut ()
 Gets the OUT endpoint for USB communication. More...
 

Private Attributes

UsbManager usbManager
 
UsbDevice usbDevice
 
UsbInterface usbInterface
 
UsbDeviceConnection usbConnection
 
UsbEndpoint usbEndpointIn
 
UsbEndpoint usbEndpointOut
 

Detailed Description

Manages USB connections and communication.

Constructor & Destructor Documentation

◆ UsbHandler()

com.UniPRT.Sdk.Comm.UsbHandler.UsbHandler ( Context  context)

Constructor that initializes the USB manager.

Parameters
contextThe application context.

References com.UniPRT.Sdk.Comm.UsbHandler.usbManager.

Member Function Documentation

◆ close()

void com.UniPRT.Sdk.Comm.UsbHandler.close ( )

Closes the USB connection and releases the interface.

References com.UniPRT.Sdk.Comm.UsbHandler.usbConnection, and com.UniPRT.Sdk.Comm.UsbHandler.usbInterface.

◆ getUsbConnection()

UsbDeviceConnection com.UniPRT.Sdk.Comm.UsbHandler.getUsbConnection ( )

Gets the current USB device connection.

Returns
The current USB device connection.

References com.UniPRT.Sdk.Comm.UsbHandler.usbConnection.

◆ getUsbEndpointIn()

UsbEndpoint com.UniPRT.Sdk.Comm.UsbHandler.getUsbEndpointIn ( )

Gets the IN endpoint for USB communication.

Returns
The IN endpoint.

References com.UniPRT.Sdk.Comm.UsbHandler.usbEndpointIn.

◆ getUsbEndpointOut()

UsbEndpoint com.UniPRT.Sdk.Comm.UsbHandler.getUsbEndpointOut ( )

Gets the OUT endpoint for USB communication.

Returns
The OUT endpoint.

References com.UniPRT.Sdk.Comm.UsbHandler.usbEndpointOut.

◆ setupDevice()

boolean com.UniPRT.Sdk.Comm.UsbHandler.setupDevice ( UsbDevice  device)

Sets up the USB device and finds suitable endpoints for communication.

Parameters
deviceThe USB device to be set up.
Returns
true if the device and endpoints are successfully set up, false otherwise.

References com.UniPRT.Sdk.Comm.UsbHandler.usbConnection, com.UniPRT.Sdk.Comm.UsbHandler.usbDevice, com.UniPRT.Sdk.Comm.UsbHandler.usbEndpointIn, com.UniPRT.Sdk.Comm.UsbHandler.usbEndpointOut, com.UniPRT.Sdk.Comm.UsbHandler.usbInterface, and com.UniPRT.Sdk.Comm.UsbHandler.usbManager.

Member Data Documentation

◆ usbConnection

UsbDeviceConnection com.UniPRT.Sdk.Comm.UsbHandler.usbConnection
private

◆ usbDevice

UsbDevice com.UniPRT.Sdk.Comm.UsbHandler.usbDevice
private

◆ usbEndpointIn

UsbEndpoint com.UniPRT.Sdk.Comm.UsbHandler.usbEndpointIn
private

◆ usbEndpointOut

UsbEndpoint com.UniPRT.Sdk.Comm.UsbHandler.usbEndpointOut
private

◆ usbInterface

UsbInterface com.UniPRT.Sdk.Comm.UsbHandler.usbInterface
private

◆ usbManager

UsbManager com.UniPRT.Sdk.Comm.UsbHandler.usbManager
private

The documentation for this class was generated from the following file: