Class RemoteUsbManager
java.lang.Object
com.clover.remote.client.transport.usb.UsbCloverManager<Void>
com.clover.remote.client.transport.usb.pos.RemoteUsbManager
-
Nested Class Summary
Nested classes/interfaces inherited from class com.clover.remote.client.transport.usb.UsbCloverManager
UsbCloverManager.InputResult, UsbCloverManager.UsbConnectException, UsbCloverManager.UsbDeviceNotFoundException -
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from class com.clover.remote.client.transport.usb.UsbCloverManager
CONNECTION_RETRY_WAIT_MS, CONNECTION_TIMEOUT_MS, mConnection, READ_TIMEOUT_MS, SETUP_RETRY_WAIT_MS, SETUP_TIMEOUT_MS, WRITE_TIMEOUT_MS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intprotected intprotected intReturns the amount of time to wait before read fails, 0 means wait forever.protected booleanisInterfaceMatch(android.hardware.usb.UsbInterface usbInterface) static booleanisUsbDeviceAttached(android.content.Context context) protected UsbCloverManager.InputResultprocessInputData(byte[] inputData, ByteArrayOutputStream outputStream, Void params) Optionally override this method to perform data processing on the input data bytes before they are returned.protected byte[]processOutputData(byte[] outputData, Void aVoid) Optionally override this method to perform data processing on the output bytes before they are sent.voidsendString(String string) protected byte[]unwrapReadPacket(ByteBuffer inDataBuffer) protected byte[]wrapWritePacket(ByteBuffer outDataBuffer, int numBytesToTransfer) Methods inherited from class com.clover.remote.client.transport.usb.UsbCloverManager
disconnect, findDevice, isBulkInterface, isConnected, isMatch, onPostDisconnect, onPreConnect, onTransferError, open, postStatusChange, read, write
-
Field Details
-
VENDOR_PRODUCT_IDS
-
-
Constructor Details
-
RemoteUsbManager
public RemoteUsbManager(android.content.Context context)
-
-
Method Details
-
getReadSize
protected int getReadSize()- Specified by:
getReadSizein classUsbCloverManager<Void>
-
getMaxWriteDataSize
protected int getMaxWriteDataSize()- Specified by:
getMaxWriteDataSizein classUsbCloverManager<Void>
-
isUsbDeviceAttached
public static boolean isUsbDeviceAttached(android.content.Context context) -
getVendorProductIds
- Specified by:
getVendorProductIdsin classUsbCloverManager<Void>
-
isInterfaceMatch
protected boolean isInterfaceMatch(android.hardware.usb.UsbInterface usbInterface) - Overrides:
isInterfaceMatchin classUsbCloverManager<Void>
-
getReadTimeOut
protected int getReadTimeOut()Description copied from class:UsbCloverManagerReturns the amount of time to wait before read fails, 0 means wait forever.- Overrides:
getReadTimeOutin classUsbCloverManager<Void>
-
wrapWritePacket
- Overrides:
wrapWritePacketin classUsbCloverManager<Void>
-
unwrapReadPacket
- Overrides:
unwrapReadPacketin classUsbCloverManager<Void>
-
processOutputData
Description copied from class:UsbCloverManagerOptionally override this method to perform data processing on the output bytes before they are sent. The returned byte array is used for the data transfer, the implementation may choose to modify the byte array parameter or return a new byte array.- Overrides:
processOutputDatain classUsbCloverManager<Void>
-
processInputData
protected UsbCloverManager.InputResult processInputData(byte[] inputData, ByteArrayOutputStream outputStream, Void params) Description copied from class:UsbCloverManagerOptionally override this method to perform data processing on the input data bytes before they are returned. The implementation must write the desired output bytes to the ByteArrayOutputStream. UnlikeUsbCloverManager.processOutputData(byte[], T)this function may be called multiple times in a single transfer depending on the return value of this function- Overrides:
processInputDatain classUsbCloverManager<Void>- Parameters:
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 interpreted- Returns:
- CONTINUE to request more USB device data, COMPLETE to return the received data or ERROR if something is wrong
-
sendString
- Throws:
IOExceptionInterruptedException
-
receiveString
- Throws:
IOExceptionInterruptedException
-