Examples of USBControlPipe


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

    /**
     * Bulk-Only mass storage reset.
     */
    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);
    }
View Full Code Here

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

     * @param usbDev
     * @throws USBException
     */
    public void getMaxLun(USBDevice usbDev) throws USBException {
        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

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

    public void setIntrInEndpoint(USBEndPoint intrInEndpoint) {
        this.intrInEndpoint = intrInEndpoint;
    }

    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);
    }
View Full Code Here

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

    /**
     * Read the status of a given port into the given structure.
     */
    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.