Package it.freedomotic.events

Examples of it.freedomotic.events.ProtocolRead.addProperty()


                if (status.equalsIgnoreCase("0")) {
                    event.addProperty("isOn", "false");
                } else {
                    event.addProperty("isOn", "true");
                }
                event.addProperty("analog.input.value", status);
            }

        }
        //publish the event on the messaging bus
        this.notifyEvent(event);
View Full Code Here


    }
    // }

    private void sendEvent(String objectAddress, String eventProperty, String eventValue, String objectTemplate) {
        ProtocolRead event = new ProtocolRead(this, "tcw122bcm", objectAddress);
        event.addProperty(eventProperty, eventValue);
        //publish the event on the messaging bus
        this.notifyEvent(event);
    }

    // this method sends a Freedomotic event only if there is any change in input values or relays
View Full Code Here

    protected void onRun() {
    }

    public void sendEvent(String objectAddress, String eventProperty, String eventValue) {
        ProtocolRead event = new ProtocolRead(this, "arduino-remote-controller", objectAddress);
        event.addProperty("button.pressed", eventValue);
        //publish the event on the messaging bus
        this.notifyEvent(event);
        System.out.println("Sending event : " + event.toString())// FOR DEBUG USE
    }
View Full Code Here

            String output = usb.send(serialCommand);
            System.out.println("Output from serial: " + output);
            if (output.contains("XXX")) //TV is off
            {
                event = new ProtocolRead(this, "pioneer-kuro", "pioneer-kuro");
                event.addProperty("hardware-behavior", "POWER");
                event.addProperty("power-value", "false");
                this.notifyEvent(event);
            } else if (!output.contains("ERR")) {
                event = new ProtocolRead(this, "pioneer-kuro", "pioneer-kuro");
                event.addProperty("hardware-behavior", "POWER");
View Full Code Here

            System.out.println("Output from serial: " + output);
            if (output.contains("XXX")) //TV is off
            {
                event = new ProtocolRead(this, "pioneer-kuro", "pioneer-kuro");
                event.addProperty("hardware-behavior", "POWER");
                event.addProperty("power-value", "false");
                this.notifyEvent(event);
            } else if (!output.contains("ERR")) {
                event = new ProtocolRead(this, "pioneer-kuro", "pioneer-kuro");
                event.addProperty("hardware-behavior", "POWER");
                event.addProperty("power-value", "true");
View Full Code Here

                event.addProperty("hardware-behavior", "POWER");
                event.addProperty("power-value", "false");
                this.notifyEvent(event);
            } else if (!output.contains("ERR")) {
                event = new ProtocolRead(this, "pioneer-kuro", "pioneer-kuro");
                event.addProperty("hardware-behavior", "POWER");
                event.addProperty("power-value", "true");
                this.notifyEvent(event);
                String value = output.substring(4, 6);
                if (value.equals("81")) {
                    //analog
View Full Code Here

                event.addProperty("power-value", "false");
                this.notifyEvent(event);
            } else if (!output.contains("ERR")) {
                event = new ProtocolRead(this, "pioneer-kuro", "pioneer-kuro");
                event.addProperty("hardware-behavior", "POWER");
                event.addProperty("power-value", "true");
                this.notifyEvent(event);
                String value = output.substring(4, 6);
                if (value.equals("81")) {
                    //analog
                } else if (value.equals("83")) {//terrestrial
View Full Code Here

                    //analog
                } else if (value.equals("83")) {//terrestrial
                } else if (value.equals("84")) {//Digital
                } else {
                    event = new ProtocolRead(this, "pioneer-kuro", "pioneer-kuro");
                    event.addProperty("hardware-behavior", "INP");
                    event.addProperty("input-value", value);
                    this.notifyEvent(event);
                }
            }
            return OK;
View Full Code Here

                } else if (value.equals("83")) {//terrestrial
                } else if (value.equals("84")) {//Digital
                } else {
                    event = new ProtocolRead(this, "pioneer-kuro", "pioneer-kuro");
                    event.addProperty("hardware-behavior", "INP");
                    event.addProperty("input-value", value);
                    this.notifyEvent(event);
                }
            }
            return OK;
View Full Code Here

            if (output.contains(command)) {
                String behavior = command;
                String value = output.substring(6 - numChars, 6);
                event = new ProtocolRead(this, "pioneer-kuro", "pioneer-kuro");
                event.addProperty("hardware-behavior", behavior);
                event.addProperty(eventPropertyName, value);
                this.notifyEvent(event);
                return OK;
            } else if (output.contains("ERR") || output.contains("XXX")) {
                return ERR;
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.