public final class DescriptorUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
decodeBCD(short bcd)
Decodes a binary-coded decimal into a string and returns it.
|
static String |
dump(ByteBuffer bytes)
Dumps the specified byte buffer into a hex string and returns it.
|
static String |
dump(ConfigDescriptor descriptor)
Dumps the specified USB configuration descriptor into a string and
returns it.
|
static String |
dump(DeviceDescriptor descriptor)
Dumps the specified USB device descriptor into a string and returns it.
|
static String |
dump(DeviceDescriptor descriptor,
String manufacturer,
String product,
String serial)
Dumps the specified USB device descriptor into a string and returns it.
|
static String |
dump(EndpointDescriptor descriptor)
Dumps the specified USB endpoint descriptor into a string and returns it.
|
static String |
dump(InterfaceDescriptor descriptor)
Dumps the specified USB interface descriptor into a string and returns
it.
|
static String |
getDirectionName(byte bEndpointAddress)
Returns the name of the USB traffic direction for the specified
endpoint address.
|
static String |
getSpeedName(int speed)
Returns the name for the specified speed number.
|
static String |
getSynchTypeName(byte bmAttributes)
Returns the name for the synchronization type in the specified endpoint
attributes.
|
static String |
getTransferTypeName(byte bmAttributes)
Returns the name for the transfer type in the specified endpoint
attributes.
|
static String |
getUsageTypeName(byte bmAttributes)
Returns the name for the usage type in the specified endpoint attributes.
|
static String |
getUSBClassName(byte usbClass)
Returns the name of the specified USB class.
|
public static String getUSBClassName(byte usbClass)
usbClass
- The numeric USB class.public static String decodeBCD(short bcd)
bcd
- The binary-coded decimal to decode.public static String dump(ByteBuffer bytes)
bytes
- The bytes to dump.public static String dump(DeviceDescriptor descriptor)
descriptor
- The USB device descriptor to dump.public static String dump(DeviceDescriptor descriptor, String manufacturer, String product, String serial)
descriptor
- The USB device descriptor to dump.manufacturer
- The manufacturer string or null if unknown.product
- The product string or null if unknown.serial
- The serial number string or null if unknown.public static String dump(ConfigDescriptor descriptor)
descriptor
- The USB configuration descriptor to dump.public static String dump(InterfaceDescriptor descriptor)
descriptor
- The USB interface descriptor to dump.public static String dump(EndpointDescriptor descriptor)
descriptor
- The USB endpoint descriptor to dump.public static String getTransferTypeName(byte bmAttributes)
bmAttributes
- The endpoint attributes value.public static String getSynchTypeName(byte bmAttributes)
bmAttributes
- The endpoint attributes value.public static String getUsageTypeName(byte bmAttributes)
bmAttributes
- The endpoint attributes value.public static String getSpeedName(int speed)
speed
- The speed number.public static String getDirectionName(byte bEndpointAddress)
bEndpointAddress
- The endpoint address.Copyright © 2011–2018 usb4java Team. All rights reserved.