com.morpho.android.usb
Class USBDevice
java.lang.Object
com.morpho.android.usb.USBDevice
public class USBDevice
- extends java.lang.Object
Constructor Summary |
USBDevice(USBDeviceAttributes iAttributes,
android.hardware.usb.UsbManager iManager,
android.hardware.usb.UsbDevice iDevice)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mAttributes
public USBDeviceAttributes mAttributes
mManager
public static android.hardware.usb.UsbManager mManager
mConnection
public android.hardware.usb.UsbDeviceConnection mConnection
mEndpointIn
public android.hardware.usb.UsbEndpoint mEndpointIn
mEndpointOut
public android.hardware.usb.UsbEndpoint mEndpointOut
mMaxPacketOutSize
public int mMaxPacketOutSize
mMaxPacketInSize
public int mMaxPacketInSize
mInterface
public android.hardware.usb.UsbInterface mInterface
mDevice
public android.hardware.usb.UsbDevice mDevice
mFreindlyName
public java.lang.String mFreindlyName
USBDevice
public USBDevice(USBDeviceAttributes iAttributes,
android.hardware.usb.UsbManager iManager,
android.hardware.usb.UsbDevice iDevice)
hasPermission
public boolean hasPermission()
- Returns:
- true if the device was granted permission to be used false otherwise
open
public int open()
throws java.lang.Exception
- Throws:
java.lang.Exception
CreateInterface
public android.hardware.usb.UsbInterface CreateInterface(int interfaceNumber)
getProductString
public java.lang.String getProductString()
throws java.lang.Exception
- Get The Product String from a USB device.
- Returns:
- the string buffer to put the data into
- Throws:
java.lang.Exception
findEndPoint
public int findEndPoint()
getAttributes
public USBDeviceAttributes getAttributes()
- Returns:
- the attributes
close
public int close()
claimInterface
public android.hardware.usb.UsbInterface claimInterface()
write
public int write(byte[] data,
int datasize,
int timeout)
read
public int read(byte[] data,
int datasize,
int timeout)
getStringSimple
public int getStringSimple(byte[] buffer,
int index)
getSerialNumberString
public java.lang.String getSerialNumberString()
getMaxPacketInSize
public int getMaxPacketInSize()
getMaxPacketOutSize
public int getMaxPacketOutSize()