本文整理汇总了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
});
}
示例2: Get
public static ZWaveMessage Get(ZWaveNode node)
{
return node.SendDataRequest(new byte[] {
(byte)CommandClass.SensorBinary,
(byte)Command.SensorBinaryGet
});
}
示例3: Get
public static ZWaveMessage Get(ZWaveNode node)
{
return node.SendDataRequest(new byte[] {
(byte)CommandClass.SwitchMultilevel,
(byte)Command.SwitchMultilevelGet
});
}
示例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;
}
示例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;
}
示例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;
}
示例7: GetCapabilityReport
public static ZWaveMessage GetCapabilityReport(ZWaveNode node)
{
return node.SendDataRequest(new byte[] {
(byte)CommandClass.SwitchColor,
(byte)Command.SwitchColorCapabilityGet
});
}
示例8: Reset
public static ZWaveMessage Reset(ZWaveNode node)
{
return node.SendDataRequest(new byte[] {
(byte)CommandClass.Meter,
(byte)Command.MeterReset
});
}
示例9: NodeEvent
public NodeEvent(ZWaveNode node, EventParameter eventType, object eventValue, int instance)
{
this.Node = node;
this.Parameter = eventType;
this.Value = eventValue;
this.Instance = instance;
}
示例10: Get
public static ZWaveMessage Get(ZWaveNode node)
{
return node.SendDataRequest(new byte[] {
(byte)CommandClass.WakeUp,
(byte)Command.WakeUpIntervalGet
});
}
示例11: GetSupported
public static ZWaveMessage GetSupported(ZWaveNode node)
{
return node.SendDataRequest(new byte[] {
(byte)CommandClass.Meter,
(byte)Command.MeterSupportedGet
});
}
示例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;
}
示例13: Report
public static ZWaveMessage Report(ZWaveNode node)
{
return node.SendDataRequest(new byte[] {
(byte)CommandClass.Version,
(byte)Command.VersionGet,
});
}
示例14: Get
public static void Get(ZWaveNode node)
{
node.SendDataRequest(new byte[] {
(byte)CommandClass.Battery,
(byte)Command.BatteryGet
});
}
示例15: Get
public static void Get(ZWaveNode node)
{
node.SendRequest(new byte[] {
(byte)CommandClass.DoorLock,
(byte)Command.DoorLockGet
});
}