Examples of USBDataPipe


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

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

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