usb.core
Class DeviceDescriptor

java.lang.Object
  |
  +--usb.core.Descriptor
        |
        +--usb.core.DeviceDescriptor
All Implemented Interfaces:
java.io.Serializable

public final class DeviceDescriptor
extends Descriptor

Provides access to a USB device descriptor. Most fields of this descriptor are specified in section 9.6.1 of the USB 1.1 specification, and the standard device messages are defined later in that chapter.

See Also:
Device, Serialized Form

Fields inherited from class usb.core.Descriptor
CLASS_APP_SPECIFIC, CLASS_AUDIO, CLASS_COMM, CLASS_DATA, CLASS_HID, CLASS_HUB, CLASS_MASS_STORAGE, CLASS_PRINTER, CLASS_VENDOR_SPECIFIC, TYPE_CONFIGURATION, TYPE_DEVICE, TYPE_DEVICE_QUALIFIER, TYPE_ENDPOINT, TYPE_HID, TYPE_HUB, TYPE_INTERFACE, TYPE_INTERFACE_POWER, TYPE_OTHER_SPEED, TYPE_PHYSICAL, TYPE_REPORT, TYPE_STRING
 
Constructor Summary
DeviceDescriptor(Device d, byte[] buf)
           
 
Method Summary
 DeviceDescriptor clone(Device d)
           
 Device getDevice()
          Returns the device the descriptor describes.
 int getDeviceClass()
          Returns the USB class identifier for the device.
 java.lang.String getDeviceClassName()
          Returns the USB class name for the device.
 java.lang.String getDeviceId()
          Returns the device release version number (such as "3.14").
 int getDeviceProtocol()
          Returns the device protocol
 int getDeviceSubClass()
          Returns the USB subclass identifier for the device.
 java.lang.String getManufacturer(int language)
          Returns any string describing the product's manufacturer, or null.
 int getManufacturerStringId()
          Returns the manufacturer string ID, or zero.
 int getMaxPacketSize0()
          Returns the maximum packet size understood by endpoint zero.
 int getNumConfigurations()
          Returns the number of configurations this device supports.
 java.lang.String getProduct(int language)
          Returns any string describing the product, or null.
 int getProductId()
          Returns the vendor's product identifier code.
 int getProductStringId()
          Returns the product string ID, or zero
 java.lang.String getSerial(int language)
          Returns any string describing the product's serial number, or null.
 int getSerialStringId()
          Returns the serial string ID, or zero.
 java.lang.String getUSBVersion()
          Returns the version of the USB specification to which this device and its descriptors conform.
 int getVendorId()
          Returns the vendor of the USB device.
 
Methods inherited from class usb.core.Descriptor
getBCD, getClassName, getDescriptorType, getDescriptorTypeName, getLength, getU16, getU32, getU8, nextDescriptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceDescriptor

public DeviceDescriptor(Device d,
                        byte[] buf)
Method Detail

clone

public DeviceDescriptor clone(Device d)

getUSBVersion

public java.lang.String getUSBVersion()
Returns the version of the USB specification to which this device and its descriptors conform. At this writing, "1.1" is the current version, used by most hubs, but older "1.0" devices are available.

getDeviceClass

public int getDeviceClass()
Returns the USB class identifier for the device.

getDeviceClassName

public java.lang.String getDeviceClassName()
Returns the USB class name for the device.

getDeviceSubClass

public int getDeviceSubClass()
Returns the USB subclass identifier for the device.

getDeviceProtocol

public int getDeviceProtocol()
Returns the device protocol

getMaxPacketSize0

public int getMaxPacketSize0()
Returns the maximum packet size understood by endpoint zero. Only values of 8, 16, 32, or 64 bytes are relevant.

getVendorId

public int getVendorId()
Returns the vendor of the USB device. Many devices are bundled into products from other vendors, so this vendor ID may not correspond to markings on packaging.

getProductId

public int getProductId()
Returns the vendor's product identifier code. Each vendor assigns these codes as it chooses.

getDeviceId

public java.lang.String getDeviceId()
Returns the device release version number (such as "3.14").

getManufacturer

public java.lang.String getManufacturer(int language)
Returns any string describing the product's manufacturer, or null. This is optional, and is typically associated with the vendor ID.

getManufacturerStringId

public int getManufacturerStringId()
Returns the manufacturer string ID, or zero.

getProduct

public java.lang.String getProduct(int language)
Returns any string describing the product, or null. This is optional, and is typically associated with the product ID.

getProductStringId

public int getProductStringId()
Returns the product string ID, or zero

getSerial

public java.lang.String getSerial(int language)
Returns any string describing the product's serial number, or null. This is optional, and is assigned using the manufacturer's scheme.

getSerialStringId

public int getSerialStringId()
Returns the serial string ID, or zero.

getNumConfigurations

public int getNumConfigurations()
Returns the number of configurations this device supports.

getDevice

public Device getDevice()
Returns the device the descriptor describes.
Overrides:
getDevice in class Descriptor


Associated source code is licenced under the LGPL.
See http://jusb.sourceforge.net
This documentation was derived from that source code on 24-Jul-2002.