public class UsbConnection extends ConnectionA
| Constructor and Description |
|---|
UsbConnection(android.hardware.usb.UsbManager manager,
android.hardware.usb.UsbDevice device)
Creates a new UsbConnection
|
| Modifier and Type | Method and Description |
|---|---|
ConnectionReestablisher |
getConnectionReestablisher(long thresholdTime)
Returns a
ConnectionReestablisher which allows for easy recreation of a connection which may have
been closed. |
String |
getDeviceName() |
android.hardware.usb.UsbManager |
getManager() |
UsbPermissionRequestor |
getRequestor() |
String |
getSimpleConnectionName()
Return the device name as the description.
|
void |
setRequestor(UsbPermissionRequestor requestor) |
String |
toString()
Returns
USB:[Device path]The USB device name is obtained from the device when this connection is opened. |
bytesAvailable, close, getMaxTimeoutForRead, getTimeToWaitForMoreData, isConnected, open, read, read, readChar, sendAndWaitForResponse, sendAndWaitForResponse, sendAndWaitForValidResponse, sendAndWaitForValidResponse, setMaxTimeoutForRead, setTimeToWaitForMoreData, waitForData, write, write, writepublic UsbConnection(android.hardware.usb.UsbManager manager,
android.hardware.usb.UsbDevice device)
manager - device - public android.hardware.usb.UsbManager getManager()
public String getDeviceName()
public String toString()
USB:[Device path]toString in interface ConnectiontoString in class ObjectConnection.toString()public String getSimpleConnectionName()
Connection.getSimpleConnectionName()public ConnectionReestablisher getConnectionReestablisher(long thresholdTime) throws ConnectionException
ConnectionConnectionReestablisher which allows for easy recreation of a connection which may have
been closed.getConnectionReestablisher in interface ConnectiongetConnectionReestablisher in class ConnectionAthresholdTime - how long the Connection reestablisher will wait before attempting to reconnection to the
printerConnectionException - if the ConnectionReestablisher could not be created.ConnectionA.getConnectionReestablisher(long thresholdTime)public UsbPermissionRequestor getRequestor()
public void setRequestor(UsbPermissionRequestor requestor)
requestor - the requestor to set
© 2015 ZIH Corp. All Rights Reserved.