Package org.robolectric.shadows
Class ShadowUsbDeviceConnection
java.lang.Object
org.robolectric.shadows.ShadowUsbDeviceConnection
@Implements(android.hardware.usb.UsbDeviceConnection.class) public class ShadowUsbDeviceConnection extends Object
Robolectric implementation of 
UsbDeviceConnection.- 
Constructor Summary
Constructors Constructor Description ShadowUsbDeviceConnection() - 
Method Summary
Modifier and Type Method Description protected intbulkTransfer(UsbEndpoint endpoint, byte[] buffer, int length, int timeout)protected intbulkTransfer(UsbEndpoint endpoint, byte[] buffer, int offset, int length, int timeout)protected booleanclaimInterface(UsbInterface intf, boolean force)protected intcontrolTransfer(int requestType, int request, int value, int index, byte[] buffer, int length, int timeout)protected intcontrolTransfer(int requestType, int request, int value, int index, byte[] buffer, int offset, int length, int timeout)voidreadOutgoingData(byte[] buffer)Fills the buffer with data that was written by UsbDeviceConnection#bulkTransfer.protected booleanreleaseInterface(UsbInterface intf)protected UsbRequestrequestWait()protected UsbRequestrequestWait(long timeout)voidwriteIncomingData(byte[] data)Passes data that can then be read by an initialized UsbRequest#queue(ByteBuffer). 
- 
Constructor Details
- 
ShadowUsbDeviceConnection
public ShadowUsbDeviceConnection() 
 - 
 - 
Method Details
- 
claimInterface
 - 
releaseInterface
 - 
controlTransfer
@Implementation(minSdk=19) protected int controlTransfer(int requestType, int request, int value, int index, byte[] buffer, int length, int timeout) - 
controlTransfer
@Implementation(minSdk=19) protected int controlTransfer(int requestType, int request, int value, int index, byte[] buffer, int offset, int length, int timeout) - 
requestWait
 - 
requestWait
- Throws:
 TimeoutException
 - 
bulkTransfer
@Implementation(minSdk=18) protected int bulkTransfer(UsbEndpoint endpoint, byte[] buffer, int offset, int length, int timeout) - 
bulkTransfer
@Implementation protected int bulkTransfer(UsbEndpoint endpoint, byte[] buffer, int length, int timeout) - 
readOutgoingData
Fills the buffer with data that was written by UsbDeviceConnection#bulkTransfer.- Throws:
 IOException
 - 
writeIncomingData
public void writeIncomingData(byte[] data)Passes data that can then be read by an initialized UsbRequest#queue(ByteBuffer). 
 -