当前位置: 首页>>代码示例>>C#>>正文


C# ZWaveNode类代码示例

本文整理汇总了C#中ZWaveNode的典型用法代码示例。如果您正苦于以下问题:C# ZWaveNode类的具体用法?C# ZWaveNode怎么用?C# ZWaveNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ZWaveNode类属于命名空间,在下文中一共展示了ZWaveNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetOperatingState

 public static void GetOperatingState(ZWaveNode node)
 {
     node.SendRequest(new byte[] {
         (byte)CommandClass.ThermostatOperatingState,
         (byte)Command.BasicGet
     });
 }
开发者ID:Qu3uk,项目名称:HomeGenie,代码行数:7,代码来源:ThermostatOperatingState.cs

示例2: Get

 public static ZWaveMessage Get(ZWaveNode node)
 {
     return node.SendDataRequest(new byte[] {
         (byte)CommandClass.SensorBinary,
         (byte)Command.SensorBinaryGet
     });
 }
开发者ID:genielabs,项目名称:zwave-lib-dotnet,代码行数:7,代码来源:SensorBinary.cs

示例3: Get

 public static ZWaveMessage Get(ZWaveNode node)
 {
     return node.SendDataRequest(new byte[] { 
         (byte)CommandClass.SwitchMultilevel, 
         (byte)Command.SwitchMultilevelGet 
     });
 }
开发者ID:nyasara,项目名称:zwave-lib-dotnet,代码行数:7,代码来源:SwitchMultilevel.cs

示例4: GetEvent

 public static ZWaveEvent GetEvent(ZWaveNode node, byte[] message)
 {
     ZWaveEvent nodeEvent = null;
     byte cmdType = message[8];
     if (message.Length > 12 && cmdType == (byte)Command.AssociationReport)
     {
         byte groupId = message[9];
         byte maxAssociations = message[10];
         byte numAssociations = message[11]; // it is always zero ?!?
         string assocNodes = "";
         if (message.Length > 13)
         {
             for (int a = 12; a < message.Length - 1; a++)
             {
                 assocNodes += message[a] + ",";
             }
         }
         assocNodes = assocNodes.TrimEnd(',');
         //
         var associationRespose = new AssociationResponse() {
             Max = maxAssociations,
             Count = numAssociations,
             NodeList = assocNodes,
             GroupId = groupId
         };
         nodeEvent = new ZWaveEvent(node, EventParameter.Association, associationRespose, 0);
     }
     return nodeEvent;
 }
开发者ID:RichCattell,项目名称:HomeGenie,代码行数:29,代码来源:Association.cs

示例5: GetEvent

        public NodeEvent GetEvent(ZWaveNode node, byte[] message)
        {
            NodeEvent nodeEvent = null;
            Command type = (Command)message[1];

            if (type == Command.VersionCommandClassReport)
            {
                if (!Enum.IsDefined(typeof(CommandClass), message[2]))
                {
                    return nodeEvent;
                }
                CommandClass cmdClass = (CommandClass)message[2];
                VersionValue value = new VersionValue(cmdClass, message[3]);
                // Update node CC data
                if (cmdClass != CommandClass.NotSet)
                {
                    var nodeCc = node.GetCommandClass(cmdClass);
                    if (nodeCc != null)
                        nodeCc.Version = value.Version;
                    // Set the VersionCommandClass event
                    nodeEvent = new NodeEvent(node, EventParameter.VersionCommandClass, value, 0);
                }
                else
                {
                    Utility.logger.Warn("Command Class {0} ({1}) not supported yet", message[3], message[3].ToString("X2"));
                }
            }

            return nodeEvent;
        }
开发者ID:dmayard,项目名称:zwave-lib-dotnet,代码行数:30,代码来源:Version.cs

示例6: GetEvent

        public NodeEvent GetEvent(ZWaveNode node, byte[] message)
        {
            //Set up the color values array
            var colordata = node.GetData("ColorValues");
            if (colordata == null) { colordata = new NodeData("ColorValues", new List<ColorValue>()); }
            var colorvals = colordata.Value as List<ColorValue>;
            NodeEvent nodeEvent = null;
            byte cmdType = message[1];
            if (cmdType == (byte)Command.SwitchColorCapabilityReport)
            {
                for (int i = 2; i < 4; i++)
                {
                    for (int j = 0; j < 8; j++)
                    {
                        if ((message[i] & 0x1 << j) > 0)
                        {
                            var colnum = (ZWaveSwitchColorNumber)(8*i+j);
                            var exist = (from val in colorvals
                                         where val.ColorNumber == colnum
                                         select val).FirstOrDefault();
                            if (exist == null) { colorvals.Add(new ColorValue { ColorNumber = colnum, Value = 0 }); }
                            Get(node, 8 * i + j);
                        }
                    }
                }
            }
            else if (cmdType == (byte)Command.SwitchColorReport)
            {

            }
            node.UpdateData("ColorValues", colorvals);
            return nodeEvent;
        }
开发者ID:nyasara,项目名称:zwave-lib-dotnet,代码行数:33,代码来源:SwitchColor.cs

示例7: GetCapabilityReport

 public static ZWaveMessage GetCapabilityReport(ZWaveNode node)
 {
     return node.SendDataRequest(new byte[] {
         (byte)CommandClass.SwitchColor,
         (byte)Command.SwitchColorCapabilityGet
     });
 }
开发者ID:nyasara,项目名称:zwave-lib-dotnet,代码行数:7,代码来源:SwitchColor.cs

示例8: Reset

 public static ZWaveMessage Reset(ZWaveNode node)
 {
     return node.SendDataRequest(new byte[] { 
         (byte)CommandClass.Meter, 
         (byte)Command.MeterReset
     });
 }
开发者ID:nyasara,项目名称:zwave-lib-dotnet,代码行数:7,代码来源:Meter.cs

示例9: NodeEvent

 public NodeEvent(ZWaveNode node, EventParameter eventType, object eventValue, int instance)
 {
     this.Node = node;
     this.Parameter = eventType;
     this.Value = eventValue;
     this.Instance = instance;
 }
开发者ID:nyasara,项目名称:zwave-lib-dotnet,代码行数:7,代码来源:Events.cs

示例10: Get

 public static ZWaveMessage Get(ZWaveNode node)
 {
     return node.SendDataRequest(new byte[] { 
         (byte)CommandClass.WakeUp, 
         (byte)Command.WakeUpIntervalGet 
     });
 }
开发者ID:nyasara,项目名称:zwave-lib-dotnet,代码行数:7,代码来源:WakeUp.cs

示例11: GetSupported

 public static ZWaveMessage GetSupported(ZWaveNode node)
 {
     return node.SendDataRequest(new byte[] { 
         (byte)CommandClass.Meter, 
         (byte)Command.MeterSupportedGet
     });
 }
开发者ID:nyasara,项目名称:zwave-lib-dotnet,代码行数:7,代码来源:Meter.cs

示例12: GetEvent

 public static ZWaveEvent GetEvent(ZWaveNode node, byte[] message)
 {
     ZWaveEvent nodeEvent = null;
     byte cmdType = message[8];
     if (message.Length > 11 && cmdType == (byte)Command.ConfigurationReport)
     {
         byte paramId = message[9];
         byte paramLength = message[10];
         //
         var nodeConfigParamsLength = GetConfigParamsData(node);
         if (!nodeConfigParamsLength.ContainsKey(paramId))
         {
             nodeConfigParamsLength.Add(paramId, paramLength);
         }
         else
         {
             // this shouldn't change on read... but you never know! =)
             nodeConfigParamsLength[paramId] = paramLength;
         }
         //
         byte[] bval = new byte[4];
         // extract bytes value
         Array.Copy(message, 11, bval, 4 - (int)paramLength, (int)paramLength);
         uint paramval = bval[0];
         Array.Reverse(bval);
         // convert it to uint
         paramval = BitConverter.ToUInt32(bval, 0);
         nodeEvent = new ZWaveEvent(node, EventParameter.Configuration, paramval, paramId);
     }
     return nodeEvent;
 }
开发者ID:RichCattell,项目名称:HomeGenie,代码行数:31,代码来源:Configuration.cs

示例13: Report

 public static ZWaveMessage Report(ZWaveNode node)
 {
     return node.SendDataRequest(new byte[] { 
         (byte)CommandClass.Version, 
         (byte)Command.VersionGet,
     });
 }
开发者ID:Bounz,项目名称:zwave-lib-dotnet,代码行数:7,代码来源:Version.cs

示例14: Get

 public static void Get(ZWaveNode node)
 {
     node.SendDataRequest(new byte[] {
         (byte)CommandClass.Battery,
         (byte)Command.BatteryGet
     });
 }
开发者ID:BenjaminPelletier,项目名称:zwave-lib-dotnet,代码行数:7,代码来源:Battery.cs

示例15: Get

 public static void Get(ZWaveNode node)
 {
     node.SendRequest(new byte[] {
         (byte)CommandClass.DoorLock,
         (byte)Command.DoorLockGet
     });
 }
开发者ID:Qu3uk,项目名称:HomeGenie,代码行数:7,代码来源:DoorLock.cs


注:本文中的ZWaveNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。