Package de.elv.usi

Examples of de.elv.usi.USIException


            logger.fine("Read: " + message); //$NON-NLS-1$
        } catch (Exception e) {
            if (e instanceof USIException)
                throw (USIException) e;

            throw new USIException(
                    MessageHandler.class, "handleResponse.error.readMessage", e); //$NON-NLS-1$
        }

        if (!message.isAcknowledge()) {
            throw new USIException(
                    MessageHandler.class, "handleResponse.error.reject"); //$NON-NLS-1$
        }

        return message;
    }
View Full Code Here


            readBuffer[numBytesRead] = (byte) (readByte & 0xFF);
            numBytesRead++;
        } while (readByte != ControlCharacter.ETX.byteValue);

        if (numBytesRead <= 0)
            throw new USIException(
                    MessageHandler.class, "readMessage.error.nothingRead"); //$NON-NLS-1$

        if (logger.isLoggable(Level.FINE))
            logger
                    .fine(Localizer
View Full Code Here

            OutputID id, boolean on) throws USIException {

        try {
            writeMessage(device, new OutputConfiguration(id, on));
        } catch (FTD2xxException e) {
            throw new USIException(
                    MessageHandler.class, "writeOutputConfiguration.error.write", e); //$NON-NLS-1$
        }

        handleResponse(device);
    }
View Full Code Here

            throws USIException {

        try {
            writeMessage(device, new SpeedConfiguration(speedValue));
        } catch (FTD2xxException e) {
            throw new USIException(
                    MessageHandler.class, "writeSpeed.error.write", e); //$NON-NLS-1$
        }

        handleResponse(device);
    }
View Full Code Here

            throws USIException {

        try {
            writeMessage(device, new StartMotors());
        } catch (FTD2xxException e) {
            throw new USIException(
                    MessageHandler.class, "writeStart.error.write", e); //$NON-NLS-1$
        }

        handleResponse(device); // process ACK / NACK
        return handleResponse(device); // process motor switch positions
View Full Code Here

        try {
            writeMessage(device, motorConfiguration);
            handleResponse(device);
        } catch (FTD2xxException e) {
            throw new USIException(
                    MessageHandler.class, "writeMotorConfiguration.error.write", e); //$NON-NLS-1$
        }
    }
View Full Code Here

            throws USIException {

        try {
            writeMessage(device, holdingCurrentConfiguration);
        } catch (FTD2xxException e) {
            throw new USIException(
                    MessageHandler.class, "setHoldingCurrent.error.write", e); //$NON-NLS-1$
        }

        /*
         * Due to a protocol inconsistency of the USI hardware there is no
View Full Code Here

            logger.fine("Read: " + message); //$NON-NLS-1$
        } catch (Exception e) {
            if (e instanceof USIException)
                throw (USIException) e;

            throw new USIException(
                    getLocalizedMessage("handleResponse.error.readMessage"), e); //$NON-NLS-1$
        }

        if (!message.isAcknowledge()) {
            throw new USIException(
                    getLocalizedMessage("handleResponse.error.reject")); //$NON-NLS-1$
        }

        return message;
    }
View Full Code Here

            readBuffer[numBytesRead] = (byte) (readByte & 0xFF);
            numBytesRead++;
        } while (readByte != ControlCharacter.ETX.byteValue);

        if (numBytesRead <= 0)
            throw new USIException(
                    getLocalizedMessage("readMessage.error.nothingRead")); //$NON-NLS-1$

        if (logger.isLoggable(Level.FINE))
            logger
                    .fine(Localizer
View Full Code Here

            OutputID id, boolean on) throws USIException {

        try {
            writeMessage(device, new OutputConfiguration(id, on));
        } catch (FTD2xxException e) {
            throw new USIException(
                    getLocalizedMessage("writeOutputConfiguration.error.write"), e); //$NON-NLS-1$
        }

        handleResponse(device);
    }
View Full Code Here

TOP

Related Classes of de.elv.usi.USIException

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.