示例#1
0
        internal AlarmCluster(ZigBeeEndPoint endPoint, List <UInt16> supportedAttributes)
            : base(endPoint)
        {
            // set cluster name and cluster Id
            Name = CLUSTER_NAME;
            m_Id = CLUSTER_ID;

            // if supportedAttributes is null assume all attributes supported
            bool supportAllAttributesBydefault = false;

            if (supportedAttributes == null)
            {
                supportAllAttributesBydefault = true;
            }

            if (supportAllAttributesBydefault || supportedAttributes.Contains(ATTRIBUTE_ALARM_COUNT))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_ALARM_COUNT, "Alarm Count", ZclHelper.UINT16_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            //TODO: Add Cluster Commands

            // call parent class "post constructor"
            PostChildClassConstructor();
        }
示例#2
0
        private void ZoneStatusChangeNotification(ZclServerCommand command)
        {
            ZclAttribute attribute = null;

            // update Zone status attribute and notify change
            if (!m_attributeList.TryGetValue(ATTRIBUTE_ZONESTATUS, out attribute))
            {
                attribute.Value.Data = command.GetParam(PARAM_ZONESTATUS).Data;
                SignalAttributeValueChange(attribute);
            }
        }
示例#3
0
        internal BasicCluster(ZigBeeEndPoint endPoint)
            : base(endPoint)
        {
            // set cluster name and cluster Id
            Name = CLUSTER_NAME;
            m_Id = CLUSTER_ID;

            // Basic cluster attributes
            var attrib = new ZclAttribute(this, ATTRIBUTE_ZCL_VERSION, "ZclVersion", ZclHelper.UINT8_TYPE, true);

            m_attributeList.Add(attrib.Id, attrib);

            attrib = new ZclAttribute(this, ATTRIBUTE_APPLICATION_VERSION, "ApplicationVersion", ZclHelper.UINT8_TYPE, true);
            m_attributeList.Add(attrib.Id, attrib);

            attrib = new ZclAttribute(this, ATTRIBUTE_STACK_VERSION, "StackVersion", ZclHelper.UINT8_TYPE, true);
            m_attributeList.Add(attrib.Id, attrib);

            attrib = new ZclAttribute(this, ATTRIBUTE_HW_VERSION, "HwVersion", ZclHelper.UINT8_TYPE, true);
            m_attributeList.Add(attrib.Id, attrib);

            attrib = new ZclAttribute(this, ATTRIBUTE_MANUFACTURER_NAME, "ManufacturerName", ZclHelper.CHAR_STRING_TYPE, true);
            m_attributeList.Add(attrib.Id, attrib);

            attrib = new ZclAttribute(this, ATTRIBUTE_MODEL_IDENTIFIER, "ModelIdentifier", ZclHelper.CHAR_STRING_TYPE, true);
            m_attributeList.Add(attrib.Id, attrib);

            attrib = new ZclAttribute(this, ATTRIBUTE_DATE_CODE, "DateCode", ZclHelper.CHAR_STRING_TYPE, true);
            m_attributeList.Add(attrib.Id, attrib);

            attrib = new ZclAttribute(this, ATTRIBUTE_POWER_SOURCE, "PowerSource", ZclHelper.ENUMERATION_8_BIT_TYPE, true);
            m_attributeList.Add(attrib.Id, attrib);

            attrib = new ZclAttribute(this, ATTRIBUTE_LOCATION_DESCRIPTION, "LocationDescription", ZclHelper.CHAR_STRING_TYPE);
            m_attributeList.Add(attrib.Id, attrib);

            attrib = new ZclAttribute(this, ATTRIBUTE_PHYSICAL_ENVIRONMENT, "PhysicalEnvironment", ZclHelper.ENUMERATION_8_BIT_TYPE);
            m_attributeList.Add(attrib.Id, attrib);

            attrib = new ZclAttribute(this, ATTRIBUTE_DEVICE_ENABLE, "DeviceEnable", ZclHelper.BOOLEAN_TYPE);
            m_attributeList.Add(attrib.Id, attrib);

            attrib = new ZclAttribute(this, ATTRIBUTE_ALARM_MASK, "AlarmMask", ZclHelper.BITMAP_8_BIT_TYPE);
            m_attributeList.Add(attrib.Id, attrib);

            attrib = new ZclAttribute(this, ATTRIBUTE_DISABLE_LOCAL_CONFIG, "DisableLocalConfig", ZclHelper.BITMAP_8_BIT_TYPE);
            m_attributeList.Add(attrib.Id, attrib);

            // call parent class "post constructor"
            PostChildClassConstructor();
        }
示例#4
0
        public RelativeHumidityCluster(ZigBeeEndPoint endPoint, List <UInt16> supportedAttributes)
            : base(endPoint)
        {
            // set cluster name and cluster Id
            Name = CLUSTER_NAME;
            m_Id = CLUSTER_ID;

            // if supportedAttributes is null assume all attributes supported
            bool supportAllAttributesBydefault = false;

            if (supportedAttributes == null)
            {
                supportAllAttributesBydefault = true;
            }

            // Temperature attribute (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_TEMPERATURE))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_TEMPERATURE, "MeasuredValue",
                                              ZclHelper.UINT16_TYPE, true, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_MINMEASURED))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_MINMEASURED, "MinMeasuredValue ",
                                              ZclHelper.UINT16_TYPE, true, false);
                m_attributeList.Add(attrib.Id, attrib);
            }
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_MAXMEASURED))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_MAXMEASURED, "MaxMeasuredValue ",
                                              ZclHelper.UINT16_TYPE, true, false);
                m_attributeList.Add(attrib.Id, attrib);
            }
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_TOLERANCE))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_TOLERANCE, "Tolerance",
                                              ZclHelper.UINT16_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }

            // call parent class "post constructor"
            PostChildClassConstructor();
        }
示例#5
0
        private bool GetOnOffStateFromDevice()
        {
            ZclAttribute attributeOnOff = null;

            System.Object value;

            // look for OnOff cluster of this end point and get the value of the on/off attribute
            var onOffCluster = m_endPoint.GetCluster(OnOffCluster.CLUSTER_ID);

            if (onOffCluster != null &&
                onOffCluster.InternalAttributeList.TryGetValue(OnOffCluster.ATTRIBUTE_ONOFF, out attributeOnOff) &&
                attributeOnOff.Read(out value) &&
                value is bool)
            {
                m_onOffState = (bool)value;
            }

            return(m_onOffState);
        }
示例#6
0
        uint GetLevelFromDevice()
        {
            if (LampDetails_Dimmable)
            {
                ZclAttribute  attributeLevel = null;
                System.Object value;

                // look for level control cluster of this end point and get the value of the current level attribute
                var levelControlCluster = m_endPoint.GetCluster(LevelControlCluster.CLUSTER_ID);
                if (levelControlCluster != null &&
                    levelControlCluster.InternalAttributeList.TryGetValue(LevelControlCluster.ATTRIBUTE_CURRENTLEVEL, out attributeLevel) &&
                    attributeLevel.Read(out value) &&
                    value is byte)
                {
                    if ((byte)(m_level / LIGHTLEVEL_SCALERATIO) != (byte)value)
                    {
                        // set m_level only if it represents different light level internally
                        m_level = LIGHTLEVEL_SCALERATIO * (byte)value;
                    }
                }
            }

            return(m_level);
        }
示例#7
0
        internal IASZoneCluster(ZigBeeEndPoint endPoint, List <UInt16> supportedAttributes)
            : base(endPoint)
        {
            // set cluster name and cluster Id
            Name = CLUSTER_NAME;
            m_Id = CLUSTER_ID;

            // if supportedAttributes is null assume all attributes supported
            bool supportAllAttributesBydefault = false;

            if (supportedAttributes == null)
            {
                supportAllAttributesBydefault = true;
            }

            // Zone State attribute (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_ZONESTATE))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_ZONESTATE, "ZoneState", ZclHelper.ENUMERATION_8_BIT_TYPE, true);
                m_attributeList.Add(attrib.Id, attrib);
            }

            // Zone Type attribute (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_ZONETYPE))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_ZONETYPE, "ZoneType", ZclHelper.ENUMERATION_16_BIT_TYPE, true);
                m_attributeList.Add(attrib.Id, attrib);
            }

            // Zone Status attribute (read only, mandatory and "reportable")
            // note that ZCL standard indicates that this attribute isn't reportable, however it also specifies a server command: Zone status change notification command to
            // notify change of zone status => ZclAttribute is then kind of reportable through a server command mechanism (change of value signal should consequently be available
            // for that attribute)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_ZONESTATUS))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_ZONESTATUS, "ZoneStatus", ZclHelper.BITMAP_16_BIT_TYPE, true, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }

            // IAS CIE address attribute (read/write)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_IASCIEADDRESS))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_IASCIEADDRESS, "IasCieAddress", ZclHelper.IEEE_ADDRESS_TYPE, false);
                m_attributeList.Add(attrib.Id, attrib);
            }

            // IMPORTANT NOTE,  parameters MUST be added in parameter list of each command
            // in the order specified in ZCL standard

            // Zone status change notification command
            // note that this command is server command hence received by ZigBee DSB (as opposed to ZclCommand which are sent by ZigBee DSB)
            var command   = new ZclServerCommand(this, COMMAND_ZONESTATUSCHANGENOTIFICATION);
            var parameter = new ZclValue(ZclHelper.ENUMERATION_16_BIT_TYPE, PARAM_ZONESTATUS);

            command.AddParam(parameter);
            parameter = new ZclValue(ZclHelper.ENUMERATION_8_BIT_TYPE, PARAM_EXTENDEDSTATUS);
            command.AddParam(parameter);
            command.OnReception += ZoneStatusChangeNotification;
            m_serverCommandList.Add(command);

            // call parent class "post constructor"
            PostChildClassConstructor();
        }
示例#8
0
        internal OnOffCluster(ZigBeeEndPoint endPoint, List <UInt16> supportedAttributes)
            : base(endPoint)
        {
            // set cluster name and cluster Id
            Name = CLUSTER_NAME;
            m_Id = CLUSTER_ID;

            // if supportedAttributes is null assume all attributes supported
            bool supportAllAttributesBydefault = false;

            if (supportedAttributes == null)
            {
                supportAllAttributesBydefault = true;
            }

            // OnOff attribute (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_ONOFF))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_ONOFF, "OnOff", ZclHelper.BOOLEAN_TYPE, true, false);
                m_attributeList.Add(attrib.Id, attrib);
            }

            // IMPORTANT NOTE,  parameters MUST be added in parameter list of each command
            // in the order specified in ZCL standard

            // Off command (no response required)
            var command = new ZclCommand(this, COMMAND_OFF, "Off", false);

            m_commandList.Add(command.Id, command);
            // On command (no response required)
            command = new ZclCommand(this, COMMAND_ON, "On", false);
            m_commandList.Add(command.Id, command);
            // Toggle command (no response required)
            command = new ZclCommand(this, COMMAND_TOGGLE, "Toggle", false);
            m_commandList.Add(command.Id, command);

            // add ZLL profile specific attributes and commands
            bool areZllAttributesSupported = false;

            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_GLOBALSCENECONTROL_ZLL))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_GLOBALSCENECONTROL_ZLL, "GlobalSceneControl", ZclHelper.BOOLEAN_TYPE, true, false);
                m_attributeList.Add(attrib.Id, attrib);
                areZllAttributesSupported = true;
            }
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_ONTIME_ZLL))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_ONTIME_ZLL, "OnTime", ZclHelper.UINT16_TYPE, true, false);
                m_attributeList.Add(attrib.Id, attrib);
                areZllAttributesSupported = true;
            }
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_OFFWAITTIME_ZLL))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_OFFWAITTIME_ZLL, "OnWaitTime", ZclHelper.UINT16_TYPE, true, false);
                m_attributeList.Add(attrib.Id, attrib);
                areZllAttributesSupported = true;
            }

            // add ZLL command if ZLL attributes are supported
            if (areZllAttributesSupported)
            {
                command = new ZclCommand(this, COMMAND_OFFWITHEFFECT_ZLL, "OffWithEffect", false);
                var parameter = new ZclValue(ZclHelper.UINT8_TYPE, "EffectIdentifier");
                command.AddInParam(parameter);
                parameter = new ZclValue(ZclHelper.UINT8_TYPE, "EffectVariant");
                command.AddInParam(parameter);
                m_commandList.Add(command.Id, command);

                command = new ZclCommand(this, COMMAND_ONWITHRECALLGLOBALSCENE_ZLL, "OnWithRecallGlobalScene", false);
                m_commandList.Add(command.Id, command);

                command   = new ZclCommand(this, COMMAND_ONWITHTIMEOFF_ZLL, "OnWithTimeOff", false);
                parameter = new ZclValue(ZclHelper.UINT8_TYPE, "OnOffControl");
                command.AddInParam(parameter);
                parameter = new ZclValue(ZclHelper.UINT16_TYPE, "OnTime");
                command.AddInParam(parameter);
                parameter = new ZclValue(ZclHelper.UINT16_TYPE, "OffWaitTime");
                command.AddInParam(parameter);
                m_commandList.Add(command.Id, command);
            }

            // call parent class "post constructor"
            PostChildClassConstructor();
        }
示例#9
0
        internal void Initialize(ZigBeeDevice device)
        {
            LoggingServices loggingServices = new LoggingServices();
            ZclAttribute    attribute       = null;

            // save away parent device
            m_device          = device;
            m_managementLeave = new ManagementLeave(m_device);

            ZigBeeProfileLibrary profileLibrary = ZigBeeProfileLibrary.Instance;
            string profileName;
            string deviceType;

            profileLibrary.GetProfileAndDeviceNames(m_originalProfileId, DeviceId, out profileName, out deviceType, out m_commandProfileId);

            // set name and description
            this.Description = profileName + " - " + deviceType;
            this.Name        = deviceType;

            //get some information from Basic cluster, e.g.: manufacturer name, model name, HW version, application version...
            if (m_basicCluster.InternalAttributeList.TryGetValue(BasicCluster.ATTRIBUTE_MANUFACTURER_NAME, out attribute))
            {
                object value;
                if (attribute.Read(out value))
                {
                    this.Vendor = (String)value;
                    //loggingServices.WriteLine<ZigBeeEndPoint>(" Vendor = ["+ this.Vendor + "]");
                }
                //else
                //{
                //    loggingServices.WriteLine<ZigBeeEndPoint>(" No Vendor");
                //}
            }
            if (m_basicCluster.InternalAttributeList.TryGetValue(BasicCluster.ATTRIBUTE_MODEL_IDENTIFIER, out attribute))
            {
                object value;
                if (attribute.Read(out value))
                {
                    this.Model = (String)value;
                    //loggingServices.WriteLine<ZigBeeEndPoint>(" Model = [" + this.Model + "]");
                }
                //else
                //{
                //    loggingServices.WriteLine<ZigBeeEndPoint>(" No Model");
                //}
            }
            if (m_basicCluster.InternalAttributeList.TryGetValue(BasicCluster.ATTRIBUTE_HW_VERSION, out attribute))
            {
                object value;
                if (attribute.Read(out value))
                {
                    this.FirmwareVersion = Convert.ToUInt32((byte)value).ToString();
                    //loggingServices.WriteLine<ZigBeeEndPoint>(" FirmwareVersion = [" + this.FirmwareVersion + "]");
                }
                //else
                //{
                //    loggingServices.WriteLine<ZigBeeEndPoint>(" No FirmwareVersion");
                //}
            }
            if (m_basicCluster.InternalAttributeList.TryGetValue(BasicCluster.ATTRIBUTE_APPLICATION_VERSION, out attribute))
            {
                object value;
                if (attribute.Read(out value))
                {
                    this.Version = Convert.ToUInt32((byte)value).ToString();
                    //loggingServices.WriteLine<ZigBeeEndPoint>(" Version = [" + this.Version + "]");
                }
                //else
                //{
                //    loggingServices.WriteLine<ZigBeeEndPoint>(" No Version");
                //}
            }

            // create AllJoyn LSF if this device is a light
            ZigBeeProfileLibrary.DeviceType zigBeeDeviceType;
            if (profileLibrary.IsLight(m_originalProfileId, DeviceId, out zigBeeDeviceType))
            {
                m_lsfHandler = new LSFHandler(this, zigBeeDeviceType);
            }

            // create signals
            CreateSignals();
        }
示例#10
0
        internal PowerConfigurationCluster(ZigBeeEndPoint endPoint, List <UInt16> supportedAttributes)
            : base(endPoint)
        {
            // set cluster name and cluster Id
            Name = CLUSTER_NAME;
            m_Id = CLUSTER_ID;

            // if supportedAttributes is null assume all attributes supported
            bool supportAllAttributesBydefault = false;

            if (supportedAttributes == null)
            {
                supportAllAttributesBydefault = true;
            }

            if (supportAllAttributesBydefault || supportedAttributes.Contains(ATTRIBUTE_MAINS_VOLTAGE))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_MAINS_VOLTAGE, "Mains Voltage",
                                              ZclHelper.UINT16_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            if (supportAllAttributesBydefault || supportedAttributes.Contains(ATTRIBUTE_MAINS_FREQUENCY))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_MAINS_FREQUENCY, "Mains Frequency",
                                              ZclHelper.UINT8_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            if (supportAllAttributesBydefault || supportedAttributes.Contains(ATTRIBUTE_MAINS_ALARM_MASK))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_MAINS_ALARM_MASK, "Mains Alarm Mask",
                                              ZclHelper.BITMAP_8_BIT_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            if (supportAllAttributesBydefault || supportedAttributes.Contains(ATTRIBUTE_MAINS_VOLTAGE_MIN_THRESHOLD))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_MAINS_VOLTAGE_MIN_THRESHOLD, "Mains Voltage Min Threshold", ZclHelper.UINT16_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            if (supportAllAttributesBydefault || supportedAttributes.Contains(ATTRIBUTE_MAINS_VOLTAGE_MAX_THRESHOLD))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_MAINS_VOLTAGE_MAX_THRESHOLD, "Mains Voltage Max Threshold",
                                              ZclHelper.UINT16_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            if (supportAllAttributesBydefault || supportedAttributes.Contains(ATTRIBUTE_MAINS_VOLTAGE_DWELL))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_MAINS_VOLTAGE_DWELL, "Mains Voltage Dwell Trip Point",
                                              ZclHelper.UINT16_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            if (supportAllAttributesBydefault || supportedAttributes.Contains(ATTRIBUTE_BATTERY_VOLTAGE))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_BATTERY_VOLTAGE, "Battery Voltage",
                                              ZclHelper.UINT8_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            if (supportAllAttributesBydefault || supportedAttributes.Contains(ATTRIBUTE_BATTERY_MANUFACTURER))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_BATTERY_MANUFACTURER, "Battery Manufacturer",
                                              ZclHelper.CHAR_STRING_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            if (supportAllAttributesBydefault || supportedAttributes.Contains(ATTRIBUTE_BATTERY_SIZE))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_BATTERY_SIZE, "Battery Size",
                                              ZclHelper.ENUMERATION_8_BIT_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            if (supportAllAttributesBydefault || supportedAttributes.Contains(ATTRIBUTE_BATTERY_AHR_RATING))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_BATTERY_AHR_RATING, "Battery AHr Rating",
                                              ZclHelper.UINT16_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            if (supportAllAttributesBydefault || supportedAttributes.Contains(ATTRIBUTE_BATTERY_QUANTITY))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_BATTERY_QUANTITY, "Battery Quantity",
                                              ZclHelper.UINT8_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            if (supportAllAttributesBydefault || supportedAttributes.Contains(ATTRIBUTE_BATTERY_RATED_VOLTAGE))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_BATTERY_RATED_VOLTAGE, "Battery Rated Voltage",
                                              ZclHelper.UINT8_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            if (supportAllAttributesBydefault || supportedAttributes.Contains(ATTRIBUTE_BATTERY_ALARM_MASK))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_BATTERY_ALARM_MASK, "Battery Alarm Mask",
                                              ZclHelper.BITMAP_8_BIT_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            if (supportAllAttributesBydefault || supportedAttributes.Contains(ATTRIBUTE_BATTERY_VOLTAGE_MIN_THRESHOLD))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_BATTERY_VOLTAGE_MIN_THRESHOLD, "Battery Voltage Min Threshold",
                                              ZclHelper.UINT8_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // call parent class "post constructor"
            PostChildClassConstructor();
        }
示例#11
0
        internal LevelControlCluster(ZigBeeEndPoint endPoint, List <UInt16> supportedAttributes)
            : base(endPoint)
        {
            // set cluster name and cluster Id
            Name = CLUSTER_NAME;
            m_Id = CLUSTER_ID;

            // if supportedAttributes is null assume all attributes supported
            bool supportAllAttributesBydefault = false;

            if (supportedAttributes == null)
            {
                supportAllAttributesBydefault = true;
            }
            // current level attribute (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_CURRENTLEVEL))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_CURRENTLEVEL, "CurrentLevel", ZclHelper.UINT8_TYPE, true, false);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // remaining time attribute (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_REMAININGTIME))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_REMAININGTIME, "RemainingTime", ZclHelper.UINT16_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // on/off transition time attribute (read/write)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_ONOFFTRANSITIONTIME))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_ONOFFTRANSITIONTIME, "OnOffTransitionTime", ZclHelper.UINT16_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // on level attribute (read/write)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_ONLEVEL))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_ONLEVEL, "OnLevel", ZclHelper.UINT8_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }

            // IMPORTANT NOTE,  parameters MUST be added in parameter list of each command
            // in the order specified in ZCL standard

            // move to level command (no response required)
            var command   = new ZclCommand(this, COMMAND_MOVETOLEVEL, "MoveToLevel", false);
            var parameter = new ZclValue(ZclHelper.UINT8_TYPE, LEVEL_PARAM);

            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT16_TYPE, "TransitionTime");
            command.AddInParam(parameter);
            m_commandList.Add(command.Id, command);

            // Move command (no response required)
            command   = new ZclCommand(this, COMMAND_MOVE, "Move", false);
            parameter = new ZclValue(ZclHelper.ENUMERATION_8_BIT_TYPE, "MoveMode");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT8_TYPE, "Rate");
            command.AddInParam(parameter);
            m_commandList.Add(command.Id, command);

            // Step command (no response required)
            command   = new ZclCommand(this, COMMAND_STEP, "Step", false);
            parameter = new ZclValue(ZclHelper.ENUMERATION_8_BIT_TYPE, "StepMode");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT8_TYPE, "StepSize");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT16_TYPE, "TransitionTime");
            command.AddInParam(parameter);
            m_commandList.Add(command.Id, command);

            // Stop command (no response required)
            command = new ZclCommand(this, COMMAND_STOP, "Stop", false);
            m_commandList.Add(command.Id, command);

            // move to level with on/off command (no response required)
            command   = new ZclCommand(this, COMMAND_MOVETOLEVEL_WITHONOFF, "MoveToLevelWithOnOff", false);
            parameter = new ZclValue(ZclHelper.UINT8_TYPE, LEVEL_PARAM);
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT16_TYPE, "TransitionTime");
            command.AddInParam(parameter);
            m_commandList.Add(command.Id, command);

            // Move command (no response required)
            command   = new ZclCommand(this, COMMAND_MOVE_WITHONOFF, "MoveWithOnOff", false);
            parameter = new ZclValue(ZclHelper.ENUMERATION_8_BIT_TYPE, "MoveMode");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT8_TYPE, "Rate");
            command.AddInParam(parameter);
            m_commandList.Add(command.Id, command);

            // Step command (no response required)
            command   = new ZclCommand(this, COMMAND_STEP_WITHONOFF, "StepWithOnOff", false);
            parameter = new ZclValue(ZclHelper.ENUMERATION_8_BIT_TYPE, "StepMode");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT8_TYPE, "StepSize");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT16_TYPE, "TransitionTime");
            command.AddInParam(parameter);
            m_commandList.Add(command.Id, command);

            // Stop command (no response required)
            command = new ZclCommand(this, COMMAND_STOP_WITHONOFF, "StopWithOnOff", false);
            m_commandList.Add(command.Id, command);

            // call parent class "post constructor"
            PostChildClassConstructor();
        }
示例#12
0
        internal DoorLockCluster(ZigBeeEndPoint endPoint, List <UInt16> supportedAttributes)
            : base(endPoint)
        {
            // set cluster name and cluster Id
            Name = CLUSTER_NAME;
            m_Id = CLUSTER_ID;

            // if supportedAttributes is null assume all attributes supported
            bool supportAllAttributesBydefault = false;

            if (supportedAttributes == null)
            {
                supportAllAttributesBydefault = true;
            }

            // Lock State attribute (read only, mandatory, reportable))
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_LOCKSTATE))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_LOCKSTATE, "LockState", ZclHelper.ENUMERATION_8_BIT_TYPE, true, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }

            // Lock Type attribute (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_LOCKTYPE))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_LOCKTYPE, "LockType", ZclHelper.ENUMERATION_8_BIT_TYPE, true, false);
                m_attributeList.Add(attrib.Id, attrib);
            }

            // Actuator Enabled attribute (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_ACTUATORENABLED))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_ACTUATORENABLED, "ActuatorEnabled", ZclHelper.BOOLEAN_TYPE, true, false);
                m_attributeList.Add(attrib.Id, attrib);
            }

            // Door State attribute (read only, optional, reportable)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_DOORSTATE))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_DOORSTATE, "DoorState", ZclHelper.ENUMERATION_8_BIT_TYPE, true, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }

            // Door Open Events attribute
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_DOOROPENEVENTS))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_DOOROPENEVENTS, "DoorOpenEvents", ZclHelper.UINT32_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }

            // Door Close Events attribute
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_DOORCLOSEDEVENTS))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_DOORCLOSEDEVENTS, "DoorCloseEvents", ZclHelper.UINT32_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }

            // Open Period attribute
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_OPENPERIOD))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_OPENPERIOD, "OpenPeriod", ZclHelper.UINT16_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }

            // IMPORTANT NOTE,  parameters MUST be added in parameter list of each command
            // in the order specified in ZCL standard

            // Lock door command
            var command   = new ZclCommand(this, COMMAND_LOCKDOOR, "LockDoor", true);
            var parameter = new ZclValue(ZclHelper.ENUMERATION_8_BIT_TYPE, "Status");

            command.AddOutParam(parameter);
            m_commandList.Add(command.Id, command);

            // Unlock door command
            command   = new ZclCommand(this, COMMAND_UNLOCKDOOR, "UnlockDoor", true);
            parameter = new ZclValue(ZclHelper.ENUMERATION_8_BIT_TYPE, "Status");
            command.AddOutParam(parameter);
            m_commandList.Add(command.Id, command);

            // call parent class "post constructor"
            PostChildClassConstructor();
        }
示例#13
0
 protected void SignalAttributeValueChange(ZclAttribute attribute)
 {
     m_endPoint.Device.ZigBeeAdatper.SignalChangeOfAttributeValue(m_endPoint, this, attribute);
 }
示例#14
0
        internal ColorControlCluster(ZigBeeEndPoint endPoint, List <UInt16> supportedAttributes)
            : base(endPoint)
        {
            // set cluster name and cluster Id
            Name = CLUSTER_NAME;
            m_Id = CLUSTER_ID;

            // if supportedAttributes is null assume all attributes supported
            bool supportAllAttributesBydefault = false;

            if (supportedAttributes == null)
            {
                supportAllAttributesBydefault = true;
            }

            // current hue attribute (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_CURRENTHUE))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_CURRENTHUE, "CurrentHue", ZclHelper.UINT8_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // current saturation (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_CURRENTSATURATION))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_CURRENTSATURATION, "CurrentSaturation", ZclHelper.UINT8_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // remaining time (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_REMAININGTIME))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_REMAININGTIME, "RemainingTime", ZclHelper.UINT16_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // current X (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_CURRENTX))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_CURRENTX, "CurrentX", ZclHelper.UINT16_TYPE, true, false);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // current Y (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_CURRENTY))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_CURRENTY, "CurrentY", ZclHelper.UINT16_TYPE, true, false);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // drift compensation (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_DRIFTCOMPENSATION))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_DRIFTCOMPENSATION, "DriftCompensation", ZclHelper.UINT8_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // compensation text (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_COMPENSATIONTEXT))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_COMPENSATIONTEXT, "CompensationText", ZclHelper.CHAR_STRING_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // color temperature (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_COLORTEMPERATURE))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_COLORTEMPERATURE, "ColorTemperature", ZclHelper.UINT16_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // color mode (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_COLORMODE))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_COLORMODE, "ColorMode", ZclHelper.ENUMERATION_8_BIT_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // number of primaries (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_NUMBEROFPRIMARIES))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_NUMBEROFPRIMARIES, "NumberOfPrimaries", ZclHelper.UINT8_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // primary 1 X (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_PRIMARY1X))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_PRIMARY1X, "Primary1X", ZclHelper.UINT16_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // primary 1 Y (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_PRIMARY1Y))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_PRIMARY1Y, "Primary1Y", ZclHelper.UINT16_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // primary 1 intensity (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_PRIMARY1INTENSITY))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_PRIMARY1INTENSITY, "Primary1Intensity", ZclHelper.UINT8_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // primary 2 X (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_PRIMARY2X))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_PRIMARY2X, "Primary2X", ZclHelper.UINT16_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // primary 2 Y (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_PRIMARY2Y))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_PRIMARY2Y, "Primary2Y", ZclHelper.UINT16_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // primary 2 intensity (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_PRIMARY2INTENSITY))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_PRIMARY2INTENSITY, "Primary2Intensity", ZclHelper.UINT8_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // primary 3 X (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_PRIMARY3X))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_PRIMARY3X, "Primary3X", ZclHelper.UINT16_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // primary 3 Y (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_PRIMARY3Y))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_PRIMARY3Y, "Primary3Y", ZclHelper.UINT16_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // primary 3 intensity (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_PRIMARY3INTENSITY))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_PRIMARY3INTENSITY, "Primary3Intensity", ZclHelper.UINT8_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // primary 4 X (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_PRIMARY4X))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_PRIMARY4X, "Primary4X", ZclHelper.UINT16_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // primary 4 Y (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_PRIMARY4Y))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_PRIMARY4Y, "Primary4Y", ZclHelper.UINT16_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // primary 4 intensity (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_PRIMARY4INTENSITY))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_PRIMARY4INTENSITY, "Primary4Intensity", ZclHelper.UINT8_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // primary 5 X (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_PRIMARY5X))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_PRIMARY5X, "Primary5X", ZclHelper.UINT16_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // primary 5 Y (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_PRIMARY5Y))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_PRIMARY5Y, "Primary5Y", ZclHelper.UINT16_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // primary 5 intensity (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_PRIMARY5INTENSITY))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_PRIMARY5INTENSITY, "Primary5Intensity", ZclHelper.UINT8_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // primary 6 X (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_PRIMARY6X))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_PRIMARY6X, "Primary6X", ZclHelper.UINT16_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // primary 6 Y (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_PRIMARY6Y))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_PRIMARY6Y, "Primary6Y", ZclHelper.UINT16_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // primary 6 intensity (read only)
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_PRIMARY6INTENSITY))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_PRIMARY6INTENSITY, "Primary6Intensity", ZclHelper.UINT8_TYPE, true, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // white point X
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_WHITEPOINTX))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_WHITEPOINTX, "WhitePointX", ZclHelper.UINT16_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // white point Y
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_WHITEPOINTY))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_WHITEPOINTY, "WhitePointY", ZclHelper.UINT16_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // color point R X
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_COLORPOINTRX))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_COLORPOINTRX, "ColorPointRX", ZclHelper.UINT16_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // color point R Y
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_COLORPOINTRY))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_COLORPOINTRY, "ColorPointRY", ZclHelper.UINT16_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // color point R intensity
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_COLORPOINTRINTENSITY))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_COLORPOINTRINTENSITY, "ColorPointRIntensity", ZclHelper.UINT8_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // color point G X
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_COLORPOINTGX))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_COLORPOINTGX, "ColorPointGX", ZclHelper.UINT16_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // color point G Y
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_COLORPOINTGY))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_COLORPOINTGY, "ColorPointGY", ZclHelper.UINT16_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // color point G intensity
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_COLORPOINTGINTENSITY))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_COLORPOINTGINTENSITY, "ColorPointGIntensity", ZclHelper.UINT8_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // color point B X
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_COLORPOINTBX))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_COLORPOINTBX, "ColorPointBX", ZclHelper.UINT16_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // color point B Y
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_COLORPOINTBY))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_COLORPOINTBY, "ColorPointBY", ZclHelper.UINT16_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }
            // color point B intensity
            if (supportAllAttributesBydefault ||
                supportedAttributes.Contains(ATTRIBUTE_COLORPOINTBINTENSITY))
            {
                var attrib = new ZclAttribute(this, ATTRIBUTE_COLORPOINTBINTENSITY, "ColorPointBIntensity", ZclHelper.UINT8_TYPE, false, true);
                m_attributeList.Add(attrib.Id, attrib);
            }

            // move to hue command
            var command   = new ZclCommand(this, COMMAND_MOVETOHUE, "MoveToHue", false);
            var parameter = new ZclValue(ZclHelper.UINT8_TYPE, "Hue");

            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.ENUMERATION_8_BIT_TYPE, "Direction");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT16_TYPE, "TransitionTime");
            command.AddInParam(parameter);
            m_commandList.Add(command.Id, command);

            // move hue command
            command   = new ZclCommand(this, COMMAND_MOVEHUE, "MoveHue", false);
            parameter = new ZclValue(ZclHelper.ENUMERATION_8_BIT_TYPE, "MoveMode");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT8_TYPE, "Rate");
            command.AddInParam(parameter);
            m_commandList.Add(command.Id, command);

            // step hue command
            command   = new ZclCommand(this, COMMAND_STEPHUE, "StepHue", false);
            parameter = new ZclValue(ZclHelper.ENUMERATION_8_BIT_TYPE, "StepMode");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT8_TYPE, "StepSize");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT8_TYPE, "TransitionTime");
            command.AddInParam(parameter);
            m_commandList.Add(command.Id, command);

            // move to saturation command
            command   = new ZclCommand(this, COMMAND_MOVETOSATURATION, "MoveToSaturation", false);
            parameter = new ZclValue(ZclHelper.UINT8_TYPE, "Saturation");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT16_TYPE, "TransitionTime");
            command.AddInParam(parameter);
            m_commandList.Add(command.Id, command);

            // move saturation command
            command   = new ZclCommand(this, COMMAND_MOVESATURATION, "MoveSaturation", false);
            parameter = new ZclValue(ZclHelper.ENUMERATION_8_BIT_TYPE, "MoveMode");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT8_TYPE, "Rate");
            command.AddInParam(parameter);
            m_commandList.Add(command.Id, command);

            // step saturation command
            command   = new ZclCommand(this, COMMAND_STEPSATURATION, "StepSaturation", false);
            parameter = new ZclValue(ZclHelper.ENUMERATION_8_BIT_TYPE, "StepMode");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT8_TYPE, "StepSize");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT8_TYPE, "TransitionTime");
            command.AddInParam(parameter);
            m_commandList.Add(command.Id, command);

            // move hue and saturation command
            command   = new ZclCommand(this, COMMAND_MOVETOHUEANDSATURATION, "MoveHueAndSaturation", false);
            parameter = new ZclValue(ZclHelper.UINT8_TYPE, "Hue");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT8_TYPE, "Saturation");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT16_TYPE, "TransitionTime");
            command.AddInParam(parameter);
            m_commandList.Add(command.Id, command);

            // move to color command
            command   = new ZclCommand(this, COMMAND_MOVETOCOLOR, "MoveToColor", false);
            parameter = new ZclValue(ZclHelper.UINT16_TYPE, "ColorX");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT16_TYPE, "ColorY");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT16_TYPE, "TransitionTime");
            command.AddInParam(parameter);
            m_commandList.Add(command.Id, command);

            // move color command
            command   = new ZclCommand(this, COMMAND_MOVECOLOR, "MoveColor", false);
            parameter = new ZclValue(ZclHelper.INT16_TYPE, "RateX");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.INT16_TYPE, "RateY");
            command.AddInParam(parameter);
            m_commandList.Add(command.Id, command);

            // step color command
            command   = new ZclCommand(this, COMMAND_STEPCOLOR, "StepColor", false);
            parameter = new ZclValue(ZclHelper.INT16_TYPE, "StepX");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.INT16_TYPE, "StepY");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT16_TYPE, "TransitionTime");
            command.AddInParam(parameter);
            m_commandList.Add(command.Id, command);

            // move to color temperature command
            command   = new ZclCommand(this, COMMAND_MOVETOCOLORTEMPERATURE, "MoveToColorTemperature", false);
            parameter = new ZclValue(ZclHelper.UINT16_TYPE, "ColorTemperature");
            command.AddInParam(parameter);
            parameter = new ZclValue(ZclHelper.UINT16_TYPE, "TransitionTime");
            command.AddInParam(parameter);
            m_commandList.Add(command.Id, command);

            // call parent class "post constructor"
            PostChildClassConstructor();
        }