mirror of https://github.com/rusefi/usb4java.git
Fix typos
This commit is contained in:
parent
a68a6f33c3
commit
b0ef2ea313
|
@ -3,5 +3,6 @@ target
|
||||||
.classpath
|
.classpath
|
||||||
.project
|
.project
|
||||||
.idea
|
.idea
|
||||||
|
.vscode
|
||||||
*.iml
|
*.iml
|
||||||
hs_err_*.log
|
hs_err_*.log
|
||||||
|
|
|
@ -11,6 +11,6 @@ libusb4java-*.jar (The native libraries for the various platforms)
|
||||||
commons-lang3-*.jar (Apache Commons Lang library needed by usb4java)
|
commons-lang3-*.jar (Apache Commons Lang library needed by usb4java)
|
||||||
|
|
||||||
If you don't want usb4java to extract the native libraries into a temporary
|
If you don't want usb4java to extract the native libraries into a temporary
|
||||||
directoy on each program start then you might want to distribute them in
|
directory on each program start then you might want to distribute them in
|
||||||
extracted form with your application. Just make sure your classpath points
|
extracted form with your application. Just make sure your classpath points
|
||||||
to the directory where you extracted the JARs.
|
to the directory where you extracted the JARs.
|
||||||
|
|
|
@ -17,7 +17,7 @@ import java.util.Map;
|
||||||
public final class DescriptorUtils
|
public final class DescriptorUtils
|
||||||
{
|
{
|
||||||
/** Mapping from USB class id to USB class name. */
|
/** Mapping from USB class id to USB class name. */
|
||||||
private static final Map<Byte, String> CLASS_NAMES =
|
private static final Map<Byte, String> CLASS_NAMES =
|
||||||
new HashMap<Byte, String>();
|
new HashMap<Byte, String>();
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@ -35,8 +35,7 @@ public final class DescriptorUtils
|
||||||
CLASS_NAMES.put(LibUsb.CLASS_SMART_CARD, "Smart Card");
|
CLASS_NAMES.put(LibUsb.CLASS_SMART_CARD, "Smart Card");
|
||||||
CLASS_NAMES.put(LibUsb.CLASS_CONTENT_SECURITY, "Content Security");
|
CLASS_NAMES.put(LibUsb.CLASS_CONTENT_SECURITY, "Content Security");
|
||||||
CLASS_NAMES.put(LibUsb.CLASS_VIDEO, "Video");
|
CLASS_NAMES.put(LibUsb.CLASS_VIDEO, "Video");
|
||||||
CLASS_NAMES.put(LibUsb.CLASS_PERSONAL_HEALTHCARE,
|
CLASS_NAMES.put(LibUsb.CLASS_PERSONAL_HEALTHCARE, "Personal Healthcare");
|
||||||
"Personal Healthcare");
|
|
||||||
CLASS_NAMES.put(LibUsb.CLASS_DIAGNOSTIC_DEVICE, "Diagnostic Device");
|
CLASS_NAMES.put(LibUsb.CLASS_DIAGNOSTIC_DEVICE, "Diagnostic Device");
|
||||||
CLASS_NAMES.put(LibUsb.CLASS_WIRELESS, "Wireless");
|
CLASS_NAMES.put(LibUsb.CLASS_WIRELESS, "Wireless");
|
||||||
CLASS_NAMES.put(LibUsb.CLASS_APPLICATION, "Application");
|
CLASS_NAMES.put(LibUsb.CLASS_APPLICATION, "Application");
|
||||||
|
@ -137,7 +136,7 @@ public final class DescriptorUtils
|
||||||
* @param product
|
* @param product
|
||||||
* The product string or null if unknown.
|
* The product string or null if unknown.
|
||||||
* @param serial
|
* @param serial
|
||||||
* The serial number strsing or null if unknown.
|
* The serial number string or null if unknown.
|
||||||
* @return The descriptor dump.
|
* @return The descriptor dump.
|
||||||
*/
|
*/
|
||||||
public static String dump(final DeviceDescriptor descriptor,
|
public static String dump(final DeviceDescriptor descriptor,
|
||||||
|
@ -348,7 +347,7 @@ public final class DescriptorUtils
|
||||||
return "Feedback";
|
return "Feedback";
|
||||||
case LibUsb.ISO_USAGE_TYPE_IMPLICIT:
|
case LibUsb.ISO_USAGE_TYPE_IMPLICIT:
|
||||||
return "Implicit Feedback Data";
|
return "Implicit Feedback Data";
|
||||||
case 3:
|
case 3:
|
||||||
// b11 is considered "Reserved" according to USB 3.0 spec.
|
// b11 is considered "Reserved" according to USB 3.0 spec.
|
||||||
return "Reserved";
|
return "Reserved";
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -59,11 +59,11 @@ public final class DeviceDescriptor
|
||||||
{
|
{
|
||||||
return this.deviceDescriptorPointer;
|
return this.deviceDescriptorPointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Java byte buffer which contains the descriptor structure.
|
* Returns the Java byte buffer which contains the descriptor structure.
|
||||||
*
|
*
|
||||||
* @return The descriptor structur buffer.
|
* @return The descriptor structure buffer.
|
||||||
*/
|
*/
|
||||||
public ByteBuffer getBuffer()
|
public ByteBuffer getBuffer()
|
||||||
{
|
{
|
||||||
|
@ -72,15 +72,15 @@ public final class DeviceDescriptor
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the size of this descriptor (in bytes).
|
* Returns the size of this descriptor (in bytes).
|
||||||
*
|
*
|
||||||
* @return The size of this descriptor (in bytes).
|
* @return The size of this descriptor (in bytes).
|
||||||
*/
|
*/
|
||||||
public native byte bLength();
|
public native byte bLength();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the descriptor type. Will have value {@link LibUsb#DT_DEVICE}
|
* Returns the descriptor type. Will have value {@link LibUsb#DT_DEVICE}
|
||||||
* in this context.
|
* in this context.
|
||||||
*
|
*
|
||||||
* @return The descriptor type.
|
* @return The descriptor type.
|
||||||
*/
|
*/
|
||||||
public native byte bDescriptorType();
|
public native byte bDescriptorType();
|
||||||
|
@ -88,88 +88,88 @@ public final class DeviceDescriptor
|
||||||
/**
|
/**
|
||||||
* Returns the USB specification release number in binary-coded decimal.
|
* Returns the USB specification release number in binary-coded decimal.
|
||||||
* A value of 0x0200 indicates USB 2.0, 0x0110 indicates USB 1.1, etc.
|
* A value of 0x0200 indicates USB 2.0, 0x0110 indicates USB 1.1, etc.
|
||||||
*
|
*
|
||||||
* @return The USB specification release number.
|
* @return The USB specification release number.
|
||||||
*/
|
*/
|
||||||
public native short bcdUSB();
|
public native short bcdUSB();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the USB-IF class code for the device. See LibUSB.CLASS_*
|
* Returns the USB-IF class code for the device. See LibUSB.CLASS_*
|
||||||
* constants.
|
* constants.
|
||||||
*
|
*
|
||||||
* @return The USB-IF class code.
|
* @return The USB-IF class code.
|
||||||
*/
|
*/
|
||||||
public native byte bDeviceClass();
|
public native byte bDeviceClass();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the USB-IF subclass code for the device, qualified by the
|
* Returns the USB-IF subclass code for the device, qualified by the
|
||||||
* bDeviceClass value.
|
* bDeviceClass value.
|
||||||
*
|
*
|
||||||
* @return The USB-IF subclass code.
|
* @return The USB-IF subclass code.
|
||||||
*/
|
*/
|
||||||
public native byte bDeviceSubClass();
|
public native byte bDeviceSubClass();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the USB-IF protocol code for the device, qualified by the
|
* Returns the USB-IF protocol code for the device, qualified by the
|
||||||
* bDeviceClass and bDeviceSubClass values.
|
* bDeviceClass and bDeviceSubClass values.
|
||||||
*
|
*
|
||||||
* @return The USB-IF protocol code.
|
* @return The USB-IF protocol code.
|
||||||
*/
|
*/
|
||||||
public native byte bDeviceProtocol();
|
public native byte bDeviceProtocol();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the maximum packet size for endpoint 0.
|
* Returns the maximum packet size for endpoint 0.
|
||||||
*
|
*
|
||||||
* @return The maximum packet site for endpoint 0.
|
* @return The maximum packet site for endpoint 0.
|
||||||
*/
|
*/
|
||||||
public native byte bMaxPacketSize0();
|
public native byte bMaxPacketSize0();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the USB-IF vendor ID.
|
* Returns the USB-IF vendor ID.
|
||||||
*
|
*
|
||||||
* @return The vendor ID
|
* @return The vendor ID
|
||||||
*/
|
*/
|
||||||
public native short idVendor();
|
public native short idVendor();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the USB-IF product ID.
|
* Returns the USB-IF product ID.
|
||||||
*
|
*
|
||||||
* @return The product ID.
|
* @return The product ID.
|
||||||
*/
|
*/
|
||||||
public native short idProduct();
|
public native short idProduct();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the device release number in binary-coded decimal.
|
* Returns the device release number in binary-coded decimal.
|
||||||
*
|
*
|
||||||
* @return The device release number.
|
* @return The device release number.
|
||||||
*/
|
*/
|
||||||
public native short bcdDevice();
|
public native short bcdDevice();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the index of the string descriptor describing manufacturer.
|
* Returns the index of the string descriptor describing manufacturer.
|
||||||
*
|
*
|
||||||
* @return The manufacturer string descriptor index.
|
* @return The manufacturer string descriptor index.
|
||||||
*/
|
*/
|
||||||
public native byte iManufacturer();
|
public native byte iManufacturer();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the index of the string descriptor describing product.
|
* Returns the index of the string descriptor describing product.
|
||||||
*
|
*
|
||||||
* @return The product string descriptor index.
|
* @return The product string descriptor index.
|
||||||
*/
|
*/
|
||||||
public native byte iProduct();
|
public native byte iProduct();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the index of the string descriptor containing device serial
|
* Returns the index of the string descriptor containing device serial
|
||||||
* number.
|
* number.
|
||||||
*
|
*
|
||||||
* @return The serial number string descriptor index.
|
* @return The serial number string descriptor index.
|
||||||
*/
|
*/
|
||||||
public native byte iSerialNumber();
|
public native byte iSerialNumber();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of possible configurations.
|
* Returns the number of possible configurations.
|
||||||
*
|
*
|
||||||
* @return The number of possible configurations.
|
* @return The number of possible configurations.
|
||||||
*/
|
*/
|
||||||
public native byte bNumConfigurations();
|
public native byte bNumConfigurations();
|
||||||
|
|
|
@ -36,7 +36,7 @@ public final class SsEndpointCompanionDescriptor
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new descriptor which can be passed to the
|
* Constructs a new descriptor which can be passed to the
|
||||||
* {@link LibUsb#getSsEndpointCompanionDescriptor(Context,
|
* {@link LibUsb#getSsEndpointCompanionDescriptor(Context,
|
||||||
* EndpointDescriptor, SsEndpointCompanionDescriptor)}
|
* EndpointDescriptor, SsEndpointCompanionDescriptor)}
|
||||||
* method.
|
* method.
|
||||||
*/
|
*/
|
||||||
|
@ -144,7 +144,7 @@ public final class SsEndpointCompanionDescriptor
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final SsEndpointCompanionDescriptor other =
|
final SsEndpointCompanionDescriptor other =
|
||||||
(SsEndpointCompanionDescriptor) obj;
|
(SsEndpointCompanionDescriptor) obj;
|
||||||
|
|
||||||
return new EqualsBuilder()
|
return new EqualsBuilder()
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class DeviceListIteratorTest
|
||||||
* a {@link NoSuchElementException} when accessing elements after the end
|
* a {@link NoSuchElementException} when accessing elements after the end
|
||||||
*/
|
*/
|
||||||
@Test(expected = NoSuchElementException.class)
|
@Test(expected = NoSuchElementException.class)
|
||||||
public void testNextAfterend()
|
public void testNextAfterEnd()
|
||||||
{
|
{
|
||||||
assumeUsbTestsEnabled();
|
assumeUsbTestsEnabled();
|
||||||
while (this.iterator.hasNext()) {
|
while (this.iterator.hasNext()) {
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class DeviceListTest
|
||||||
LibUsb.freeDeviceList(b, true);
|
LibUsb.freeDeviceList(b, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the {@link DeviceList#hashCode()} method.
|
* Tests the {@link DeviceList#hashCode()} method.
|
||||||
*/
|
*/
|
||||||
|
@ -95,7 +95,7 @@ public class DeviceListTest
|
||||||
LibUsb.freeDeviceList(list, true);
|
LibUsb.freeDeviceList(list, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the {@link DeviceList#toString()} method
|
* Tests the {@link DeviceList#toString()} method
|
||||||
*/
|
*/
|
||||||
|
@ -115,7 +115,7 @@ public class DeviceListTest
|
||||||
LibUsb.freeDeviceList(list, true);
|
LibUsb.freeDeviceList(list, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the {@link DeviceList#getPointer()} method
|
* Tests the {@link DeviceList#getPointer()} method
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -38,7 +38,7 @@ import org.usb4java.LibUsb;
|
||||||
*/
|
*/
|
||||||
public class LibUsbDeviceTest
|
public class LibUsbDeviceTest
|
||||||
{
|
{
|
||||||
/** The libusb contxet. */
|
/** The libusb context. */
|
||||||
private Context context;
|
private Context context;
|
||||||
|
|
||||||
/** The device to run the tests on. */
|
/** The device to run the tests on. */
|
||||||
|
@ -785,7 +785,7 @@ public class LibUsbDeviceTest
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates the specified endpoint desriptor.
|
* Validates the specified endpoint descriptor.
|
||||||
*
|
*
|
||||||
* @param desc
|
* @param desc
|
||||||
* The endpoint descriptor to validate.
|
* The endpoint descriptor to validate.
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.usb4java.LibUsb;
|
||||||
*/
|
*/
|
||||||
public class LibUsbGlobalTest
|
public class LibUsbGlobalTest
|
||||||
{
|
{
|
||||||
/** The libusb contxet. */
|
/** The libusb context. */
|
||||||
private Context context;
|
private Context context;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -63,6 +63,7 @@ public class LibUsbGlobalTest
|
||||||
* Tests the {@link LibUsb#setDebug(Context, int)} method.
|
* Tests the {@link LibUsb#setDebug(Context, int)} method.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
|
@Deprecated
|
||||||
public void testSetDebug()
|
public void testSetDebug()
|
||||||
{
|
{
|
||||||
assumeUsbTestsEnabled();
|
assumeUsbTestsEnabled();
|
||||||
|
|
|
@ -18,12 +18,12 @@ import org.junit.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the hotplug part of the {@link LibUsb} class.
|
* Tests the hotplug part of the {@link LibUsb} class.
|
||||||
*
|
*
|
||||||
* @author Klaus Reimer (k@ailis.de)
|
* @author Klaus Reimer (k@ailis.de)
|
||||||
*/
|
*/
|
||||||
public class LibUsbHotplugTest
|
public class LibUsbHotplugTest
|
||||||
{
|
{
|
||||||
/** The libusb contxet. */
|
/** The libusb context. */
|
||||||
private Context context;
|
private Context context;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -95,7 +95,7 @@ public class LibUsbHotplugTest
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ensures that no hotplug event is fired when enumeration is deactived.
|
* Ensures that no hotplug event is fired when enumeration is deactivated.
|
||||||
* When no devices are connected then this test is pretty much useless but
|
* When no devices are connected then this test is pretty much useless but
|
||||||
* won't fail because of that.
|
* won't fail because of that.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -30,7 +30,7 @@ import org.usb4java.Transfer;
|
||||||
*/
|
*/
|
||||||
public class TransferTest
|
public class TransferTest
|
||||||
{
|
{
|
||||||
/** The libusb contxet. */
|
/** The libusb context. */
|
||||||
private Context context;
|
private Context context;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.usb4java.LibUsb;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* USB-related assumptions.
|
* USB-related assumptions.
|
||||||
*
|
*
|
||||||
* @author Klaus Reimer (k@ailis.de)
|
* @author Klaus Reimer (k@ailis.de)
|
||||||
*/
|
*/
|
||||||
public class UsbAssume
|
public class UsbAssume
|
||||||
|
@ -25,16 +25,16 @@ public class UsbAssume
|
||||||
|
|
||||||
/** If TCK tests are to be executed. */
|
/** If TCK tests are to be executed. */
|
||||||
private static Boolean tckTests;
|
private static Boolean tckTests;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if USB tests are enabled.
|
* Check if USB tests are enabled.
|
||||||
*
|
*
|
||||||
* USB tests can be controlled with the system property USB_TESTS. When
|
* USB tests can be controlled with the system property USB_TESTS. When
|
||||||
* set to true then USB tests are always run, if set to false then they
|
* set to true then USB tests are always run, if set to false then they
|
||||||
* are never run. If this property is not set then the command-line tool
|
* are never run. If this property is not set then the command-line tool
|
||||||
* lsusb is called. If this tool returned at least two lines of text then
|
* lsusb is called. If this tool returned at least two lines of text then
|
||||||
* USB tests are enabled. In all other cases they are disabled.
|
* USB tests are enabled. In all other cases they are disabled.
|
||||||
*
|
*
|
||||||
* @return True if USB tests are enabled, false if not.
|
* @return True if USB tests are enabled, false if not.
|
||||||
*/
|
*/
|
||||||
public static boolean isUsbTestsEnabled()
|
public static boolean isUsbTestsEnabled()
|
||||||
|
@ -86,7 +86,7 @@ public class UsbAssume
|
||||||
* Assume that USB tests are enabled. Call this in the first line of
|
* Assume that USB tests are enabled. Call this in the first line of
|
||||||
* tests method or preparation methods when you want to ignore the
|
* tests method or preparation methods when you want to ignore the
|
||||||
* tests when the system is not able to run the tests anyway.
|
* tests when the system is not able to run the tests anyway.
|
||||||
*
|
*
|
||||||
* USB tests can be controlled with the system property USB_TESTS. When
|
* USB tests can be controlled with the system property USB_TESTS. When
|
||||||
* set to true then USB tests are always run, if set to false then they
|
* set to true then USB tests are always run, if set to false then they
|
||||||
* are never run. If this property is not set then the command-line tool
|
* are never run. If this property is not set then the command-line tool
|
||||||
|
@ -117,7 +117,7 @@ public class UsbAssume
|
||||||
* Assume that TCK tests are enabled. Call this in the first line of
|
* Assume that TCK tests are enabled. Call this in the first line of
|
||||||
* tests method or preparation methods when you want to ignore the
|
* tests method or preparation methods when you want to ignore the
|
||||||
* tests when the system is not able to run the TCK tests anyway.
|
* tests when the system is not able to run the TCK tests anyway.
|
||||||
*
|
*
|
||||||
* TCK tests can be controlled with the system property TCK_TESTS. When
|
* TCK tests can be controlled with the system property TCK_TESTS. When
|
||||||
* set to true then TCK tests are always run, if set to false then they
|
* set to true then TCK tests are always run, if set to false then they
|
||||||
* are never run. If this property is not set then the command-line tool
|
* are never run. If this property is not set then the command-line tool
|
||||||
|
|
Loading…
Reference in New Issue