Package org.jnode.driver.bus.usb

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


            USBDevice usbDevice = (USBDevice) getDevice();
            USBConfiguration conf = usbDevice.getConfiguration(0);
            usbDevice.setConfiguration(conf);
            // Set usb mass storage informations.
            this.storageDeviceData = new USBStorageDeviceData(usbDevice);
            USBDataPipe pipe;
            pipe = (USBDataPipe) this.storageDeviceData.getBulkOutEndPoint().getPipe();
            pipe.addListener(this);
            pipe.open();

            pipe = (USBDataPipe) this.storageDeviceData.getBulkInEndPoint().getPipe();
            pipe.addListener(this);
            pipe.open();

            usbDevice.registerAPI(SCSIHostControllerAPI.class, this);
            final Bus hostBus = new USBStorageSCSIHostBus(getDevice());
            scsiDevice = new USBStorageSCSIDevice(hostBus, "_sg");
View Full Code Here


            cbw.setLun((byte) 0);
            cbw.setLength((byte) scsiCmd.length);
            cbw.setCdb(scsiCmd);
            log.debug(cbw.toString());
            // Sent CBW to device
            USBDataPipe outPipe = ((USBDataPipe) storageDeviceData.getBulkOutEndPoint().getPipe());
            USBRequest req = outPipe.createRequest(cbw);
            if (timeout <= 0) {
                outPipe.asyncSubmit(req);
            } else {
                outPipe.syncSubmit(req, timeout);
            }
            //
            CSW csw = new CSW();
            csw.setSignature(US_BULK_CS_SIGN);
            USBDataPipe inPipe = ((USBDataPipe) storageDeviceData.getBulkInEndPoint().getPipe());
            USBRequest resp = inPipe.createRequest(csw);
            if (timeout <= 0) {
                inPipe.asyncSubmit(resp);
            } else {
                inPipe.syncSubmit(resp, timeout);
            }
        } catch (USBException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

TOP

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

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.