示例#1
0
        public static ZWaveEvent GetEvent(ZWaveNode node, byte[] message)
        {
            ZWaveEvent nodeEvent = null;
            byte       cmdType   = message[8];

            if (message.Length > 14)
            {
                byte[] manufacturerId = new byte[2] {
                    message[9], message[10]
                };
                byte[] typeId = new byte[2] {
                    message[11], message[12]
                };
                byte[] productId = new byte[2] {
                    message[13], message[14]
                };

                var manufacturerSpecs = new ManufacturerSpecificInfo()
                {
                    TypeId         = Utility.ByteArrayToString(typeId).Replace(" ", ""),
                    ProductId      = Utility.ByteArrayToString(productId).Replace(" ", ""),
                    ManufacturerId = Utility.ByteArrayToString(manufacturerId).Replace(" ", "")
                };

                nodeEvent = new ZWaveEvent(node, EventParameter.ManufacturerSpecific, manufacturerSpecs, 0);
            }

            return(nodeEvent);
        }
        public static ZWaveEvent GetEvent(ZWaveNode node, byte[] message)
        {
            ZWaveEvent nodeEvent = null;
            byte cmdType = message[8];

            if (message.Length > 14)
            {
                byte[] manufacturerId = new byte[2] { message[9], message[10] };
                byte[] typeId = new byte[2] { message[11], message[12] };
                byte[] productId = new byte[2] { message[13], message[14] };

                var manufacturerSpecs = new ManufacturerSpecificInfo() {
                    TypeId = Utility.ByteArrayToString(typeId).Replace(" ", ""),
                    ProductId = Utility.ByteArrayToString(productId).Replace(" ", ""),
                    ManufacturerId = Utility.ByteArrayToString(manufacturerId).Replace(" ", "")
                };

                nodeEvent = new ZWaveEvent(node, EventParameter.ManufacturerSpecific, manufacturerSpecs, 0);
            }

            return nodeEvent;
        }