Package com.jpeterson.x10.event

Examples of com.jpeterson.x10.event.OnEvent


                throw new CruiseControlException("Trouble transmitting event " + events[ j ], e);
            }
        }

        if (transmitter instanceof Gateway) {
            Gateway gateway = (Gateway) transmitter;

            try {
                LOG.debug("Wait for empty queue...");
                gateway.waitGatewayState(Transmitter.QUEUE_EMPTY);
                LOG.debug("Done");
            } catch (InterruptedException e) {
            }

            LOG.debug("Deallocating...");
            try {
                gateway.deallocate();
            } catch (GatewayException e) {
                LOG.warn("Error deallocation gateway: " + e.getMessage(), e);
            }
            LOG.debug("Done");
        }
View Full Code Here


    }

    private void send(X10Event[] events) throws CruiseControlException {
        LOG.info("Sending X10 events...");
        Transmitter transmitter = getTransmitter();
        if (port != null) {
            ((SerialGateway) transmitter).setPortName(port);
        }
        try {
            ((Gateway) transmitter).allocate();
        } catch (Exception e) {
            throw new CruiseControlException("Trouble allocating the x10 gateway.", e);
        }

        for (int j = 0; j < events.length; j++) {
            LOG.debug("Transmitting: " + events[ j ]);
            try {
                transmitter.transmit(events[ j ]);
            } catch (IOException e) {
                throw new CruiseControlException("Trouble transmitting event " + events[ j ], e);
            }
        }
View Full Code Here

    public void turnOn() throws CruiseControlException {
        final char houseCodeChar = houseCode.charAt(0);
        final int deviceCodeInt = Integer.valueOf(deviceCode).intValue();

        X10Event[] events = new X10Event[ 2 ];
        events[ 0 ] = new AddressEvent(this, houseCodeChar, deviceCodeInt);
        events[ 1 ] = new OnEvent(this, houseCodeChar);

        send(events);
    }
View Full Code Here

    public void turnOff() throws CruiseControlException {
        final char houseCodeChar = houseCode.charAt(0);
        final int deviceCodeInt = Integer.valueOf(deviceCode).intValue();

        X10Event[] events = new X10Event[ 2 ];
        events[ 0 ] = new AddressEvent(this, houseCodeChar, deviceCodeInt);
        events[ 1 ] = new OffEvent(this, houseCodeChar);

        send(events);

    }
View Full Code Here

        final char houseCodeChar = houseCode.charAt(0);
        final int deviceCodeInt = Integer.valueOf(deviceCode).intValue();

        X10Event[] events = new X10Event[ 2 ];
        events[ 0 ] = new AddressEvent(this, houseCodeChar, deviceCodeInt);
        events[ 1 ] = new OffEvent(this, houseCodeChar);

        send(events);

    }
View Full Code Here

        final char houseCodeChar = houseCode.charAt(0);
        final int deviceCodeInt = Integer.valueOf(deviceCode).intValue();

        X10Event[] events = new X10Event[ 2 ];
        events[ 0 ] = new AddressEvent(this, houseCodeChar, deviceCodeInt);
        events[ 1 ] = new OnEvent(this, houseCodeChar);

        send(events);
    }
View Full Code Here

    protected Transmitter getTransmitter() throws CruiseControlException {
        if (interfaceModel != null && interfaceModel.equalsIgnoreCase("CM17A")) {
            return new CM17A();
        } else if (interfaceModel == null || interfaceModel.equals("") || interfaceModel.equalsIgnoreCase("CM11A")) {
            return new CM11A();
        } else {
            throw new CruiseControlException("Unknown interface model specified [" + interfaceModel + "].");
        }
    }
View Full Code Here

        LOG.debug("Done sending X10 events...");
    }

    protected Transmitter getTransmitter() throws CruiseControlException {
        if (interfaceModel != null && interfaceModel.equalsIgnoreCase("CM17A")) {
            return new CM17A();
        } else if (interfaceModel == null || interfaceModel.equals("") || interfaceModel.equalsIgnoreCase("CM11A")) {
            return new CM11A();
        } else {
            throw new CruiseControlException("Unknown interface model specified [" + interfaceModel + "].");
        }
View Full Code Here

TOP

Related Classes of com.jpeterson.x10.event.OnEvent

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.