com.morpho.android.usb
Class USBDevice

java.lang.Object
  extended by com.morpho.android.usb.USBDevice

public class USBDevice
extends java.lang.Object


Field Summary
 USBDeviceAttributes mAttributes
           
 android.hardware.usb.UsbDeviceConnection mConnection
           
 android.hardware.usb.UsbDevice mDevice
           
 android.hardware.usb.UsbEndpoint mEndpointIn
           
 android.hardware.usb.UsbEndpoint mEndpointOut
           
 java.lang.String mFreindlyName
           
 android.hardware.usb.UsbInterface mInterface
           
static android.hardware.usb.UsbManager mManager
           
 int mMaxPacketInSize
           
 int mMaxPacketOutSize
           
 
Constructor Summary
USBDevice(USBDeviceAttributes iAttributes, android.hardware.usb.UsbManager iManager, android.hardware.usb.UsbDevice iDevice)
           
 
Method Summary
 android.hardware.usb.UsbInterface claimInterface()
           
 int close()
           
 android.hardware.usb.UsbInterface CreateInterface(int interfaceNumber)
           
 int findEndPoint()
           
 USBDeviceAttributes getAttributes()
           
 int getMaxPacketInSize()
           
 int getMaxPacketOutSize()
           
 java.lang.String getProductString()
          Get The Product String from a USB device.
 java.lang.String getSerialNumberString()
           
 int getStringSimple(byte[] buffer, int index)
           
 boolean hasPermission()
           
 int open()
           
 int read(byte[] data, int datasize, int timeout)
           
 int write(byte[] data, int datasize, int timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

USBDevice

public USBDevice(USBDeviceAttributes iAttributes,
                 android.hardware.usb.UsbManager iManager,
                 android.hardware.usb.UsbDevice iDevice)
Method Detail

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()