public static final class USBMonitor.UsbControlBlock
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
protected android.hardware.usb.UsbDeviceConnection |
mConnection |
protected USBMonitor.UsbDeviceInfo |
mInfo |
Modifier and Type | Method and Description |
---|---|
void |
claimInterface(android.hardware.usb.UsbInterface intf)
open specific interface
|
void |
claimInterface(android.hardware.usb.UsbInterface intf,
boolean force) |
USBMonitor.UsbControlBlock |
clone()
duplicate by clone
need permission
USBMonitor never handle cloned UsbControlBlock, you should release it after using it.
|
void |
close()
Close device
This also close interfaces if they are opened in Java side
|
boolean |
equals(java.lang.Object o) |
int |
getBusNum() |
android.hardware.usb.UsbDeviceConnection |
getConnection()
get UsbDeviceConnection
|
android.hardware.usb.UsbDevice |
getDevice() |
int |
getDeviceId()
get device id
|
int |
getDeviceKey()
get device key
|
int |
getDeviceKey(boolean useNewAPI)
get device key
|
java.lang.String |
getDeviceKeyName()
get device key string
|
java.lang.String |
getDeviceKeyName(boolean useNewAPI)
get device key string
|
java.lang.String |
getDeviceKeyNameWithSerial()
get device key string
if device has serial number, use it
|
int |
getDeviceKeyWithSerial()
get device key
if device has serial number, use it
|
java.lang.String |
getDeviceName()
get device name
|
int |
getDevNum() |
int |
getFileDescriptor()
get file descriptor to access USB device
|
android.hardware.usb.UsbInterface |
getInterface(int interface_id)
get interface
|
android.hardware.usb.UsbInterface |
getInterface(int interface_id,
int altsetting)
get interface
|
java.lang.String |
getManufacture()
get manufacture
|
int |
getProductId()
get product id
|
java.lang.String |
getProductName()
get product name
|
byte[] |
getRawDescriptors()
get raw descriptor for the USB device
|
java.lang.String |
getSerial()
get serial number
|
USBMonitor |
getUSBMonitor() |
java.lang.String |
getUsbVersion()
get version string of USB
|
int |
getVenderId()
get vendor id
|
java.lang.String |
getVersion()
get version
|
void |
releaseInterface(android.hardware.usb.UsbInterface intf)
close interface
|
protected android.hardware.usb.UsbDeviceConnection mConnection
protected final USBMonitor.UsbDeviceInfo mInfo
public USBMonitor.UsbControlBlock clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public USBMonitor getUSBMonitor()
public final android.hardware.usb.UsbDevice getDevice()
public java.lang.String getDeviceName()
public int getDeviceId()
public java.lang.String getDeviceKeyName()
public java.lang.String getDeviceKeyName(boolean useNewAPI) throws java.lang.IllegalStateException
useNewAPI
- if true, try to use serial numberjava.lang.IllegalStateException
public int getDeviceKey() throws java.lang.IllegalStateException
java.lang.IllegalStateException
public int getDeviceKey(boolean useNewAPI) throws java.lang.IllegalStateException
useNewAPI
- if true, try to use serial numberjava.lang.IllegalStateException
public java.lang.String getDeviceKeyNameWithSerial()
public int getDeviceKeyWithSerial()
public android.hardware.usb.UsbDeviceConnection getConnection()
public int getFileDescriptor() throws java.lang.IllegalStateException
java.lang.IllegalStateException
public byte[] getRawDescriptors() throws java.lang.IllegalStateException
java.lang.IllegalStateException
public int getVenderId()
public int getProductId()
public java.lang.String getUsbVersion()
public java.lang.String getManufacture()
public java.lang.String getProductName()
public java.lang.String getVersion()
public java.lang.String getSerial()
public int getBusNum()
public int getDevNum()
public android.hardware.usb.UsbInterface getInterface(int interface_id) throws java.lang.IllegalStateException
interface_id
- java.lang.IllegalStateException
public android.hardware.usb.UsbInterface getInterface(int interface_id, int altsetting) throws java.lang.IllegalStateException
interface_id
- altsetting
- java.lang.IllegalStateException
public void claimInterface(android.hardware.usb.UsbInterface intf)
intf
- public void claimInterface(android.hardware.usb.UsbInterface intf, boolean force)
public void releaseInterface(android.hardware.usb.UsbInterface intf) throws java.lang.IllegalStateException
intf
- java.lang.IllegalStateException
public void close()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object