• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ZWaveNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Get

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


示例17: Reset

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


示例18: GetSupported

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


示例19: ResendOnWakeUp

 public static void ResendOnWakeUp(ZWaveNode node, byte[] msg)
 {
     int minCommandLength = 8;
     if (msg.Length >= minCommandLength)
     {
         byte[] command = new byte[minCommandLength];
         Array.Copy(msg, 0, command, 0, minCommandLength);
         // discard any message having same header and command (first 8 bytes = header + command class + command)
         var wakeUpResendQueue = GetResendQueueData(node);
         for (int i = wakeUpResendQueue.Count - 1; i >= 0; i--)
         {
             byte[] queuedCommand = new byte[minCommandLength];
             Array.Copy(wakeUpResendQueue[i], 0, queuedCommand, 0, minCommandLength);
             if (queuedCommand.SequenceEqual(command))
             {
                 Utility.logger.Trace("Removing old message {0}", BitConverter.ToString(wakeUpResendQueue[i]));
                 wakeUpResendQueue.RemoveAt(i);
             }
         }
         Utility.logger.Trace("Adding message {0}", BitConverter.ToString(msg));
         wakeUpResendQueue.Add(msg);
         var wakeUpStatus = (WakeUpStatus)node.GetData("WakeUpStatus", new WakeUpStatus()).Value;
         if (!wakeUpStatus.IsSleeping)
         {
             wakeUpStatus.IsSleeping = true;
             var nodeEvent = new NodeEvent(node, EventParameter.WakeUpSleepingStatus, 1 /* 1 = sleeping, 0 = awake */, 0);
             node.OnNodeUpdated(nodeEvent);
         }
     }
 }
开发者ID:sanyaade-iot,项目名称:zwave-lib-dotnet,代码行数:30,代码来源:WakeUp.cs


示例20: Get

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ZXing类代码示例发布时间:2022-05-24
下一篇:
C# ZSocket类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap