Examples of USBInterface


Examples of javax.usb.UsbInterface

    }
   
    public void run() {
      UsbConfiguration usbConfiguration = device.getUsbConfiguration((byte) 1);
      UsbInterface usbInterface = usbConfiguration.getUsbInterface((byte) 0);
     
      UsbEndpoint endpoint = usbInterface.getUsbEndpoint(NiaDevice2.ENDPOINT_IN);
      UsbPipe usbPipe = endpoint.getUsbPipe();
     
      try {
        usbPipe.open();
      } catch (UsbException e) {
View Full Code Here

Examples of javax.usb.UsbInterface

    {
      throw new CM19AException("No active configuration found");
    }

    /* Get the first interface, there should only be one */
    UsbInterface usbInterface = (UsbInterface) config.getUsbInterfaces().get(0);

    logger.debug("Got device; Manufacturer is " + cm19a.getManufacturerString());
    logger.debug("Got interface; Active is " + usbInterface.isActive() + " Claimed is " + usbInterface.isClaimed());

    try
    {
      usbInterface.claim();
      logger.debug("Interface has been claimed");
    }
    catch (UsbException ue)
    {
      throw new CM19AException("Couldn't claim interface. " + "Message is " + ue.getMessage());
View Full Code Here

Examples of org.jnode.driver.bus.usb.USBInterface

        final USBDevice dev = (USBDevice) device;
        if (dev.getDescriptor().getDeviceClass() != USB_CLASS_PER_INTERFACE) {
            return null;
        }
        final USBConfiguration conf = dev.getConfiguration(0);
        final USBInterface intf = conf.getInterface(0);
        final InterfaceDescriptor descr = intf.getDescriptor();
        if (descr.getInterfaceClass() != USB_CLASS_MASS_STORAGE) {
            return null;
        }
        log.debug("Found mass storage: " + descr);
        switch (descr.getInterfaceSubClass()) {
View Full Code Here

Examples of org.jnode.driver.bus.usb.USBInterface

        UsbBluetoothDevice UsbBtDevice = new UsbBluetoothDevice();

        final USBDevice dev = (USBDevice) getDevice();
        UsbBtDevice.setUsbDevice(dev);
        final USBConfiguration conf = dev.getConfiguration(0);
        final USBInterface intf = conf.getInterface(0);
        final InterfaceDescriptor iDesc = intf.getDescriptor();

        USBEndPoint bulkInEndpoint[] = new USBEndPoint[8];
        USBEndPoint bulkOutEndpoint[] = new USBEndPoint[8];
        USBEndPoint intrInEndpoint[] = new USBEndPoint[8];

        int num_bulk_in = 0;
        int num_bulk_out = 0;
        int num_bulk_intr = 0;

        USBEndPoint ep = null;

        for (int i = 0; i < iDesc.getNumEndPoints(); i++) {
            ep = intf.getEndPoint(i);
            // Is it a bulk endpoint ?
            if ((ep.getDescriptor().getAttributes() & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK) {
                // In or Out ?
                if ((ep.getDescriptor().getEndPointAddress() & USB_DIR_IN) == 0) {
                    bulkInEndpoint[num_bulk_in] = ep;
View Full Code Here

Examples of org.jnode.driver.bus.usb.USBInterface

        if (!(device instanceof USBDevice)) {
            return null;
        }
        final USBDevice dev = (USBDevice) device;
        final USBConfiguration conf = dev.getConfiguration(0);
        final USBInterface intf = conf.getInterface(0);
        final InterfaceDescriptor descr = intf.getDescriptor();
        if (descr.getInterfaceClass() != USB_CLASS_WIRELESS) {
            return null;
        }
        log.debug("Found USB wireless device.");
        if (descr.getInterfaceSubClass() == US_SC_RF) {
View Full Code Here

Examples of org.jnode.driver.bus.usb.USBInterface

        if (device instanceof USBDevice) {
            final USBDevice dev = (USBDevice) device;
            if (dev.getDescriptor().getDeviceClass() == USB_CLASS_PER_INTERFACE) {

                final USBConfiguration conf = dev.getConfiguration(0);
                final USBInterface intf = conf.getInterface(0);
                final InterfaceDescriptor descr = intf.getDescriptor();

                if (descr.getInterfaceClass() == USB_CLASS_HID) {
                    if (descr.getInterfaceSubClass() == HID_SUBCLASS_BOOT_INTERFACE) {
                        switch (descr.getInterfaceProtocol()) {
                            case HID_PROTOCOL_KEYBOARD:
View Full Code Here

Examples of org.jnode.driver.bus.usb.USBInterface

    protected void startDevice() throws DriverException {
        try {
            final USBDevice dev = (USBDevice) getDevice();
            final USBConfiguration conf = dev.getConfiguration(0);
            // dev.setConfiguration(conf);
            final USBInterface intf = conf.getInterface(0);
            this.ep = null;
            for (int i = 0; i < intf.getDescriptor().getNumEndPoints(); i++) {
                ep = intf.getEndPoint(i);
                if (((ep.getDescriptor().getAttributes() & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) &&
                        ((ep.getDescriptor().getEndPointAddress() & USB_DIR_IN) == 0))
                    break;
            }
            if (this.ep == null)
View Full Code Here

Examples of org.jnode.driver.bus.usb.USBInterface

        try {
            final USBDevice dev = (USBDevice) getDevice();

            // Get active configuration
            final USBConfiguration conf = dev.getConfiguration();
            final USBInterface intf = conf.getInterface(0);
            this.ep = null;
            for (int i = 0; i < intf.getDescriptor().getNumEndPoints(); i++) {
                ep = intf.getEndPoint(i);
                if (((ep.getDescriptor().getAttributes() & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) &&
                        ((ep.getDescriptor().getEndPointAddress() & USB_DIR_IN) == 0))
                    break;
            }
            if (this.ep == null)
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.