Package org.jnode.driver.bus.usb

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


        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

        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

        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

    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

        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

Related Classes of org.jnode.driver.bus.usb.USBInterface

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.