Package org.jnode.driver.bus.scsi

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


        try {
            unlock();
        } catch (IOException ex) {
            throw new DriverException(ex);
        } finally {
            final SCSIDevice dev = (SCSIDevice) getDevice();
            dev.unregisterAPI(RemovableDeviceAPI.class);
            dev.unregisterAPI(FSBlockDeviceAPI.class);
            dev.unregisterAPI(SCSIDeviceAPI.class);
        }

    }
View Full Code Here


     *
     * @throws IOException
     */
    public synchronized void unlock() throws IOException {
        if (!locked) {
            final SCSIDevice dev = (SCSIDevice) getDevice();
            try {
                MMCUtils.setMediaRemoval(dev, false, false);
            } catch (SCSIException ex) {
                final IOException ioe = new IOException();
                ioe.initCause(ex);
View Full Code Here

    protected void startDevice() throws DriverException {
        this.locked = false;
        this.changed = true;
        this.capacity = null;
        this.blockAlignment.setAlignment(2048);
        final SCSIDevice dev = (SCSIDevice) getDevice();
        dev.registerAPI(SCSIDeviceAPI.class, new SCSIDevice.SCSIDeviceAPIImpl(
            dev));
        dev.registerAPI(RemovableDeviceAPI.class, this);
        dev.registerAPI(FSBlockDeviceAPI.class, blockAlignment);
    }
View Full Code Here

        try {
            unlock();
        } catch (IOException ex) {
            throw new DriverException(ex);
        } finally {
            final SCSIDevice dev = (SCSIDevice) getDevice();
            dev.unregisterAPI(RemovableDeviceAPI.class);
            dev.unregisterAPI(FSBlockDeviceAPI.class);
            dev.unregisterAPI(SCSIDeviceAPI.class);
        }
    }
View Full Code Here

            throw new IOException("No medium");
        }
        final int blockLength = capacity.getBlockLength();
        final int lba = (int) (devOffset / blockLength);
        final int nrBlocks = length / blockLength;
        final SCSIDevice dev = (SCSIDevice) getDevice();
        try {
            MMCUtils.readData(dev, lba, nrBlocks, dest, destOffset);
        } catch (SCSIException ex) {
            final IOException ioe = new IOException();
            ioe.initCause(ex);
View Full Code Here

     *
     * @throws IOException
     */
    public synchronized void lock() throws IOException {
        if (!locked) {
            final SCSIDevice dev = (SCSIDevice) getDevice();
            try {
                MMCUtils.setMediaRemoval(dev, true, false);
            } catch (SCSIException ex) {
                final IOException ioe = new IOException();
                ioe.initCause(ex);
View Full Code Here

     *
     * @throws IOException
     */
    public synchronized void unlock() throws IOException {
        if (!locked) {
            final SCSIDevice dev = (SCSIDevice) getDevice();
            try {
                MMCUtils.setMediaRemoval(dev, false, false);
            } catch (SCSIException ex) {
                final IOException ioe = new IOException();
                ioe.initCause(ex);
View Full Code Here

     */
    public void eject() throws IOException {
        if (locked) {
            throw new IOException("Device is locked");
        }
        final SCSIDevice dev = (SCSIDevice) getDevice();
        try {
            MMCUtils.startStopUnit(dev, CDBStartStopUnit.Action.EJECT, false);
        } catch (SCSIException ex) {
            final IOException ioe = new IOException();
            ioe.initCause(ex);
View Full Code Here

     */
    public void load() throws IOException {
        if (locked) {
            throw new IOException("Device is locked");
        }
        final SCSIDevice dev = (SCSIDevice) getDevice();
        try {
            MMCUtils.startStopUnit(dev, CDBStartStopUnit.Action.LOAD, false);
        } catch (SCSIException ex) {
            final IOException ioe = new IOException();
            ioe.initCause(ex);
View Full Code Here

     * @throws IOException
     */
    private void processChanged() throws IOException {
        if (changed) {
            this.capacity = null;
            final SCSIDevice dev = (SCSIDevice) getDevice();
            try {
                // Gets the capacity.
                this.capacity = MMCUtils.readCapacity(dev);
                this.blockAlignment.setAlignment(capacity.getBlockLength());
            } catch (SCSIException ex) {
View Full Code Here

TOP

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

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.