Package org.jnode.driver.bus.usb

Examples of org.jnode.driver.bus.usb.USBControlPipe.syncSubmit()


     */
    public void reset() throws USBException {
        final USBControlPipe pipe = storageDeviceData.getDevice().getDefaultControlPipe();
        final USBRequest req = pipe.createRequest(new SetupPacket(USB_DIR_OUT
            | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 0xFF, 0, 0, 0), null);
        pipe.syncSubmit(req, GET_TIMEOUT);
    }

    /**
     * Get max logical unit allowed by device. Device not support multiple LUN <i>may</i> stall.
     *
 
View Full Code Here


        log.info("*** Get max lun ***");
        final USBControlPipe pipe = usbDev.getDefaultControlPipe();
        final USBPacket packet = new USBPacket(1);
        final USBRequest req = pipe.createRequest(new SetupPacket(USB_DIR_IN
            | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 0xFE, 0, 0, 1), packet);
        pipe.syncSubmit(req, GET_TIMEOUT);
        log.debug("*** Request data     : " + req.toString());
        log.debug("*** Request status   : 0x" + NumberUtils.hex(req.getStatus(), 4));
        if (req.getStatus() == USBREQ_ST_COMPLETED) {
            storageDeviceData.setMaxLun(packet.getData()[0]);
        } else if (req.getStatus() == USBREQ_ST_STALLED) {
View Full Code Here

    public void testCommand() throws USBException {
        final USBControlPipe pipe = usbDevice.getDefaultControlPipe();
        final USBRequest req = pipe.createRequest(
                new SetupPacket(USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_DEVICE, 0x20, 0, 0, 0), null);
        pipe.syncSubmit(req, GET_TIMEOUT);
    }

    public USBDevice getUsbDevice() {
        return usbDevice;
    }
View Full Code Here

    private void readPortStatus(int port, PortStatus data) throws USBException {
        testPort(port);
        final USBControlPipe pipe = dev.getDefaultControlPipe();
        final USBRequest req =
            pipe.createRequest(new SetupPacket(USB_DIR_IN | USB_RT_PORT, USB_REQ_GET_STATUS, 0, port + 1, 4), data);
        pipe.syncSubmit(req, GET_TIMEOUT);
    }

}
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.