Package it.freedomotic.events

Examples of it.freedomotic.events.ProtocolRead


    }

    private void sendPoints(UsageDataFrame df, Command c) {
        // find command sender (in order to reply)
        // create response, filling data from List
        ProtocolRead ev = new ProtocolRead(this, "harvester", c.getProperty("QueryAddress"));
        //EventTemplate ev = new EventTemplate(c);
        ObjectMapper om = new ObjectMapper();
        //om.setVisibility(JsonMethod.FIELD, Visibility.ANY);
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        try {
            om.writeValue(os, df);
            ev.addProperty("behaviorValue", os.toString());

            Freedomotic.sendEvent(ev);
        } catch (Exception ex) {
            LOG.severe(ex.getLocalizedMessage());
        }
View Full Code Here


//            Freedomotic.logger.info("Sending Modbus Generic read event: '" + event.toString() + " with value: "+ event.getProperty("value"));
//            notifyEvent(event); //sends the event on the messaging bus

            //use of Protocol Reads

            ProtocolRead protocolEvent = new ProtocolRead(this, "Modbus", point.getName());
            point.fillProtocolEvent(results, protocolEvent);
            LOG.info("Sending Modbus protocol read event for eventName name: " + point.getName() + " value: " + protocolEvent.getProperty("behaviorValue"));
            Freedomotic.sendEvent(protocolEvent);
        }
    }
View Full Code Here

        }
    }

// this method sends a freedomotic event every time a relay status changes
    private void sendEvent(String objectAddress, String eventProperty, String eventValue) {
        ProtocolRead event = new ProtocolRead(this, "usb4relaybrd", objectAddress);
        event.addProperty(eventProperty, eventValue);
        event.addProperty("object.class", "Light");
        event.addProperty("object.name", objectAddress);
        //publish the event on the messaging bus
        this.notifyEvent(event);
    }
View Full Code Here

TOP

Related Classes of it.freedomotic.events.ProtocolRead

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.