public final class DeviceDescriptor
extends Object
A structure representing the standard USB device descriptor.
This descriptor is documented in section 9.6.1 of the USB 3.0 specification.
All multiple-byte fields are represented in host-endian format.
Author:
Klaus Reimer ([email protected])
DeviceDescriptor
public DeviceDescriptor()
getBuffer
public ByteBuffer getBuffer()
Returns the Java byte buffer which contains the descriptor structure.
Returns:
The descriptor structure buffer.
bDescriptorType
public byte bDescriptorType()
Returns:
The descriptor type.
bcdUSB
public short bcdUSB()
Returns the USB specification release number in binary-coded decimal.
A value of 0x0200 indicates USB 2.0, 0x0110 indicates USB 1.1, etc.
Returns:
The USB specification release number.
bDeviceClass
public byte bDeviceClass()
Returns the USB-IF class code for the device. See LibUSB.CLASS_*
constants.
Returns:
The USB-IF class code.
bDeviceSubClass
public byte bDeviceSubClass()
Returns the USB-IF subclass code for the device, qualified by the
bDeviceClass value.
Returns:
The USB-IF subclass code.
bDeviceProtocol
public byte bDeviceProtocol()
Returns the USB-IF protocol code for the device, qualified by the
bDeviceClass and bDeviceSubClass values.
Returns:
The USB-IF protocol code.
bMaxPacketSize0
public byte bMaxPacketSize0()
Returns the maximum packet size for endpoint 0.
Returns:
The maximum packet site for endpoint 0.
bcdDevice
public short bcdDevice()
Returns the device release number in binary-coded decimal.
Returns:
The device release number.
iManufacturer
public byte iManufacturer()
Returns the index of the string descriptor describing manufacturer.
Returns:
The manufacturer string descriptor index.
iProduct
public byte iProduct()
Returns the index of the string descriptor describing product.
Returns:
The product string descriptor index.
iSerialNumber
public byte iSerialNumber()
Returns the index of the string descriptor containing device serial
number.
Returns:
The serial number string descriptor index.
bNumConfigurations
public byte bNumConfigurations()
Returns the number of possible configurations.
Returns:
The number of possible configurations.
Parameters:
handle
- The USB device handle for resolving string descriptors. If
null then no strings are resolved.
Returns:
The descriptor dump.