Package ch.ntb.usb
Class Usb_Device_Descriptor
java.lang.Object
ch.ntb.usb.Usb_Descriptor
ch.ntb.usb.Usb_Device_Descriptor
Represents the descriptor of a USB device.
A USB device can only have one device descriptor. It specifies some basic, yet important information about the device.
The length of the device descriptor is
A USB device can only have one device descriptor. It specifies some basic, yet important information about the device.
The length of the device descriptor is
Usb_Descriptor.USB_DT_DEVICE_SIZE and the type is
Usb_Descriptor.USB_DT_DEVICE.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDevice and/or interface class codes.static final intDevice and/or interface class codes.static final intDevice and/or interface class codes.static final intDevice and/or interface class codes.static final intDevice and/or interface class codes.static final intDevice and/or interface class codes.static final intDevice and/or interface class codes.static final intDevice and/or interface class codes.static final intDevice and/or interface class codes.Fields inherited from class ch.ntb.usb.Usb_Descriptor
USB_DT_CONFIG, USB_DT_CONFIG_SIZE, USB_DT_DEVICE, USB_DT_DEVICE_SIZE, USB_DT_ENDPOINT, USB_DT_ENDPOINT_AUDIO_SIZE, USB_DT_ENDPOINT_SIZE, USB_DT_HID, USB_DT_HUB, USB_DT_HUB_NONVAR_SIZE, USB_DT_INTERFACE, USB_DT_INTERFACE_SIZE, USB_DT_PHYSICAL, USB_DT_REPORT, USB_DT_STRING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionshortReturns the device release number.
Assigned by the manufacturer of the device.shortReturns the USB specification number to which the device complies to.
This field reports the highest version of USB the device supports.byteReturns the class code (Assigned by www.usb.org)
If equal to zero, each interface specifies it's own class code.byteReturns the protocol code (Assigned by www.usb.org)byteReturns the subclass code (Assigned by www.usb.org)byteReturns the maximum packet size for endpoint zero.
Valid sizes are 8, 16, 32, 64.byteReturns the number of possible configurations supported at its current speed.shortReturns the product ID (Assigned by www.usb.org)shortReturns the Vendor ID (Assigned by www.usb.org)byteReturns the index of the manufacturer string descriptor.
If this value is 0, no string descriptor is used.byteReturns the index of the product string descriptor.
If this value is 0, no string descriptor is used.byteReturns the index of serial number string descriptor.
If this value is 0, no string descriptor is used.toString()Methods inherited from class ch.ntb.usb.Usb_Descriptor
getBDescriptorType, getBLength
-
Field Details
-
USB_CLASS_PER_INTERFACE
public static final int USB_CLASS_PER_INTERFACEDevice and/or interface class codes.- See Also:
-
USB_CLASS_AUDIO
public static final int USB_CLASS_AUDIODevice and/or interface class codes.- See Also:
-
USB_CLASS_COMM
public static final int USB_CLASS_COMMDevice and/or interface class codes.- See Also:
-
USB_CLASS_HID
public static final int USB_CLASS_HIDDevice and/or interface class codes.- See Also:
-
USB_CLASS_PRINTER
public static final int USB_CLASS_PRINTERDevice and/or interface class codes.- See Also:
-
USB_CLASS_MASS_STORAGE
public static final int USB_CLASS_MASS_STORAGEDevice and/or interface class codes.- See Also:
-
USB_CLASS_HUB
public static final int USB_CLASS_HUBDevice and/or interface class codes.- See Also:
-
USB_CLASS_DATA
public static final int USB_CLASS_DATADevice and/or interface class codes.- See Also:
-
USB_CLASS_VENDOR_SPEC
public static final int USB_CLASS_VENDOR_SPECDevice and/or interface class codes.- See Also:
-
-
Constructor Details
-
Usb_Device_Descriptor
public Usb_Device_Descriptor()
-
-
Method Details
-
getBcdDevice
public short getBcdDevice()Returns the device release number.
Assigned by the manufacturer of the device.- Returns:
- the device release number
-
getBcdUSB
public short getBcdUSB()Returns the USB specification number to which the device complies to.
This field reports the highest version of USB the device supports. The value is in binary coded decimal with a format of 0xJJMN where JJ is the major version number, M is the minor version number and N is the sub minor version number.
Examples: USB 2.0 is reported as 0x0200, USB 1.1 as 0x0110 and USB 1.0 as 0x100- Returns:
- the USB specification number to which the device complies to
-
getBDeviceClass
public byte getBDeviceClass()Returns the class code (Assigned by www.usb.org)
If equal to zero, each interface specifies it's own class code. If equal to 0xFF, the class code is vendor specified. Otherwise the field is a valid class code.- Returns:
- the class code
-
getBDeviceProtocol
public byte getBDeviceProtocol()Returns the protocol code (Assigned by www.usb.org)- Returns:
- the protocol code
-
getBDeviceSubClass
public byte getBDeviceSubClass()Returns the subclass code (Assigned by www.usb.org)- Returns:
- the subclass code
-
getBMaxPacketSize0
public byte getBMaxPacketSize0()Returns the maximum packet size for endpoint zero.
Valid sizes are 8, 16, 32, 64.- Returns:
- the maximum packet size for endpoint zero
-
getBNumConfigurations
public byte getBNumConfigurations()Returns the number of possible configurations supported at its current speed.- Returns:
- the number of possible configurations supported at its current speed
-
getIdProduct
public short getIdProduct()Returns the product ID (Assigned by www.usb.org)- Returns:
- the product ID
-
getIdVendor
public short getIdVendor()Returns the Vendor ID (Assigned by www.usb.org)- Returns:
- the Vendor ID
-
getIManufacturer
public byte getIManufacturer()Returns the index of the manufacturer string descriptor.
If this value is 0, no string descriptor is used.- Returns:
- the index of the manufacturer string descriptor
-
getIProduct
public byte getIProduct()Returns the index of the product string descriptor.
If this value is 0, no string descriptor is used.- Returns:
- the index of the product string descriptor
-
getISerialNumber
public byte getISerialNumber()Returns the index of serial number string descriptor.
If this value is 0, no string descriptor is used.- Returns:
- the index of serial number string descriptor
-
toString
-