|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--usb.core.Device | +--usb.windows.DeviceImpl
Provides access to all USB devices on a bus in limited fashion.
The device descriptor and configuration descriptor provides more information
to the devices which are attached to the bus.
The devices itself are instances of the subclass NonJUSB when not using the
jUSB driver and of the subclass JUSB when using the jUSB driver.
Field Summary | |
Configuration |
configuration
The configuration descriptor |
DeviceDescriptor |
descriptor
The device descriptor |
static int |
EXTERNAL_HUB
Corresponds to a hub port and indicates that an external hub is connected to that port. |
static int |
NO_DEVICE_CONNECTED
Corresponds to a hub port and indicates that no device is connected to that port. |
static int |
USB_DEVICE
Corresponds to a hub port and indicates that a device is connected to that port. |
Fields inherited from class usb.core.Device |
DEVICE_REMOTE_WAKEUP, DEVICE_SELFPOWERED |
Method Summary | |
int |
closeHandle(int devHandle)
Native function that invokes the CloseFile WinAPI function with the given handle |
Device |
getChild(int port)
Returns the device connected to this hub's specific port(origin one), or null |
Configuration |
getConfiguration()
Returns the default configuration from the device. |
Configuration |
getConfiguration(int index)
Not implemented for all devices. |
byte[] |
getConfigurationDescriptor(int hubHandle,
int portIndex)
Returns the byte stream for the DeviceDescriptor |
DeviceDescriptor |
getDeviceDescriptor()
Returns the device dscriptor of the device |
byte[] |
getDeviceDescriptor(int hubHandle,
int portIndex)
Returns the byte stream for the DeviceDescriptor |
java.lang.String |
getDeviceFriendlyName()
Returns the friendly device name |
java.lang.String |
getDevicePath()
Returns the device path of that device |
java.lang.String |
getDriverKeyName()
Returns the driver key name of that device |
java.lang.String |
getFriendlyDeviceName()
The friendly device name of this device |
Device |
getHub()
Returns the hub the device is connected to |
int |
getHubPortNum()
Returns the port number of the hub where the device is connected to |
int |
getNumPorts()
Returns the number of port the hub provides. |
java.lang.String |
getSpeed()
Not implemented yet! |
java.lang.String |
getUniqueDeviceID()
Returns the unique ID |
int |
openHandle(java.lang.String devicePath)
Native function that invokes the CreateFile WinAPI function with the given device path |
void |
printByteArray(byte[] buf,
java.lang.String title,
int radix,
int numOfBytesLine)
print a Byte Array to String main purpose is for debugging matters name: The name of the array, just for clarifying the output radix: 0: decimal 2: binary (default 2) numOfByteLine: the number of Byte printed at one line |
Methods inherited from class usb.core.Device |
control, getAddress, getBus, getPortIdentifier, getSPI, getString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NO_DEVICE_CONNECTED
public static final int EXTERNAL_HUB
public static final int USB_DEVICE
public DeviceDescriptor descriptor
public Configuration configuration
Method Detail |
public int openHandle(java.lang.String devicePath)
devicePath
- A Windows specific device path for that device
public int closeHandle(int devHandle)
devHandle
- A valid device handle. This value must correspond to a former call of openHandle
public java.lang.String getDriverKeyName()
public byte[] getDeviceDescriptor(int hubHandle, int portIndex)
public byte[] getConfigurationDescriptor(int hubHandle, int portIndex)
public Device getChild(int port) throws java.io.IOException
getChild
in class Device
port
- The port number of the hub beginning at one to the number of ports the hub
provides
java.io.IOException
public Configuration getConfiguration() throws java.io.IOException
getConfiguration
in class Device
java.io.IOException
public Configuration getConfiguration(int index) throws java.io.IOException
getConfiguration
in class Device
java.io.IOException
public DeviceDescriptor getDeviceDescriptor()
getDeviceDescriptor
in class Device
public Device getHub()
getHub
in class Device
public int getHubPortNum()
getHubPortNum
in class Device
public int getNumPorts()
getNumPorts
in class Device
public java.lang.String getFriendlyDeviceName()
public java.lang.String getDevicePath()
public java.lang.String getDeviceFriendlyName()
public java.lang.String getUniqueDeviceID()
public void printByteArray(byte[] buf, java.lang.String title, int radix, int numOfBytesLine)
public java.lang.String getSpeed()
getSpeed
in class Device
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |