These methods are defined in the USB 1.1 specification section 9.4. The table 9.4 lists all Standard Requests.
Many of these methods have parameters whose type is short, but should never be passed more than a byte; e.g. all the interface number and endpoint address parameters have a type of short, but interface numbers and endpoint addresses are byte-sized.
| Modifier and Type | Field and Description |
|---|---|
| protected static final byte | |
| protected static final byte | |
| protected static final byte | |
| protected static final byte | |
| protected static final byte | |
| protected static final byte | |
| protected static final byte | |
| protected static final byte | |
| protected static final byte | |
| protected static final byte | |
| protected static final byte | |
| protected UsbDevice |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected static void | |
| public void | clearFeature(byte
The recipient. recipient, short The Feature Selector. featureSelector, short The target interface number or endpoint address. target)Clear Feature. |
| public static void | clearFeature(UsbDevice
The UsbDevice. usbDevice, byte The recipient. recipient, short The Feature Selector. featureSelector, short The target interface number or endpoint address. target)Clear Feature. |
| public byte | |
| public static byte | Returns: The configuration number.The UsbDevice. usbDevice)Get Configuration. |
| public int | Returns: The actual length of transferred data.The Descriptor Type. type, byte The Descriptor Index. index, short The String Descriptor Language ID. langid, byte[] The data to fill with the Descriptor. data)Get Descriptor. |
| public static int | Returns: The actual length of transferred data.The UsbDevice. usbDevice, byte The Descriptor Type. type, byte The Descriptor Index. index, short The String Descriptor Language ID. langid, byte[] The data to fill with the Descriptor. data)Get Descriptor. |
| public byte | Returns: The active alternate setting for the specified interface.The interface number. interfaceNumber)Get Interface. |
| public static byte | Returns: The active alternate setting for the specified interface.The UsbDevice. usbDevice, short The interface number. interfaceNumber)Get Interface. |
| public short | Returns: The status of the specified recipient.The recipient. recipient, short The target interface number or endpoint address. target)Get Status. |
| public static short | |
| public void | |
| public static void | setAddress(UsbDevice
The UsbDevice. usbDevice, short The new device address. deviceAddress)Set Address. |
| public void | |
| public static void | setConfiguration(UsbDevice
The UsbDevice. usbDevice, short The new configuration value. configurationValue)Set Configuration. |
| public int | Returns: The actual length of transferred data.The Descriptor Type. type, byte The Descriptor Index. index, short The String Descriptor Language ID. langid, byte[] The Descriptor. data)Set Descriptor. |
| public static int | Returns: The actual length of transferred data.The UsbDevice. usbDevice, byte The Descriptor Type. type, byte The Descriptor Index. index, short The String Descriptor Language ID. langid, byte[] The Descriptor. data)Set Descriptor. |
| public void | setFeature(byte
The recipient. recipient, short The Feature Selector. featureSelector, short The target interface number or endpoint address. target)Set Feature. |
| public static void | setFeature(UsbDevice
The UsbDevice. usbDevice, byte The recipient. recipient, short The Feature Selector. featureSelector, short The target interface number or endpoint address. target)Set Feature. |
| public void | setInterface(short
The interface number. interfaceNumber, short The alternate setting number. alternateSetting)Set Interface. |
| public static void | setInterface(UsbDevice
The UsbDevice. usbDevice, short The interface number. interfaceNumber, short The alternate setting number. alternateSetting)Set Interface. |
| public short | |
| public static short | Returns: The frame number.The UsbDevice. usbDevice, short The endpoint address. endpointAddress)Synch Frame. |
| REQUESTTYPE_CLEAR_FEATURE | back to summary |
|---|---|
| protected static final byte REQUESTTYPE_CLEAR_FEATURE | |
| REQUESTTYPE_GET_CONFIGURATION | back to summary |
|---|---|
| protected static final byte REQUESTTYPE_GET_CONFIGURATION | |
| REQUESTTYPE_GET_DESCRIPTOR | back to summary |
|---|---|
| protected static final byte REQUESTTYPE_GET_DESCRIPTOR | |
| REQUESTTYPE_GET_INTERFACE | back to summary |
|---|---|
| protected static final byte REQUESTTYPE_GET_INTERFACE | |
| REQUESTTYPE_GET_STATUS | back to summary |
|---|---|
| protected static final byte REQUESTTYPE_GET_STATUS | |
| REQUESTTYPE_SET_ADDRESS | back to summary |
|---|---|
| protected static final byte REQUESTTYPE_SET_ADDRESS | |
| REQUESTTYPE_SET_CONFIGURATION | back to summary |
|---|---|
| protected static final byte REQUESTTYPE_SET_CONFIGURATION | |
| REQUESTTYPE_SET_DESCRIPTOR | back to summary |
|---|---|
| protected static final byte REQUESTTYPE_SET_DESCRIPTOR | |
| REQUESTTYPE_SET_FEATURE | back to summary |
|---|---|
| protected static final byte REQUESTTYPE_SET_FEATURE | |
| REQUESTTYPE_SET_INTERFACE | back to summary |
|---|---|
| protected static final byte REQUESTTYPE_SET_INTERFACE | |
| REQUESTTYPE_SYNCH_FRAME | back to summary |
|---|---|
| protected static final byte REQUESTTYPE_SYNCH_FRAME | |
| usbDevice | back to summary |
|---|---|
| protected UsbDevice usbDevice | |
| StandardRequest | back to summary |
|---|---|
| public StandardRequest(UsbDevice usbDevice) Constructor. The specified UsbDevice will be used on the instance methods which do not include a UsbDevice parameter. The class methods which do include a UsbDevice parameter will use that UsbDevice.
| |
| checkRecipient | back to summary |
|---|---|
| protected static void checkRecipient(byte recipient) throws IllegalArgumentException Check the recipient.
Valid recipients are
| |
| clearFeature | back to summary |
|---|---|
| public void clearFeature(byte recipient, short featureSelector, short target) throws UsbException, IllegalArgumentException Clear Feature. This only calls the corresponding class method using the UsbDevice specified in the constructor.
| |
| clearFeature | back to summary |
|---|---|
| public static void clearFeature(UsbDevice usbDevice, byte recipient, short featureSelector, short target) throws UsbException, IllegalArgumentException Clear Feature.
Valid recipients are
| |
| getConfiguration | back to summary |
|---|---|
| public byte getConfiguration() throws UsbException Get Configuration. This only calls the corresponding class method using the UsbDevice specified in the constructor.
| |
| getConfiguration | back to summary |
|---|---|
| public static byte getConfiguration(UsbDevice usbDevice) throws UsbException Get Configuration.
| |
| getDescriptor | back to summary |
|---|---|
| public int getDescriptor(byte type, byte index, short langid, byte[] data) throws UsbException Get Descriptor. This only calls the corresponding class method using the UsbDevice specified in the constructor.
| |
| getDescriptor | back to summary |
|---|---|
| public static int getDescriptor(UsbDevice usbDevice, byte type, byte index, short langid, byte[] data) throws UsbException Get Descriptor. The parameters correspond to the setup packet:
This method does not restrict the Descriptor type, but
the device is only required to support those Descriptors defined
in the USB 1.1 specification table 9.5, which includes
If the type is string or configuration, the index is used to select the specific descriptor; for other descriptor types is should be 0 (this implementation does not enforce this). If the type is string, the langid indicates what language to use. For other types it should be 0 (but this is not enforced). The data is filled with the actual descriptor.
| |
| getInterface | back to summary |
|---|---|
| public byte getInterface(short interfaceNumber) throws UsbException Get Interface. This only calls the corresponding class method using the UsbDevice specified in the constructor.
| |
| getInterface | back to summary |
|---|---|
| public static byte getInterface(UsbDevice usbDevice, short interfaceNumber) throws UsbException Get Interface.
| |
| getStatus | back to summary |
|---|---|
| public short getStatus(byte recipient, short target) throws UsbException, IllegalArgumentException Get Status. This only calls the corresponding class method using the UsbDevice specified in the constructor.
| |
| getStatus | back to summary |
|---|---|
| public static short getStatus(UsbDevice usbDevice, byte recipient, short target) throws UsbException, IllegalArgumentException Get Status.
Valid recipients are
| |
| setAddress | back to summary |
|---|---|
| public void setAddress(short deviceAddress) throws UsbException Set Address. This only calls the corresponding class method using the UsbDevice specified in the constructor.
| |
| setAddress | back to summary |
|---|---|
| public static void setAddress(UsbDevice usbDevice, short deviceAddress) throws UsbException Set Address. Since this is normally only used by the low-level Host Controller Driver, this quite likely will either fail or cause serious problems. This should not be used unless you know what you are doing and know that the Operating System's Host Controller Driver can handle this.
| |
| setConfiguration | back to summary |
|---|---|
| public void setConfiguration(short configurationValue) throws UsbException Set Configuration. This only calls the corresponding class method using the UsbDevice specified in the constructor.
| |
| setConfiguration | back to summary |
|---|---|
| public static void setConfiguration(UsbDevice usbDevice, short configurationValue) throws UsbException Set Configuration.
| |
| setDescriptor | back to summary |
|---|---|
| public int setDescriptor(byte type, byte index, short langid, byte[] data) throws UsbException Set Descriptor. This only calls the corresponding class method using the UsbDevice specified in the constructor.
| |
| setDescriptor | back to summary |
|---|---|
| public static int setDescriptor(UsbDevice usbDevice, byte type, byte index, short langid, byte[] data) throws UsbException Set Descriptor. The parameters correspond to the setup packet:
This method does not restrict the Descriptor type, but
the device is only required to support those Descriptors defined
in the USB 1.1 specification table 9.5, which includes
If the type is string or configuration, the index is used to select the specific descriptor; for other descriptor types is should be 0 (this implementation does not enforce this). If the type is string, the langid indicates what language to use. For other types it should be 0 (but this is not enforced). The data should contain the actual Descriptor. The entire length is used, i.e. wLength is set to data.length.
| |
| setFeature | back to summary |
|---|---|
| public void setFeature(byte recipient, short featureSelector, short target) throws UsbException, IllegalArgumentException Set Feature. This only calls the corresponding class method using the UsbDevice specified in the constructor.
| |
| setFeature | back to summary |
|---|---|
| public static void setFeature(UsbDevice usbDevice, byte recipient, short featureSelector, short target) throws UsbException, IllegalArgumentException Set Feature.
Valid recipients are
| |
| setInterface | back to summary |
|---|---|
| public void setInterface(short interfaceNumber, short alternateSetting) throws UsbException Set Interface. This only calls the corresponding class method using the UsbDevice specified in the constructor.
| |
| setInterface | back to summary |
|---|---|
| public static void setInterface(UsbDevice usbDevice, short interfaceNumber, short alternateSetting) throws UsbException Set Interface.
| |
| synchFrame | back to summary |
|---|---|
| public short synchFrame(short endpointAddress) throws UsbException Synch Frame. This only calls the corresponding class method using the UsbDevice specified in the constructor.
| |
| synchFrame | back to summary |
|---|---|
| public static short synchFrame(UsbDevice usbDevice, short endpointAddress) throws UsbException Synch Frame.
| |