Examples of ZWaveNetworkEvent


Examples of org.openhab.binding.zwave.internal.protocol.event.ZWaveNetworkEvent

        logger.error("NODE {}: Unable to remove failed node as it is not a failed node!", nodeId);
        transactionComplete = true;
        break;
      case FAILED_NODE_REMOVED:
        logger.debug("NODE {}: Successfully removed node from controller database!", nodeId);
        zController.notifyEventListeners(new ZWaveNetworkEvent(Type.DeleteNode, nodeId, State.Success));
        transactionComplete = true;
        break;
      case FAILED_NODE_NOT_REMOVED:
        logger.error("NODE {}: Unable to remove failed node!", nodeId);
        transactionComplete = true;
View Full Code Here

Examples of org.openhab.binding.zwave.internal.protocol.event.ZWaveNetworkEvent

        logger.debug("NODE {}: All association groups acquired.", this.getNode().getNodeId());

        updateAssociationsNode = 0;
       
        // This is used for network management, so send a network event
        this.getController().notifyEventListeners(new ZWaveNetworkEvent(ZWaveNetworkEvent.Type.AssociationUpdate, this.getNode().getNodeId(),
            ZWaveNetworkEvent.State.Success));
      }
      return;
    }

    logger.debug("NODE {}: association group {} has max associations " + maxAssociations, this.getNode()
        .getNodeId(), group);

    // Are we waiting to synchronise the start of a new group?
    if(pendingAssociation == null) {
      pendingAssociation = new AssociationGroup(group);
    }

    if (serialMessage.getMessagePayload().length > (offset + 4)) {
      logger.debug("NODE {}: association group {} includes the following nodes:", this.getNode().getNodeId(),
          group);
      int numAssociations = serialMessage.getMessagePayload().length - (offset + 4);
      for (int cnt = 0; cnt < numAssociations; cnt++) {
        int node = serialMessage.getMessagePayloadByte(offset + 4 + cnt);
        logger.debug("Node {}", node);

        // Add the node to the group
        pendingAssociation.addNode(node);
      }
    }

    // If this is the end of the group, update the list then let the listeners know
    if(following == 0) {
      // Clear the current information for this group
      configAssociations.remove(group);

      // Update the group in the list
      configAssociations.put(group, pendingAssociation);
      pendingAssociation = null;

      // Send an event to the users
      ZWaveAssociationEvent zEvent = new ZWaveAssociationEvent(this.getNode().getNodeId(), group);
      List<Integer> members = getGroupMembers(group);
      if(members != null) {
        for(int node : members) {
          zEvent.addMember(node);
        }
      }
      this.getController().notifyEventListeners(zEvent);     
    }

    // Is this the end of the list
    if (following == 0 && group == updateAssociationsNode) {
      // This is the end of this group and the current 'get all groups' node
      // so we need to request the next group
      if(updateAssociationsNode < maxGroups){
        updateAssociationsNode++;
        SerialMessage outputMessage = getAssociationMessage(updateAssociationsNode);
        if(outputMessage != null)
          this.getController().sendData(outputMessage);
      } else {
        logger.debug("NODE {}: All association groups acquired.", this.getNode().getNodeId());
        //we have reached our maxNodes, notify listeners we are done.
        updateAssociationsNode = 0;
        // This is used for network management, so send a network event
        this.getController().notifyEventListeners(new ZWaveNetworkEvent(ZWaveNetworkEvent.Type.AssociationUpdate, this.getNode().getNodeId(),
            ZWaveNetworkEvent.State.Success));
      }
    }
  }
View Full Code Here

Examples of org.openhab.binding.zwave.internal.protocol.event.ZWaveNetworkEvent

   */
  @Override
  public void ZWaveIncomingEvent(ZWaveEvent event) {
    // Handle network events
    if (event instanceof ZWaveNetworkEvent) {
      ZWaveNetworkEvent nwEvent = (ZWaveNetworkEvent) event;
      logger.debug("NODE {}: Network heal EVENT", nwEvent.getNodeId());

      // Get the heal class for this notification
      HealNode node = healNodes.get(nwEvent.getNodeId());
      if (node == null)
        return;

      // Is this the event we're waiting for
      if (nwEvent.getEvent() != node.event)
        return;

      switch (nwEvent.getState()) {
      case Success:
        node.retryCnt = 0;
        node.state = node.stateNext;
        break;
      case Failure:
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.