Examples of DeviceHandle


Examples of org.usb4java.DeviceHandle

    @Test
    public void testOpenAndClose()
    {
        assumeUsbTestsEnabled();
        assumeNotNull(this.device);
        final DeviceHandle handle = new DeviceHandle();
        final int result = LibUsb.open(this.device, handle);
        assertTrue((result == LibUsb.SUCCESS)
            || (result == LibUsb.ERROR_ACCESS));
        if (result == LibUsb.SUCCESS)
        {
View Full Code Here

Examples of org.usb4java.DeviceHandle

     */
    @Test(expected = IllegalArgumentException.class)
    public void testOpenWithoutDevice()
    {
        assumeUsbTestsEnabled();
        final DeviceHandle handle = new DeviceHandle();
        LibUsb.open(null, handle);
    }
View Full Code Here

Examples of org.usb4java.DeviceHandle

     */
    @Test
    public void testOpenDeviceWithVidPid()
    {
        assumeUsbTestsEnabled();
        final DeviceHandle handle = LibUsb.openDeviceWithVidPid(this.context,
            this.vendorId, this.productId);
        if (handle != null)
        {
            LibUsb.close(handle);
        }
View Full Code Here

Examples of org.usb4java.DeviceHandle

     */
    @Test(expected = IllegalArgumentException.class)
    public void testGetConfigurationWithoutBuffer()
    {
        assumeUsbTestsEnabled();
        LibUsb.getConfiguration(new DeviceHandle(), null);
    }
View Full Code Here

Examples of org.usb4java.DeviceHandle

     */
    @Test(expected = IllegalArgumentException.class)
    public void testGetStringDescriptorAsciiWithoutBuffer()
    {
        assumeUsbTestsEnabled();
        LibUsb.getStringDescriptorAscii(new DeviceHandle(), (byte) 0, null);
    }
View Full Code Here

Examples of org.usb4java.DeviceHandle

     */
    @Test(expected = IllegalArgumentException.class)
    public void testGetDescriptorWithoutBuffer()
    {
        assumeUsbTestsEnabled();
        LibUsb.getDescriptor(new DeviceHandle(), (byte) 0, (byte) 0, null);
    }
View Full Code Here

Examples of org.usb4java.DeviceHandle

     */
    @Test(expected = IllegalArgumentException.class)
    public void testGetStringDescriptorWithoutBuffer()
    {
        assumeUsbTestsEnabled();
        LibUsb.getStringDescriptor(new DeviceHandle(), (byte) 0, (short) 0,
            null);
    }
View Full Code Here

Examples of org.usb4java.DeviceHandle

     */
    @Test(expected = IllegalArgumentException.class)
    public void testControlTransferWithoutBuffer()
    {
        assumeUsbTestsEnabled();
        LibUsb.controlTransfer(new DeviceHandle(), (byte) 0, (byte) 0,
            (short) 0, (short) 0, null, 0);
    }
View Full Code Here

Examples of org.usb4java.DeviceHandle

     */
    @Test(expected = IllegalArgumentException.class)
    public void testControlTransferWithIndirectBuffer()
    {
        assumeUsbTestsEnabled();
        LibUsb.controlTransfer(new DeviceHandle(), (byte) 0, (byte) 0,
            (short) 0, (short) 0, ByteBuffer.allocate(0), 0);
    }
View Full Code Here

Examples of org.usb4java.DeviceHandle

     */
    @Test(expected = IllegalArgumentException.class)
    public void testBulkTransferWithoutDataBuffer()
    {
        assumeUsbTestsEnabled();
        LibUsb.bulkTransfer(new DeviceHandle(), (byte) 0, null,
            BufferUtils.allocateIntBuffer(), 0);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.