|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.usb.util.UsbUtil.SynchronizedUsbDevice
public static class UsbUtil.SynchronizedUsbDevice
A synchronized UsbDevice wrapper implementation.
Field Summary | |
---|---|
UsbDevice |
usbDevice
|
Constructor Summary | |
---|---|
UsbUtil.SynchronizedUsbDevice(UsbDevice usbDevice)
|
Method Summary | |
---|---|
void |
addUsbDeviceListener(UsbDeviceListener listener)
Add a UsbDeviceListener to this UsbDevice. |
void |
asyncSubmit(java.util.List list)
Submit a List of UsbControlIrps asynchronously to the Default Control Pipe. |
void |
asyncSubmit(UsbControlIrp irp)
Submit a UsbControlIrp asynchronously to the Default Control Pipe. |
boolean |
containsUsbConfiguration(byte number)
If this UsbDevice contains the specified UsbConfiguration. |
UsbControlIrp |
createUsbControlIrp(byte bmRequestType,
byte bRequest,
short wValue,
short wIndex)
Create a UsbControlIrp. |
UsbConfiguration |
getActiveUsbConfiguration()
Get the active UsbConfiguration. |
byte |
getActiveUsbConfigurationNumber()
Get the number of the active UsbConfiguration. |
java.lang.String |
getManufacturerString()
Get the manufacturer String. |
UsbPort |
getParentUsbPort()
Get the UsbPort on the parent UsbHub that this device is connected to. |
java.lang.String |
getProductString()
Get the product String. |
java.lang.String |
getSerialNumberString()
Get the serial number String. |
java.lang.Object |
getSpeed()
Get the speed of the device. |
java.lang.String |
getString(byte index)
Get the String from the specified string descriptor. |
UsbConfiguration |
getUsbConfiguration(byte number)
Get the specified UsbConfiguration. |
java.util.List |
getUsbConfigurations()
Get all UsbConfigurations for this device. |
UsbDeviceDescriptor |
getUsbDeviceDescriptor()
Get the device descriptor. |
UsbStringDescriptor |
getUsbStringDescriptor(byte index)
Get the specified string descriptor. |
boolean |
isConfigured()
If this UsbDevice is configured. |
boolean |
isUsbHub()
If this is a UsbHub. |
void |
removeUsbDeviceListener(UsbDeviceListener listener)
Remove a UsbDeviceListener from this UsbDevice. |
void |
syncSubmit(java.util.List list)
Submit a List of UsbControlIrps synchronously to the Default Control Pipe. |
void |
syncSubmit(UsbControlIrp irp)
Submit a UsbControlIrp synchronously to the Default Control Pipe. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public UsbDevice usbDevice
Constructor Detail |
---|
public UsbUtil.SynchronizedUsbDevice(UsbDevice usbDevice)
Method Detail |
---|
public UsbPort getParentUsbPort()
UsbDevice
getParentUsbPort
in interface UsbDevice
public boolean isUsbHub()
UsbDevice
isUsbHub
in interface UsbDevice
public java.lang.String getManufacturerString() throws UsbException, java.io.UnsupportedEncodingException
UsbDevice
This is a convienence method, which uses
getString
.
getManufacturerString
in interface UsbDevice
UsbException
- If there was an error getting the UsbStringDescriptor.
java.io.UnsupportedEncodingException
- If the string encoding is not supported.public java.lang.String getSerialNumberString() throws UsbException, java.io.UnsupportedEncodingException
UsbDevice
This is a convienence method, which uses
getString
.
getSerialNumberString
in interface UsbDevice
UsbException
- If there was an error getting the UsbStringDescriptor.
java.io.UnsupportedEncodingException
- If the string encoding is not supported.public java.lang.String getProductString() throws UsbException, java.io.UnsupportedEncodingException
UsbDevice
This is a convienence method, which uses
getString
.
getProductString
in interface UsbDevice
UsbException
- If there was an error getting the UsbStringDescriptor.
java.io.UnsupportedEncodingException
- If the string encoding is not supported.public java.lang.Object getSpeed()
UsbDevice
The speed will be one of:
getSpeed
in interface UsbDevice
public java.util.List getUsbConfigurations()
UsbDevice
The List is unmodifiable.
getUsbConfigurations
in interface UsbDevice
public UsbConfiguration getUsbConfiguration(byte number)
UsbDevice
If the specified UsbConfiguration does not exist, null is returned. Config number 0 is reserved for the Not Configured state (see the USB 1.1 specification section 9.4.2). Obviously, no UsbConfiguration exists for the Not Configured state.
getUsbConfiguration
in interface UsbDevice
public boolean containsUsbConfiguration(byte number)
UsbDevice
This will return false for zero (the Not Configured state).
containsUsbConfiguration
in interface UsbDevice
public byte getActiveUsbConfigurationNumber()
UsbDevice
If the device is in a Not Configured state, this will return zero.
getActiveUsbConfigurationNumber
in interface UsbDevice
public UsbConfiguration getActiveUsbConfiguration()
UsbDevice
If this device is Not Configured, this returns null.
getActiveUsbConfiguration
in interface UsbDevice
public boolean isConfigured()
UsbDevice
This returns true if the device is in the configured state as shown in the USB 1.1 specification table 9.1.
isConfigured
in interface UsbDevice
public UsbDeviceDescriptor getUsbDeviceDescriptor()
UsbDevice
The descriptor may be cached.
getUsbDeviceDescriptor
in interface UsbDevice
public UsbStringDescriptor getUsbStringDescriptor(byte index) throws UsbException
UsbDevice
This is a convienence method. The UsbStringDescriptor may be cached. If the device does not support strings or does not define the specified string descriptor, this returns null.
getUsbStringDescriptor
in interface UsbDevice
index
- The index of the string descriptor to get.
UsbException
- If an error occurred while getting the string descriptor.public java.lang.String getString(byte index) throws UsbException, java.io.UnsupportedEncodingException
UsbDevice
This is a convienence method, which uses
getUsbStringDescriptor()
.
getString()
.
getString
in interface UsbDevice
index
- The index of the string to get.
UsbException
- If an error occurred while getting the String.
java.io.UnsupportedEncodingException
- If the string encoding is not supported.public void syncSubmit(UsbControlIrp irp) throws UsbException
UsbDevice
syncSubmit
in interface UsbDevice
irp
- The UsbControlIrp.
UsbException
- If an error occurrs.public void asyncSubmit(UsbControlIrp irp) throws UsbException
UsbDevice
asyncSubmit
in interface UsbDevice
irp
- The UsbControlIrp.
UsbException
- If an error occurrs.public void syncSubmit(java.util.List list) throws UsbException
UsbDevice
All UsbControlIrps are guaranteed to be atomically (with respect to other clients of this API) submitted to the Default Control Pipe. Atomicity on a native level is implementation-dependent.
syncSubmit
in interface UsbDevice
list
- The List of UsbControlIrps.
UsbException
- If an error occurrs.public void asyncSubmit(java.util.List list) throws UsbException
UsbDevice
All UsbControlIrps are guaranteed to be atomically (with respect to other clients of this API) submitted to the Default Control Pipe. Atomicity on a native level is implementation-dependent.
asyncSubmit
in interface UsbDevice
list
- The List of UsbControlIrps.
UsbException
- If an error occurrs.public UsbControlIrp createUsbControlIrp(byte bmRequestType, byte bRequest, short wValue, short wIndex)
UsbDevice
This creates a UsbControlIrp that may be optimized for use on
this UsbDevice. Using this UsbIrp instead of a
DefaultUsbControlIrp
may increase performance or decrease memory requirements.
The UsbDevice cannot require this UsbControlIrp to be used, all submit methods must accept any UsbControlIrp implementation.
createUsbControlIrp
in interface UsbDevice
bmRequestType
- The bmRequestType.bRequest
- The bRequest.wValue
- The wValue.wIndex
- The wIndex.
public void addUsbDeviceListener(UsbDeviceListener listener)
UsbDevice
addUsbDeviceListener
in interface UsbDevice
listener
- The UsbDeviceListener to add.public void removeUsbDeviceListener(UsbDeviceListener listener)
UsbDevice
removeUsbDeviceListener
in interface UsbDevice
listener
- The listener to remove.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |