Files
jlibusb/java/src/ch/ntb/usb/Usb_Config_Descriptor.java
schlaepfer 2ae9ca02d7 - descriptors extended from Usb_Descriptor
- toString()
- javadoc added
- interface changes (Strings, dll)

git-svn-id: https://svn.code.sf.net/p/libusbjava/code/trunk@147 94ad28fe-ef68-46b1-9651-e7ae4fcf1c4c
2006-05-10 13:15:33 +00:00

78 lines
1.9 KiB
Java

package ch.ntb.usb;
/**
* Represents the descriptor of a USB configuration.<br>
* A USB device can have several different configuration.<br>
* <br>
* The length of the configuration descriptor is
* {@link ch.ntb.usb.Usb_Descriptor#USB_DT_CONFIG_SIZE} and the type is
* {@link ch.ntb.usb.Usb_Descriptor#USB_DT_CONFIG}.
*
* @author schlaepfer
*
*/
public class Usb_Config_Descriptor extends Usb_Descriptor {
/**
* Maximum number of configuration per device
*/
public static final int USB_MAXCONFIG = 8;
/**
* Total length in bytes of data returned.<br>
* When the configuration descriptor is read, it returns the entire
* configuration hierarchy which includes all related interface and endpoint
* descriptors. The <code>wTotalLength</code> field reflects the number of
* bytes in the hierarchy.
*/
public short wTotalLength;
/**
* Number of interfaces
*/
public byte bNumInterfaces;
/**
* Value to use as an argument to select this configuration ({@link LibusbWin#usb_set_configuration(int, int)}).
*/
public byte bConfigurationValue;
/**
* Index of String descriptor describing this configuration
*/
public byte iConfiguration;
/**
* Specifies power parameters for this configuration<br>
* <br>
* Bit 7: Reserved, set to 1 (USB 1.0 Bus Powered)<br>
* Bit 6: Self Powered<br>
* Bit 5: Remote Wakeup<br>
* Bit 4..0: Reserved, set to 0
*/
public byte bmAttributes;
/**
* Maximum power consumption in 2mA units
*/
public byte MaxPower;
/**
* USB interface descriptors
*/
public Usb_Interface[] interface_;
/**
* Extra descriptors are currently not interpreted because of their unknown
* structure.
*/
public Usb_Config_Descriptor extra; /* Extra descriptors */
// TODO
public int extralen;
public String toString() {
return "Usb_Config_Descriptor bNumInterfaces: 0x"
+ Integer.toHexString(bNumInterfaces);
}
}