当前位置: 首页>>代码示例>>Java>>正文


Java LibUsb.TRANSFER_TYPE_BULK属性代码示例

本文整理汇总了Java中org.usb4java.LibUsb.TRANSFER_TYPE_BULK属性的典型用法代码示例。如果您正苦于以下问题:Java LibUsb.TRANSFER_TYPE_BULK属性的具体用法?Java LibUsb.TRANSFER_TYPE_BULK怎么用?Java LibUsb.TRANSFER_TYPE_BULK使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.usb4java.LibUsb的用法示例。


在下文中一共展示了LibUsb.TRANSFER_TYPE_BULK属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startThread

public void startThread() {
	if (!isOpen()) {
		try {
			open();
		}
		catch (final HardwareInterfaceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	CypressFX2.log.info("Starting AsyncStatusThread");
	usbTransfer = new USBTransferThread(monitor.deviceHandle, CypressFX2.STATUS_ENDPOINT_ADDRESS,
		LibUsb.TRANSFER_TYPE_BULK, new ProcessStatusMessages(), 2, 128);
	usbTransfer.setName("AsyncStatusThread");
	usbTransfer.start();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:17,代码来源:CypressFX2.java

示例2: find_ep

static protected byte find_ep(Device device) {

    byte ep_addr = 0;

    ConfigDescriptor config = new ConfigDescriptor();
    int rval = LibUsb.getActiveConfigDescriptor(device, config);
    if (rval != 0) {
      throw new LibUsbException("error LibUsb.getActiveConfigDescriptor", rval);
    }

    InterfaceDescriptor altsetting = null;

    for (int i = 0; i < config.bNumInterfaces(); i++) {
      Interface[] iface = config.iface();
      altsetting = iface[i].altsetting()[0];
      if (altsetting.bInterfaceNumber() == 0) {
        break;
      }
    }

    EndpointDescriptor ep;
    for (int i = 0; i < altsetting.bNumEndpoints(); i++) {
      ep = altsetting.endpoint()[i];
      if ((ep.bmAttributes() & LibUsb.TRANSFER_TYPE_MASK) == LibUsb.TRANSFER_TYPE_BULK && ep.wMaxPacketSize() != 0) {
        ep_addr = ep.bEndpointAddress();
        break;
      }
    }
    LibUsb.freeConfigDescriptor(config);

    return ep_addr;
  }
 
开发者ID:diwi,项目名称:PS3Eye,代码行数:32,代码来源:URBDesc.java

示例3: startThread

public void startThread() {
	if (!isOpen()) {
		try {
			open();
		}
		catch (final HardwareInterfaceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	CypressFX3.log.info("Starting AEReader");
	usbTransfer = new USBTransferThread(monitor.deviceHandle, CypressFX3.AE_MONITOR_ENDPOINT_ADDRESS, LibUsb.TRANSFER_TYPE_BULK,
		new ProcessAEData(), getNumBuffers(), getFifoSize(), null, null, new Runnable() {
			@Override
			public void run() {
				final SwingWorker<Void, Void> shutdownWorker = new SwingWorker<Void, Void>() {
					@Override
					public Void doInBackground() {
						monitor.close();

						return (null);
					}
				};
				shutdownWorker.execute();
			}
		});
	usbTransfer.setName("AEReaderThread");
	usbTransfer.start();

	getSupport().firePropertyChange("readerStarted", false, true);
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:32,代码来源:CypressFX3.java

示例4: setEnable

/**
 * starts/stops the usbTransfer thread and notifies the readers.
 * @param enable
 */
@Override
public void setEnable(boolean enable) {
    super.setEnable(enable);
    if (enable == true) {
        if (!isOpen()) {
            try {
                open();
            } catch (final HardwareInterfaceException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }

        usbTransfer = new USBTransferThread(super.driver.retinahandle, ENDPOINT_IN, LibUsb.TRANSFER_TYPE_BULK,
                new PaerAEReader.ProcessAEData(), getNumBuffers(), getFifoSize());
        usbTransfer.setPriority(this.MONITOR_PRIORITY);
        usbTransfer.setName("AEReaderThread");
        usbTransfer.start();

        super.getReaderSupport().firePropertyChange("readerStarted", false, true);
    } else {

        usbTransfer.interrupt();
        boolean stopped = false;
        while (!stopped) {
            try {
                usbTransfer.join();
            } catch (InterruptedException ex) {
                continue;
            }
            stopped = true;
        }

        support.firePropertyChange("readerStopped", false, true);
        this.driver.aeReader = null;
    }

}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:42,代码来源:SiLabsC8051F320_LibUsb_PAER.java


注:本文中的org.usb4java.LibUsb.TRANSFER_TYPE_BULK属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。