private ApplicationCommandHandler ( byte rawMessage ) : bool | ||
rawMessage | byte | |
return | bool |
private void ZWave_NodeUpdated(object sender, NodeEvent eventData) { ZWaveNode node = (ZWaveNode)sender; if (eventData.Parameter == EventParameter.SecurityDecriptedMessage && eventData.Value is byte[]) { node.ApplicationCommandHandler((byte[])eventData.Value); return; } else if (eventData.Parameter == EventParameter.SecurityNodeInformationFrame) { node.SecuredNodeInformationFrame = (byte[])eventData.Value; // we take them one a a time to make sure we keep the list with unique elements foreach (byte nodeInfo in node.SecuredNodeInformationFrame) { // if we found the COMMAND_CLASS_MARK we get out of the for loop if (nodeInfo == (byte)0xEF) { break; } node.NodeInformationFrame = Utility.AppendByteToArray(node.NodeInformationFrame, nodeInfo); } // we just send other events and save the node data NodeInformationFrameDone(node); } // Route node event OnNodeUpdated(new NodeUpdatedEventArgs(eventData.Node.Id, eventData)); }
private void znode_ParameterChanged(object sender, ZWaveEvent eventData) { if (sender is ZWaveNode) { ZWaveNode node = (ZWaveNode)sender; if (eventData.Parameter == EventParameter.SecurityDecriptedMessage && eventData.Value is byte[]) { node.ApplicationCommandHandler((byte[])eventData.Value); return; } else if (eventData.Parameter == EventParameter.SecurityGeneratedKey && eventData.Value is int) { SaveNodesConfig(); return; } else if (eventData.Parameter == EventParameter.SecurityNodeInformationFrame) { node.SecuredNodeInformationFrame = (byte[])eventData.Value; // we take them one a a time to make sure we keep the list with unique elements foreach (byte nodeInfo in node.SecuredNodeInformationFrame) { // if we found the COMMAND_CLASS_MARK we get out of the for loop if (nodeInfo == (byte)0xEF) { break; } node.NodeInformationFrame = Utility.AppendByteToArray(node.NodeInformationFrame, nodeInfo); } // we just send other events and save the node data NodeInformationFrameComplete(node); } } // Route node event RaiseUpdateParameterEvent(eventData); }