Package ch.ntb.inf.libusbJava.testApp

Examples of ch.ntb.inf.libusbJava.testApp.TestDevice


                outEPs[nofOutEPs++] = endpoints[i];
              }
            }
          }
          // create a new TestDevice
          TestDevice testDevice = new TestDevice();
          testDevice.setIdProduct(productId);
          testDevice.setIdVendor(vendorId);
          testDevice.setAltinterface(altinterface);
          testDevice.setConfiguration(configuration);
          testDevice.setInterface(interface_);
          if (inEPs != null) {
            for (int i = 0; i < nofInEPs; i++) {
              int type = inEPs[i].getBmAttributes() & 0x03;
              switch (type) {
              case Usb_Endpoint_Descriptor.USB_ENDPOINT_TRANSFER_TYPE_BULK:
                testDevice.setInEPBulk(inEPs[i]
                    .getBEndpointAddress() & 0xff);
                testDevice.setInMode(TransferMode.Bulk);
                break;
              case Usb_Endpoint_Descriptor.USB_ENDPOINT_TRANSFER_TYPE_INTERRUPT:
                testDevice.setInEPInt(inEPs[i]
                    .getBEndpointAddress() & 0xff);
                testDevice.setInMode(TransferMode.Interrupt);
                break;
              default:
                break;
              }
            }
          }
          if (outEPs != null) {
            for (int i = 0; i < nofOutEPs; i++) {
              int type = outEPs[i].getBmAttributes() & 0x03;
              switch (type) {
              case Usb_Endpoint_Descriptor.USB_ENDPOINT_TRANSFER_TYPE_BULK:
                testDevice.setOutEPBulk(outEPs[i]
                    .getBEndpointAddress() & 0xff);
                testDevice.setOutMode(TransferMode.Bulk);
                break;
              case Usb_Endpoint_Descriptor.USB_ENDPOINT_TRANSFER_TYPE_INTERRUPT:
                testDevice.setOutEPInt(outEPs[i]
                    .getBEndpointAddress() & 0xff);
                testDevice.setOutMode(TransferMode.Interrupt);
                break;
              default:
                break;
              }
            }
View Full Code Here

TOP

Related Classes of ch.ntb.inf.libusbJava.testApp.TestDevice

Copyright © 2018 www.massapicom. 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.