Package ch.ntb.usb
Class Usb_Interface_Descriptor
- java.lang.Object
-
- ch.ntb.usb.Usb_Descriptor
-
- ch.ntb.usb.Usb_Interface_Descriptor
-
public class Usb_Interface_Descriptor extends Usb_Descriptor
Represents the descriptor of a USB interface.
The interface descriptor could be seen as a header or grouping of the endpoints into a functional group performing a single feature of the device.
The length of the interface descriptor isUsb_Descriptor.USB_DT_INTERFACE_SIZEand the type isUsb_Descriptor.USB_DT_INTERFACE.
-
-
Field Summary
Fields Modifier and Type Field Description static intUSB_MAXINTERFACESMaximum number of interfaces-
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 Constructor Description Usb_Interface_Descriptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description bytegetBAlternateSetting()Returns the value used to select the alternate setting (LibusbJava.usb_set_altinterface(long, int)).bytegetBInterfaceClass()Returns the class code (Assigned by www.usb.org).bytegetBInterfaceNumber()Returns the number (identifier) of this interface.bytegetBInterfaceProtocol()Returns the protocol code (Assigned by www.usb.org).bytegetBInterfaceSubClass()Returns the subclass code (Assigned by www.usb.org).bytegetBNumEndpoints()Returns the number of endpoints used for this interface.Usb_Endpoint_Descriptor[]getEndpoint()Returns an array of endpoint descriptors.byte[]getExtra()Returns the data of extra descriptor(s) if available.intgetExtralen()Returns the number of bytes of the extra descriptor.bytegetIInterface()Returns the index of the String descriptor describing this interface.java.lang.StringtoString()-
Methods inherited from class ch.ntb.usb.Usb_Descriptor
getBDescriptorType, getBLength
-
-
-
-
Field Detail
-
USB_MAXINTERFACES
public static final int USB_MAXINTERFACES
Maximum number of interfaces- See Also:
- Constant Field Values
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getBAlternateSetting
public byte getBAlternateSetting()
Returns the value used to select the alternate setting (LibusbJava.usb_set_altinterface(long, int)).- Returns:
- the alternate setting
-
getBInterfaceClass
public byte getBInterfaceClass()
Returns the class code (Assigned by www.usb.org).- Returns:
- the class code
-
getBInterfaceNumber
public byte getBInterfaceNumber()
Returns the number (identifier) of this interface.- Returns:
- the number (identifier) of this interface
-
getBInterfaceProtocol
public byte getBInterfaceProtocol()
Returns the protocol code (Assigned by www.usb.org).- Returns:
- the protocol code
-
getBInterfaceSubClass
public byte getBInterfaceSubClass()
Returns the subclass code (Assigned by www.usb.org).- Returns:
- the subclass code
-
getBNumEndpoints
public byte getBNumEndpoints()
Returns the number of endpoints used for this interface.- Returns:
- the number of endpoints used for this interface
-
getEndpoint
public Usb_Endpoint_Descriptor[] getEndpoint()
Returns an array of endpoint descriptors.- Returns:
- an array of endpoint descriptors
-
getExtra
public byte[] getExtra()
Returns the data of extra descriptor(s) if available.- Returns:
- null or a byte array with the extra descriptor data
-
getExtralen
public int getExtralen()
Returns the number of bytes of the extra descriptor.- Returns:
- the number of bytes of the extra descriptor
-
getIInterface
public byte getIInterface()
Returns the index of the String descriptor describing this interface.- Returns:
- the index of the String descriptor
-
-