Package org.jnode.driver.bus.scsi

Examples of org.jnode.driver.bus.scsi.CDB


        }
    }

    private void setMediaRemoval(boolean prevent, boolean persistent)
        throws SCSIException, TimeoutException, InterruptedException {
        final CDB cdb = new CDBMediaRemoval(prevent, persistent);
        api.executeCommand(cdb, null, 0, 5000);
    }
View Full Code Here


    }

    public SenseData requestSense() throws SCSIException,
        TimeoutException, InterruptedException {
        final byte[] data = new byte[256];
        final CDB cdb = new CDBRequestSense(data.length);
        api.executeCommand(cdb, data, 0, 5000);
        return new SenseData(data);
    }
View Full Code Here

        return new SenseData(data);
    }

    private CapacityData readCapacity() throws SCSIException, TimeoutException,
        InterruptedException {
        final CDB cdb = new CDBReadCapacity();
        api.executeCommand(cdb, data, 0, 5000);
        CapacityData rc = new CapacityData(data);
        System.out.println("ReadCapacity " + rc);
        return rc;
    }
View Full Code Here

    }

    private void readBlocks(CapacityData cap, int lba, int nrBlocks)
        throws SCSIException, TimeoutException, InterruptedException {
        final byte[] data = new byte[nrBlocks * cap.getBlockLength()];
        final CDB cdb = new CDBRead10(lba, nrBlocks);
        final int len = api.executeCommand(cdb, data, 0, 5000);
        System.out.println("Read " + NumberUtils.hex(data, 0, len));
    }
View Full Code Here

    }

    private void reportLuns() throws SCSIException, TimeoutException,
        InterruptedException {
        final byte[] data = new byte[4096];
        final CDB cdb = new CDBReportLuns(data.length);
        final int len = api.executeCommand(cdb, data, 0, 5000);
        System.out.println("ReportLuns" + NumberUtils.hex(data, 0, len));
    }
View Full Code Here

    }

    private void getConfig() throws SCSIException, TimeoutException,
        InterruptedException {
        final byte[] data = new byte[4096];
        final CDB cdb = new CDBGetConfiguration(0, 0);
        final int len = api.executeCommand(cdb, data, 0, 5000);
        System.out.println("GetConfig " + NumberUtils.hex(data, 0, len));
    }
View Full Code Here

     * @return the capacity
     */
    public static CapacityData readCapacity(SCSIDevice dev)
        throws SCSIException, TimeoutException, InterruptedException {
        final byte[] data = new byte[CapacityData.DEFAULT_LENGTH];
        final CDB cdb = new CDBReadCapacity();
        dev.executeCommand(cdb, data, 0, SCSIConstants.GROUP1_TIMEOUT);
        return new CapacityData(data);
    }
View Full Code Here

     * @throws InterruptedException
     */
    public static void readData(SCSIDevice dev, int lba, int nrBlocks,
                                byte[] data, int dataOffset) throws SCSIException,
        TimeoutException, InterruptedException {
        final CDB cdb = new CDBRead10(lba, nrBlocks);
        dev.executeCommand(cdb, data, dataOffset, SCSIConstants.GROUP1_TIMEOUT);
    }
View Full Code Here

     * @throws InterruptedException
     */
    public static void setMediaRemoval(SCSIDevice dev, boolean prevent,
                                       boolean persistent) throws SCSIException, TimeoutException,
        InterruptedException {
        final CDB cdb = new CDBMediaRemoval(prevent, persistent);
        dev.executeCommand(cdb, null, 0, SCSIConstants.GROUP1_TIMEOUT);
    }
View Full Code Here

     * @throws InterruptedException
     */
    public static void startStopUnit(SCSIDevice dev,
                                     CDBStartStopUnit.Action action, boolean returnASAP)
        throws SCSIException, TimeoutException, InterruptedException {
        final CDB cdb = new CDBStartStopUnit(action, returnASAP);
        dev.executeCommand(cdb, null, 0, SCSIConstants.GROUP1_TIMEOUT);
    }
View Full Code Here

TOP

Related Classes of org.jnode.driver.bus.scsi.CDB

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.