public class RemoteUsbManager extends UsbCloverManager<java.lang.Void>
UsbCloverManager.InputResult, UsbCloverManager.UsbConnectException, UsbCloverManager.UsbDeviceNotFoundException
Modifier and Type | Field and Description |
---|---|
static android.util.Pair<java.lang.Integer,java.lang.Integer>[] |
VENDOR_PRODUCT_IDS |
CONNECTION_RETRY_WAIT_MS, CONNECTION_TIMEOUT_MS, mConnection, READ_TIMEOUT_MS, SETUP_RETRY_WAIT_MS, SETUP_TIMEOUT_MS, WRITE_TIMEOUT_MS
Constructor and Description |
---|
RemoteUsbManager(android.content.Context context) |
Modifier and Type | Method and Description |
---|---|
protected int |
getMaxWriteDataSize() |
protected int |
getReadSize() |
protected int |
getReadTimeOut()
Returns the amount of time to wait before read fails, 0 means wait forever.
|
protected android.util.Pair<java.lang.Integer,java.lang.Integer>[] |
getVendorProductIds() |
protected boolean |
isInterfaceMatch(android.hardware.usb.UsbInterface usbInterface) |
static boolean |
isUsbDeviceAttached(android.content.Context context) |
protected UsbCloverManager.InputResult |
processInputData(byte[] inputData,
java.io.ByteArrayOutputStream outputStream,
java.lang.Void params)
Optionally override this method to perform data processing on the input data bytes before they are returned.
|
protected byte[] |
processOutputData(byte[] outputData,
java.lang.Void aVoid)
Optionally override this method to perform data processing on the output bytes before they are sent.
|
java.lang.String |
receiveString() |
void |
sendString(java.lang.String string) |
protected byte[] |
unwrapReadPacket(java.nio.ByteBuffer inDataBuffer) |
protected byte[] |
wrapWritePacket(java.nio.ByteBuffer outDataBuffer,
int numBytesToTransfer) |
disconnect, findDevice, isBulkInterface, isConnected, isMatch, onPostDisconnect, onPreConnect, onTransferError, open, postStatusChange, read, write
public static final android.util.Pair<java.lang.Integer,java.lang.Integer>[] VENDOR_PRODUCT_IDS
protected int getReadSize()
getReadSize
in class UsbCloverManager<java.lang.Void>
protected int getMaxWriteDataSize()
getMaxWriteDataSize
in class UsbCloverManager<java.lang.Void>
public static boolean isUsbDeviceAttached(android.content.Context context)
protected android.util.Pair<java.lang.Integer,java.lang.Integer>[] getVendorProductIds()
getVendorProductIds
in class UsbCloverManager<java.lang.Void>
protected boolean isInterfaceMatch(android.hardware.usb.UsbInterface usbInterface)
isInterfaceMatch
in class UsbCloverManager<java.lang.Void>
protected int getReadTimeOut()
UsbCloverManager
getReadTimeOut
in class UsbCloverManager<java.lang.Void>
protected byte[] wrapWritePacket(java.nio.ByteBuffer outDataBuffer, int numBytesToTransfer)
wrapWritePacket
in class UsbCloverManager<java.lang.Void>
protected byte[] unwrapReadPacket(java.nio.ByteBuffer inDataBuffer)
unwrapReadPacket
in class UsbCloverManager<java.lang.Void>
protected byte[] processOutputData(byte[] outputData, java.lang.Void aVoid)
UsbCloverManager
processOutputData
in class UsbCloverManager<java.lang.Void>
protected UsbCloverManager.InputResult processInputData(byte[] inputData, java.io.ByteArrayOutputStream outputStream, java.lang.Void params)
UsbCloverManager
#processOutputData(byte[], T)
this function may be called multiple times in a single transfer depending on the
return value of this functionprocessInputData
in class UsbCloverManager<java.lang.Void>
inputData
- buffer containing bytes read from the USB deviceoutputStream
- stream containing bytes that will be returned to the callerparams
- additional parameters which may allow the implementation to modify the way the byte array is interpretedpublic void sendString(java.lang.String string) throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
public java.lang.String receiveString() throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException