Examples of ProcessCommunicator


Examples of tuwien.auto.calimero.process.ProcessCommunicator

  }

  private void writeToKNX(String itemName, Type value) {
    Iterable<Datapoint> datapoints = getDatapoints(itemName, value.getClass());
    if (datapoints != null) {
      ProcessCommunicator pc = KNXConnection.getCommunicator();
      if (pc != null) {
        for (Datapoint datapoint : datapoints) {
          try {
            pc.write(datapoint, toDPTValue(value, datapoint.getDPT()));
            logger.debug("Wrote value '{}' to datapoint '{}'", value, datapoint);
          } catch (KNXException e) {
            logger.warn("Value '{}' could not be sent to the KNX bus using datapoint '{}' - retrying one time: {}",
                new Object[]{value, datapoint, e.getMessage()});
            try {
              // do a second try, maybe the reconnection was successful
              pc = KNXConnection.getCommunicator();
              pc.write(datapoint, toDPTValue(value, datapoint.getDPT()));
              logger.debug("Wrote value '{}' to datapoint '{}' on second try", value, datapoint);
            } catch (KNXException e1) {
              logger.error("Value '{}' could not be sent to the KNX bus using datapoint '{}' - giving up after second try: {}",
                new Object[]{value, datapoint, e1.getMessage()});
            }
View Full Code Here

Examples of tuwien.auto.calimero.process.ProcessCommunicator

    }

    private void initializeDatapoints(HashMap<Datapoint,Integer> clonedMap) {
      for (Datapoint datapoint : clonedMap.keySet()) {
        try {
          ProcessCommunicator pc = KNXConnection.getCommunicator();
          if (pc != null) {
            logger.debug("Sending read request to KNX for item {}", datapoint.getName());
            pc.read(datapoint);
            logger.debug("Removing item {} from initialization queue", datapoint.getName());
            datapointsToInitialize.remove(datapoint);
          }
        } catch (KNXException e) {
          logger.warn("Cannot read value for item '{}' from KNX bus: {}", new Object[] { datapoint.getName(), e.getMessage() });
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.