public bool CanBeActivated(ZWaveMessage responseMessage)
        {
            if ((function == Empty || responseMessage.Function == function)
                && (commandClass == Empty || responseMessage.CommandClass == commandClass)
                && (command == Empty || responseMessage.Command == command))
            {
                return true;
            }

            return false;
        }
예제 #2
0
        public ZWaveJob(
            ZWaveFunction function,
            byte nodeId = 0x00,
            ZWaveCommandClass commandClass = 0x00,
            ZWaveCommand command = 0x00,
            byte[] parameters = null,
            ZWaveEventHandler eventHandler = null,
            int timeoutInterval = 10000,
            Action onCancel = null)
        {
            this.eventHandler = eventHandler;
            this.timeoutInterval = timeoutInterval;
            this.onCancel = onCancel;
            Request = new ZWaveMessage(ZWaveMessageType.Request, function, nodeId, commandClass, command);

            if (parameters != null)
            {
                foreach (var param in parameters)
                {
                    Request.AddParameter(param);
                }
            }
        }
예제 #3
0
 public virtual bool CanBeActivated(ZWaveMessage response)
 {
     return (eventHandler == null || eventHandler.CanBeActivated(response));
 }
예제 #4
0
        public virtual void Activate(ZWaveMessage response)
        {
            Done();

            if (eventHandler != null)
            {
                Response = response;
                eventHandler.Activate(response);
            }
        }
 public void Activate(ZWaveMessage responseMessage)
 {
     handler(responseMessage);
 }