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


C# ZWaveNode.SendMessage方法代码示例

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


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

示例1: GetEvent

 public static ZWaveEvent GetEvent(ZWaveNode node, byte[] message)
 {
     ZWaveEvent nodeEvent = null;
     byte cmdType = message[8];
     switch (cmdType)
     {
     case (byte)Command.WakeUpIntervalReport:
         if (message.Length > 11)
         {
             uint interval = ((uint)message[9]) << 16;
             interval |= (((uint)message[10]) << 8);
             interval |= (uint)message[11];
             nodeEvent = new ZWaveEvent(node, EventParameter.WakeUpInterval, interval, 0);
         }
         break;
     case (byte)Command.WakeUpNotification:
             // Resend queued messages while node was asleep
         var wakeUpResendQueue = GetResendQueueData(node);
         for (int m = 0; m < wakeUpResendQueue.Count; m++)
         {
             node.SendMessage(wakeUpResendQueue[m]);
         }
         wakeUpResendQueue.Clear();
         nodeEvent = new ZWaveEvent(node, EventParameter.WakeUpNotify, 1, 0);
         break;
     }
     return nodeEvent;
 }
开发者ID:RichCattell,项目名称:HomeGenie,代码行数:28,代码来源:WakeUp.cs

示例2: Get

 public static void Get(ZWaveNode node)
 {
     byte[] message = new byte[] {
         (byte)MessageHeader.SOF, /* Start Of Frame */
         0x09 /*packet len */,
         (byte)MessageType.Request,
         (byte)Function.SendData,
         node.Id,
         0x02,
         (byte)CommandClass.ManufacturerSpecific,
         (byte)Command.ManufacturerSpecificGet,
         0x05 /* report ?!? */,
         0x01 | 0x04,
         0x00
     };
     node.SendMessage(message);
 }
开发者ID:Qu3uk,项目名称:HomeGenie,代码行数:17,代码来源:ManufacturerSpecific.cs

示例3: WakeUpNode

 public static void WakeUpNode(ZWaveNode node)
 {
     // If node was marked as sleeping, reset the flag
     var wakeUpStatus = node.GetData("WakeUpStatus");
     if (wakeUpStatus != null && wakeUpStatus.Value != null && ((WakeUpStatus)wakeUpStatus.Value).IsSleeping)
     {
         ((WakeUpStatus)wakeUpStatus.Value).IsSleeping = false;
         var wakeEvent = new NodeEvent(node, EventParameter.WakeUpSleepingStatus, 0 /* 1 = sleeping, 0 = awake */, 0);
         node.OnNodeUpdated(wakeEvent);
         // Resend queued messages while node was asleep
         var wakeUpResendQueue = GetResendQueueData(node);
         for (int m = 0; m < wakeUpResendQueue.Count; m++)
         {
             Utility.logger.Trace("Sending message {0} {1}", m, BitConverter.ToString(wakeUpResendQueue[m]));
             node.SendMessage(wakeUpResendQueue[m]);
         }
         wakeUpResendQueue.Clear();
     }
 }
开发者ID:nyasara,项目名称:zwave-lib-dotnet,代码行数:19,代码来源:WakeUp.cs

示例4: GetEvent

 public NodeEvent GetEvent(ZWaveNode node, byte[] message)
 {
     NodeEvent nodeEvent = null;
     byte cmdType = message[1];
     switch (cmdType)
     {
     case (byte)Command.WakeUpIntervalReport:
         if (message.Length > 4)
         {
             uint interval = ((uint)message[2]) << 16;
             interval |= (((uint)message[3]) << 8);
             interval |= (uint)message[4];
             nodeEvent = new NodeEvent(node, EventParameter.WakeUpInterval, interval, 0);
         }
         break;
     case (byte)Command.WakeUpNotification:
         // If node was marked as sleeping, reset the flag
         var wakeUpStatus = node.GetData("WakeUpStatus");
         if (wakeUpStatus != null && wakeUpStatus.Value != null && ((WakeUpStatus)wakeUpStatus.Value).IsSleeping)
         {
             ((WakeUpStatus)wakeUpStatus.Value).IsSleeping = false;
             var wakeEvent = new NodeEvent(node, EventParameter.WakeUpSleepingStatus, 0 /* 1 = sleeping, 0 = awake */, 0);
             node.OnNodeUpdated(wakeEvent);
         }
         // Resend queued messages while node was asleep
         var wakeUpResendQueue = GetResendQueueData(node);
         for (int m = 0; m < wakeUpResendQueue.Count; m++)
         {
             Utility.logger.Trace("Sending message {0} {1}", m, BitConverter.ToString(wakeUpResendQueue[m]));
             node.SendMessage(wakeUpResendQueue[m]);
         }
         wakeUpResendQueue.Clear();
         nodeEvent = new NodeEvent(node, EventParameter.WakeUpNotify, 1, 0);
         break;
     }
     return nodeEvent;
 }
开发者ID:sanyaade-iot,项目名称:zwave-lib-dotnet,代码行数:37,代码来源:WakeUp.cs


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