Esempio n. 1
0
        // Attribute initialisation
        protected override Dictionary <ushort, ZclAttribute> InitializeAttributes()
        {
            Dictionary <ushort, ZclAttribute> attributeMap = new Dictionary <ushort, ZclAttribute>(7);

            ZclClusterType occupancysensing = ZclClusterType.GetValueById(ClusterType.OCCUPANCY_SENSING);

            attributeMap.Add(ATTR_OCCUPANCY, new ZclAttribute(occupancysensing, ATTR_OCCUPANCY, "Occupancy", ZclDataType.Get(DataType.BITMAP_8_BIT), true, true, false, true));
            attributeMap.Add(ATTR_OCCUPANCYSENSORTYPE, new ZclAttribute(occupancysensing, ATTR_OCCUPANCYSENSORTYPE, "OccupancySensorType", ZclDataType.Get(DataType.ENUMERATION_8_BIT), true, true, false, false));
            attributeMap.Add(ATTR_PIROCCUPIEDTOUNOCCUPIEDDELAY, new ZclAttribute(occupancysensing, ATTR_PIROCCUPIEDTOUNOCCUPIEDDELAY, "PIROccupiedToUnoccupiedDelay", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, true, false));
            attributeMap.Add(ATTR_PIRUNOCCUPIEDTOOCCUPIEDDELAY, new ZclAttribute(occupancysensing, ATTR_PIRUNOCCUPIEDTOOCCUPIEDDELAY, "PIRUnoccupiedToOccupiedDelay", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, true, false));
            attributeMap.Add(ATTR_ULTRASONICOCCUPIEDTOUNOCCUPIEDDELAY, new ZclAttribute(occupancysensing, ATTR_ULTRASONICOCCUPIEDTOUNOCCUPIEDDELAY, "UltraSonicOccupiedToUnoccupiedDelay", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, true, false));
            attributeMap.Add(ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDDELAY, new ZclAttribute(occupancysensing, ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDDELAY, "UltraSonicUnoccupiedToOccupiedDelay", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, true, false));
            attributeMap.Add(ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDTHRESHOLD, new ZclAttribute(occupancysensing, ATTR_ULTRASONICUNOCCUPIEDTOOCCUPIEDTHRESHOLD, "UltrasonicUnoccupiedToOccupiedThreshold", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, true, false));

            return(attributeMap);
        }
        // Attribute initialisation
        protected override Dictionary <ushort, ZclAttribute> InitializeAttributes()
        {
            Dictionary <ushort, ZclAttribute> attributeMap = new Dictionary <ushort, ZclAttribute>(7);

            ZclClusterType pollControl = ZclClusterType.GetValueById(ClusterType.POLL_CONTROL);

            attributeMap.Add(ATTR_CHECKININTERVAL, new ZclAttribute(pollControl, ATTR_CHECKININTERVAL, "CheckinInterval", ZclDataType.Get(DataType.UNSIGNED_32_BIT_INTEGER), true, true, true, true));
            attributeMap.Add(ATTR_LONGPOLLINTERVAL, new ZclAttribute(pollControl, ATTR_LONGPOLLINTERVAL, "LongPollInterval", ZclDataType.Get(DataType.UNSIGNED_32_BIT_INTEGER), true, true, false, true));
            attributeMap.Add(ATTR_SHORTPOLLINTERVAL, new ZclAttribute(pollControl, ATTR_SHORTPOLLINTERVAL, "ShortPollInterval", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, true));
            attributeMap.Add(ATTR_FASTPOLLTIMEOUT, new ZclAttribute(pollControl, ATTR_FASTPOLLTIMEOUT, "FastPollTimeout", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, true));
            attributeMap.Add(ATTR_CHECKININTERVALMIN, new ZclAttribute(pollControl, ATTR_CHECKININTERVALMIN, "CheckinIntervalMin", ZclDataType.Get(DataType.UNSIGNED_32_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_LONGPOLLINTERVALMIN, new ZclAttribute(pollControl, ATTR_LONGPOLLINTERVALMIN, "LongPollIntervalMin", ZclDataType.Get(DataType.UNSIGNED_32_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_FASTPOLLTIMEOUTMIN, new ZclAttribute(pollControl, ATTR_FASTPOLLTIMEOUTMIN, "FastPollTimeoutMin", ZclDataType.Get(DataType.UNSIGNED_32_BIT_INTEGER), false, true, false, false));

            return(attributeMap);
        }
Esempio n. 3
0
        // Attribute initialisation
        protected override Dictionary <ushort, ZclAttribute> InitializeAttributes()
        {
            Dictionary <ushort, ZclAttribute> attributeMap = new Dictionary <ushort, ZclAttribute>(7);

            ZclClusterType iASZone = ZclClusterType.GetValueById(ClusterType.IAS_ZONE);

            attributeMap.Add(ATTR_ZONESTATE, new ZclAttribute(iASZone, ATTR_ZONESTATE, "ZoneState", ZclDataType.Get(DataType.ENUMERATION_8_BIT), true, true, false, false));
            attributeMap.Add(ATTR_ZONETYPE, new ZclAttribute(iASZone, ATTR_ZONETYPE, "ZoneType", ZclDataType.Get(DataType.ENUMERATION_16_BIT), true, true, false, false));
            attributeMap.Add(ATTR_ZONESTATUS, new ZclAttribute(iASZone, ATTR_ZONESTATUS, "ZoneStatus", ZclDataType.Get(DataType.BITMAP_16_BIT), true, true, false, false));
            attributeMap.Add(ATTR_IASCIEADDRESS, new ZclAttribute(iASZone, ATTR_IASCIEADDRESS, "IASCIEAddress", ZclDataType.Get(DataType.IEEE_ADDRESS), true, true, true, false));
            attributeMap.Add(ATTR_ZONEID, new ZclAttribute(iASZone, ATTR_ZONEID, "ZoneID", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), true, true, true, false));
            attributeMap.Add(ATTR_NUMBEROFZONESENSITIVITYLEVELSSUPPORTED, new ZclAttribute(iASZone, ATTR_NUMBEROFZONESENSITIVITYLEVELSSUPPORTED, "NumberOfZoneSensitivityLevelsSupported", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_CURRENTZONESENSITIVITYLEVEL, new ZclAttribute(iASZone, ATTR_CURRENTZONESENSITIVITYLEVEL, "CurrentZoneSensitivityLevel", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, true, false));

            return(attributeMap);
        }
Esempio n. 4
0
        // Attribute initialisation
        protected override Dictionary <ushort, ZclAttribute> InitializeAttributes()
        {
            Dictionary <ushort, ZclAttribute> attributeMap = new Dictionary <ushort, ZclAttribute>(7);

            ZclClusterType levelControl = ZclClusterType.GetValueById(ClusterType.LEVEL_CONTROL);

            attributeMap.Add(ATTR_CURRENTLEVEL, new ZclAttribute(levelControl, ATTR_CURRENTLEVEL, "CurrentLevel", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), true, true, false, true));
            attributeMap.Add(ATTR_REMAININGTIME, new ZclAttribute(levelControl, ATTR_REMAININGTIME, "RemainingTime", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_ONOFFTRANSITIONTIME, new ZclAttribute(levelControl, ATTR_ONOFFTRANSITIONTIME, "OnOffTransitionTime", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, true, false));
            attributeMap.Add(ATTR_ONLEVEL, new ZclAttribute(levelControl, ATTR_ONLEVEL, "OnLevel", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, true, false));
            attributeMap.Add(ATTR_ONTRANSITIONTIME, new ZclAttribute(levelControl, ATTR_ONTRANSITIONTIME, "OnTransitionTime", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, true, false));
            attributeMap.Add(ATTR_OFFTRANSITIONTIME, new ZclAttribute(levelControl, ATTR_OFFTRANSITIONTIME, "OffTransitionTime", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, true, false));
            attributeMap.Add(ATTR_DEFAULTMOVERATE, new ZclAttribute(levelControl, ATTR_DEFAULTMOVERATE, "DefaultMoveRate", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, true, false));

            return(attributeMap);
        }
Esempio n. 5
0
        // Attribute initialisation
        protected override Dictionary <ushort, ZclAttribute> InitializeAttributes()
        {
            Dictionary <ushort, ZclAttribute> attributeMap = new Dictionary <ushort, ZclAttribute>(8);

            ZclClusterType time = ZclClusterType.GetValueById(ClusterType.TIME);

            attributeMap.Add(ATTR_TIME, new ZclAttribute(time, ATTR_TIME, "Time", ZclDataType.Get(DataType.UTCTIME), true, true, true, false));
            attributeMap.Add(ATTR_TIMESTATUS, new ZclAttribute(time, ATTR_TIMESTATUS, "TimeStatus", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, true, false));
            attributeMap.Add(ATTR_TIMEZONE, new ZclAttribute(time, ATTR_TIMEZONE, "TimeZone", ZclDataType.Get(DataType.SIGNED_32_BIT_INTEGER), false, true, true, false));
            attributeMap.Add(ATTR_DSTSTART, new ZclAttribute(time, ATTR_DSTSTART, "DstStart", ZclDataType.Get(DataType.UNSIGNED_32_BIT_INTEGER), false, true, true, false));
            attributeMap.Add(ATTR_DSTEND, new ZclAttribute(time, ATTR_DSTEND, "DstEnd", ZclDataType.Get(DataType.UNSIGNED_32_BIT_INTEGER), false, true, true, false));
            attributeMap.Add(ATTR_DSTSHIFT, new ZclAttribute(time, ATTR_DSTSHIFT, "DstShift", ZclDataType.Get(DataType.SIGNED_32_BIT_INTEGER), false, true, true, false));
            attributeMap.Add(ATTR_STANDARDTIME, new ZclAttribute(time, ATTR_STANDARDTIME, "StandardTime", ZclDataType.Get(DataType.SIGNED_32_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_LOCALTIME, new ZclAttribute(time, ATTR_LOCALTIME, "LocalTime", ZclDataType.Get(DataType.SIGNED_32_BIT_INTEGER), false, true, false, false));

            return(attributeMap);
        }
Esempio n. 6
0
        // Attribute initialisation
        protected override Dictionary <ushort, ZclAttribute> InitializeAttributes()
        {
            Dictionary <ushort, ZclAttribute> attributeMap = new Dictionary <ushort, ZclAttribute>(8);

            ZclClusterType multistateInputBasic = ZclClusterType.GetValueById(ClusterType.MULTISTATE_INPUT__BASIC);

            attributeMap.Add(ATTR_STATETEXT, new ZclAttribute(multistateInputBasic, ATTR_STATETEXT, "StateText", ZclDataType.Get(DataType.CHARACTER_STRING), false, true, true, false));
            attributeMap.Add(ATTR_DESCRIPTION, new ZclAttribute(multistateInputBasic, ATTR_DESCRIPTION, "Description", ZclDataType.Get(DataType.CHARACTER_STRING), false, true, true, false));
            attributeMap.Add(ATTR_NUMBEROFSTATES, new ZclAttribute(multistateInputBasic, ATTR_NUMBEROFSTATES, "NumberOfStates", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, true, false));
            attributeMap.Add(ATTR_OUTOFSERVICE, new ZclAttribute(multistateInputBasic, ATTR_OUTOFSERVICE, "OutOfService", ZclDataType.Get(DataType.BOOLEAN), true, true, true, false));
            attributeMap.Add(ATTR_PRESENTVALUE, new ZclAttribute(multistateInputBasic, ATTR_PRESENTVALUE, "PresentValue", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, true, false));
            attributeMap.Add(ATTR_RELIABILITY, new ZclAttribute(multistateInputBasic, ATTR_RELIABILITY, "Reliability", ZclDataType.Get(DataType.ENUMERATION_8_BIT), false, true, true, false));
            attributeMap.Add(ATTR_STATUSFLAGS, new ZclAttribute(multistateInputBasic, ATTR_STATUSFLAGS, "StatusFlags", ZclDataType.Get(DataType.BITMAP_8_BIT), true, true, false, false));
            attributeMap.Add(ATTR_APPLICATIONTYPE, new ZclAttribute(multistateInputBasic, ATTR_APPLICATIONTYPE, "ApplicationType", ZclDataType.Get(DataType.SIGNED_32_BIT_INTEGER), false, true, false, false));

            return(attributeMap);
        }
        // Attribute initialisation
        protected override Dictionary <ushort, ZclAttribute> InitializeAttributes()
        {
            Dictionary <ushort, ZclAttribute> attributeMap = new Dictionary <ushort, ZclAttribute>(9);

            ZclClusterType pressuremeasurement = ZclClusterType.GetValueById(ClusterType.PRESSURE_MEASUREMENT);

            attributeMap.Add(ATTR_MEASUREDVALUE, new ZclAttribute(pressuremeasurement, ATTR_MEASUREDVALUE, "MeasuredValue", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), true, true, false, true));
            attributeMap.Add(ATTR_MINMEASUREDVALUE, new ZclAttribute(pressuremeasurement, ATTR_MINMEASUREDVALUE, "MinMeasuredValue", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_MAXMEASUREDVALUE, new ZclAttribute(pressuremeasurement, ATTR_MAXMEASUREDVALUE, "MaxMeasuredValue", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), true, true, false, true));
            attributeMap.Add(ATTR_TOLERANCE, new ZclAttribute(pressuremeasurement, ATTR_TOLERANCE, "Tolerance", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_SCALEDVALUE, new ZclAttribute(pressuremeasurement, ATTR_SCALEDVALUE, "ScaledValue", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), false, true, false, true));
            attributeMap.Add(ATTR_MINSCALEDVALUE, new ZclAttribute(pressuremeasurement, ATTR_MINSCALEDVALUE, "MinScaledValue", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_MAXSCALEDVALUE, new ZclAttribute(pressuremeasurement, ATTR_MAXSCALEDVALUE, "MaxScaledValue", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_SCALEDTOLERANCE, new ZclAttribute(pressuremeasurement, ATTR_SCALEDTOLERANCE, "ScaledTolerance", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, true));
            attributeMap.Add(ATTR_SCALE, new ZclAttribute(pressuremeasurement, ATTR_SCALE, "Scale", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, false, false));

            return(attributeMap);
        }
Esempio n. 8
0
        public ZclCluster GetClusterClass(ushort clusterId)
        {
            ZclClusterType clusterType = ZclClusterType.GetValueById(clusterId);

            if (clusterType == null)
            {
                // Unsupported cluster
                Log.Debug("{Endpoint}: Unsupported cluster {Cluster}", GetEndpointAddress(), clusterId);
                return(null);
            }

            // Create a cluster class
            //if (clusterType.ClusterClass != null)
            //    return (ZclCluster)Activator.CreateInstance(clusterType.ClusterClass, this);
            //else
            //    return null;

            return(clusterType.ClusterFactory(this));
        }
Esempio n. 9
0
        public ZclCluster GetClusterClass(ushort clusterId)
        {
            ZclClusterType clusterType = ZclClusterType.GetValueById(clusterId);

            if (clusterType == null)
            {
                // Unsupported cluster
                _logger.Debug("{Endpoint}: Unsupported cluster {Cluster}", GetEndpointAddress(), clusterId);
                return(null);
            }

            // Create a cluster class
            if (clusterType.ClusterClass != null)
            {
                return((ZclCluster)Activator.CreateInstance(clusterType.ClusterClass, this));
            }
            else
            {
                return(null);
            }
        }
Esempio n. 10
0
        // Attribute initialisation
        protected override Dictionary <ushort, ZclAttribute> InitializeAttributes()
        {
            Dictionary <ushort, ZclAttribute> attributeMap = new Dictionary <ushort, ZclAttribute>(30);

            ZclClusterType diagnostics = ZclClusterType.GetValueById(ClusterType.DIAGNOSTICS);

            attributeMap.Add(ATTR_MACRXBCAST, new ZclAttribute(diagnostics, ATTR_MACRXBCAST, "MacRxBcast", ZclDataType.Get(DataType.UNSIGNED_32_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_MACTXBCAST, new ZclAttribute(diagnostics, ATTR_MACTXBCAST, "MacTxBcast", ZclDataType.Get(DataType.UNSIGNED_32_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_MACRXUCAST, new ZclAttribute(diagnostics, ATTR_MACRXUCAST, "MacRxUcast", ZclDataType.Get(DataType.UNSIGNED_32_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_MACTXUCAST, new ZclAttribute(diagnostics, ATTR_MACTXUCAST, "MacTxUcast", ZclDataType.Get(DataType.UNSIGNED_32_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_MACTXUCASTRETRY, new ZclAttribute(diagnostics, ATTR_MACTXUCASTRETRY, "MacTxUcastRetry", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_MACTXUCASTFAIL, new ZclAttribute(diagnostics, ATTR_MACTXUCASTFAIL, "MacTxUcastFail", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_APSRXBCAST, new ZclAttribute(diagnostics, ATTR_APSRXBCAST, "APSRxBcast", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_APSTXBCAST, new ZclAttribute(diagnostics, ATTR_APSTXBCAST, "APSTxBcast", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_APSRXUCAST, new ZclAttribute(diagnostics, ATTR_APSRXUCAST, "APSRxUcast", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_APSTXUCASTSUCCESS, new ZclAttribute(diagnostics, ATTR_APSTXUCASTSUCCESS, "APSTxUcastSuccess", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_APSTXUCASTRETRY, new ZclAttribute(diagnostics, ATTR_APSTXUCASTRETRY, "APSTxUcastRetry", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_APSTXUCASTFAIL, new ZclAttribute(diagnostics, ATTR_APSTXUCASTFAIL, "APSTxUcastFail", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_ROUTEDISCINITIATED, new ZclAttribute(diagnostics, ATTR_ROUTEDISCINITIATED, "RouteDiscInitiated", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_NEIGHBORADDED, new ZclAttribute(diagnostics, ATTR_NEIGHBORADDED, "NeighborAdded", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_NEIGHBORREMOVED, new ZclAttribute(diagnostics, ATTR_NEIGHBORREMOVED, "NeighborRemoved", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_NEIGHBORSTALE, new ZclAttribute(diagnostics, ATTR_NEIGHBORSTALE, "NeighborStale", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_JOININDICATION, new ZclAttribute(diagnostics, ATTR_JOININDICATION, "JoinIndication", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_CHILDMOVED, new ZclAttribute(diagnostics, ATTR_CHILDMOVED, "ChildMoved", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_NWKFCFAILURE, new ZclAttribute(diagnostics, ATTR_NWKFCFAILURE, "NWKFCFailure", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_APSFCFAILURE, new ZclAttribute(diagnostics, ATTR_APSFCFAILURE, "APSFCFailure", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_APSUNAUTHORIZEDKEY, new ZclAttribute(diagnostics, ATTR_APSUNAUTHORIZEDKEY, "APSUnauthorizedKey", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_NWKDECRYPTFAILURES, new ZclAttribute(diagnostics, ATTR_NWKDECRYPTFAILURES, "NWKDecryptFailures", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_APSDECRYPTFAILURES, new ZclAttribute(diagnostics, ATTR_APSDECRYPTFAILURES, "APSDecryptFailures", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_PACKETBUFFERALLOCATEFAILURES, new ZclAttribute(diagnostics, ATTR_PACKETBUFFERALLOCATEFAILURES, "PacketBufferAllocateFailures", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_RELAYEDUCAST, new ZclAttribute(diagnostics, ATTR_RELAYEDUCAST, "RelayedUcast", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_PHYTOMACQUEUELIMITREACHED, new ZclAttribute(diagnostics, ATTR_PHYTOMACQUEUELIMITREACHED, "PhytoMACqueuelimitreached", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_PACKETVALIDATEDROPCOUNT, new ZclAttribute(diagnostics, ATTR_PACKETVALIDATEDROPCOUNT, "PacketValidatedropcount", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_AVERAGEMACRETRYPERAPSMESSAGESENT, new ZclAttribute(diagnostics, ATTR_AVERAGEMACRETRYPERAPSMESSAGESENT, "AverageMACRetryPerAPSMessageSent", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_LASTMESSAGELQI, new ZclAttribute(diagnostics, ATTR_LASTMESSAGELQI, "LastMessageLQI", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_LASTMESSAGERSSI, new ZclAttribute(diagnostics, ATTR_LASTMESSAGERSSI, "LastMessageRSSI", ZclDataType.Get(DataType.SIGNED_8_BIT_INTEGER), true, true, false, false));

            return(attributeMap);
        }
Esempio n. 11
0
        // Attribute initialisation
        protected override Dictionary <ushort, ZclAttribute> InitializeAttributes()
        {
            Dictionary <ushort, ZclAttribute> attributeMap = new Dictionary <ushort, ZclAttribute>(13);

            ZclClusterType rSSILocation = ZclClusterType.GetValueById(ClusterType.RSSI_LOCATION);

            attributeMap.Add(ATTR_LOCATIONTYPE, new ZclAttribute(rSSILocation, ATTR_LOCATIONTYPE, "LocationType", ZclDataType.Get(DataType.DATA_8_BIT), true, true, false, false));
            attributeMap.Add(ATTR_LOCATIONMETHOD, new ZclAttribute(rSSILocation, ATTR_LOCATIONMETHOD, "LocationMethod", ZclDataType.Get(DataType.ENUMERATION_8_BIT), true, true, false, false));
            attributeMap.Add(ATTR_LOCATIONAGE, new ZclAttribute(rSSILocation, ATTR_LOCATIONAGE, "LocationAge", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_QUALITYMEASURE, new ZclAttribute(rSSILocation, ATTR_QUALITYMEASURE, "QualityMeasure", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_NUMBEROFDEVICES, new ZclAttribute(rSSILocation, ATTR_NUMBEROFDEVICES, "NumberOfDevices", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_COORDINATE1, new ZclAttribute(rSSILocation, ATTR_COORDINATE1, "Coordinate1", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), true, true, true, false));
            attributeMap.Add(ATTR_COORDINATE2, new ZclAttribute(rSSILocation, ATTR_COORDINATE2, "Coordinate2", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), true, true, true, false));
            attributeMap.Add(ATTR_COORDINATE3, new ZclAttribute(rSSILocation, ATTR_COORDINATE3, "Coordinate3", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), false, true, true, false));
            attributeMap.Add(ATTR_POWER, new ZclAttribute(rSSILocation, ATTR_POWER, "Power", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), true, true, true, false));
            attributeMap.Add(ATTR_PATHLOSSEXPONENT, new ZclAttribute(rSSILocation, ATTR_PATHLOSSEXPONENT, "PathLossExponent", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), true, true, true, false));
            attributeMap.Add(ATTR_REPORTINGPERIOD, new ZclAttribute(rSSILocation, ATTR_REPORTINGPERIOD, "ReportingPeriod", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), false, true, true, false));
            attributeMap.Add(ATTR_CALCULATIONPERIOD, new ZclAttribute(rSSILocation, ATTR_CALCULATIONPERIOD, "CalculationPeriod", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), false, true, true, false));
            attributeMap.Add(ATTR_NUMBERRSSIMEASUREMENTS, new ZclAttribute(rSSILocation, ATTR_NUMBERRSSIMEASUREMENTS, "NumberRSSIMeasurements", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), false, true, true, false));

            return(attributeMap);
        }
Esempio n. 12
0
        // Attribute initialisation
        protected override Dictionary <ushort, ZclAttribute> InitializeAttributes()
        {
            Dictionary <ushort, ZclAttribute> attributeMap = new Dictionary <ushort, ZclAttribute>(14);

            ZclClusterType electricalMeasurement = ZclClusterType.GetValueById(ClusterType.ELECTRICAL_MEASUREMENT);

            attributeMap.Add(ATTR_MEASUREMENTTYPE, new ZclAttribute(electricalMeasurement, ATTR_MEASUREMENTTYPE, "MeasurementType", ZclDataType.Get(DataType.BITMAP_32_BIT), true, true, false, false));
            attributeMap.Add(ATTR_ACFREQUENCY, new ZclAttribute(electricalMeasurement, ATTR_ACFREQUENCY, "ACFrequency", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_TOTALACTIVEPOWER, new ZclAttribute(electricalMeasurement, ATTR_TOTALACTIVEPOWER, "TotalActivePower", ZclDataType.Get(DataType.SIGNED_32_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_TOTALREACTIVEPOWER, new ZclAttribute(electricalMeasurement, ATTR_TOTALREACTIVEPOWER, "TotalReactivePower", ZclDataType.Get(DataType.SIGNED_32_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_TOTALAPPARENTPOWER, new ZclAttribute(electricalMeasurement, ATTR_TOTALAPPARENTPOWER, "TotalApparentPower", ZclDataType.Get(DataType.UNSIGNED_32_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_RMSVOLTAGE, new ZclAttribute(electricalMeasurement, ATTR_RMSVOLTAGE, "RMSVoltage", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_RMSCURRENT, new ZclAttribute(electricalMeasurement, ATTR_RMSCURRENT, "RMSCurrent", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_ACTIVEPOWER, new ZclAttribute(electricalMeasurement, ATTR_ACTIVEPOWER, "ActivePower", ZclDataType.Get(DataType.SIGNED_16_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_ACVOLTAGEMULTIPLIER, new ZclAttribute(electricalMeasurement, ATTR_ACVOLTAGEMULTIPLIER, "ACVoltageMultiplier", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_ACVOLTAGEDIVISOR, new ZclAttribute(electricalMeasurement, ATTR_ACVOLTAGEDIVISOR, "ACVoltageDivisor", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_ACCURRENTMULTIPLIER, new ZclAttribute(electricalMeasurement, ATTR_ACCURRENTMULTIPLIER, "ACCurrentMultiplier", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_ACCURRENTDIVISOR, new ZclAttribute(electricalMeasurement, ATTR_ACCURRENTDIVISOR, "ACCurrentDivisor", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_ACPOWERMULTIPLIER, new ZclAttribute(electricalMeasurement, ATTR_ACPOWERMULTIPLIER, "ACPowerMultiplier", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, false));
            attributeMap.Add(ATTR_ACPOWERDIVISOR, new ZclAttribute(electricalMeasurement, ATTR_ACPOWERDIVISOR, "ACPowerDivisor", ZclDataType.Get(DataType.UNSIGNED_16_BIT_INTEGER), false, true, false, false));

            return(attributeMap);
        }
Esempio n. 13
0
        // Attribute initialisation
        protected override Dictionary <ushort, ZclAttribute> InitializeAttributes()
        {
            Dictionary <ushort, ZclAttribute> attributeMap = new Dictionary <ushort, ZclAttribute>(14);

            ZclClusterType basic = ZclClusterType.GetValueById(ClusterType.BASIC);

            attributeMap.Add(ATTR_ZCLVERSION, new ZclAttribute(basic, ATTR_ZCLVERSION, "ZCLVersion", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_APPLICATIONVERSION, new ZclAttribute(basic, ATTR_APPLICATIONVERSION, "ApplicationVersion", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_STACKVERSION, new ZclAttribute(basic, ATTR_STACKVERSION, "StackVersion", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_HWVERSION, new ZclAttribute(basic, ATTR_HWVERSION, "HWVersion", ZclDataType.Get(DataType.UNSIGNED_8_BIT_INTEGER), true, true, false, false));
            attributeMap.Add(ATTR_MANUFACTURERNAME, new ZclAttribute(basic, ATTR_MANUFACTURERNAME, "ManufacturerName", ZclDataType.Get(DataType.CHARACTER_STRING), true, true, false, false));
            attributeMap.Add(ATTR_MODELIDENTIFIER, new ZclAttribute(basic, ATTR_MODELIDENTIFIER, "ModelIdentifier", ZclDataType.Get(DataType.CHARACTER_STRING), true, true, false, false));
            attributeMap.Add(ATTR_DATECODE, new ZclAttribute(basic, ATTR_DATECODE, "DateCode", ZclDataType.Get(DataType.CHARACTER_STRING), true, true, false, false));
            attributeMap.Add(ATTR_POWERSOURCE, new ZclAttribute(basic, ATTR_POWERSOURCE, "PowerSource", ZclDataType.Get(DataType.ENUMERATION_8_BIT), true, true, false, false));
            attributeMap.Add(ATTR_LOCATIONDESCRIPTION, new ZclAttribute(basic, ATTR_LOCATIONDESCRIPTION, "LocationDescription", ZclDataType.Get(DataType.CHARACTER_STRING), true, true, true, false));
            attributeMap.Add(ATTR_PHYSICALENVIRONMENT, new ZclAttribute(basic, ATTR_PHYSICALENVIRONMENT, "PhysicalEnvironment", ZclDataType.Get(DataType.ENUMERATION_8_BIT), true, true, true, false));
            attributeMap.Add(ATTR_DEVICEENABLED, new ZclAttribute(basic, ATTR_DEVICEENABLED, "DeviceEnabled", ZclDataType.Get(DataType.BOOLEAN), true, true, true, false));
            attributeMap.Add(ATTR_ALARMMASK, new ZclAttribute(basic, ATTR_ALARMMASK, "AlarmMask", ZclDataType.Get(DataType.BITMAP_8_BIT), true, true, true, false));
            attributeMap.Add(ATTR_DISABLELOCALCONFIG, new ZclAttribute(basic, ATTR_DISABLELOCALCONFIG, "DisableLocalConfig", ZclDataType.Get(DataType.BITMAP_8_BIT), true, true, true, false));
            attributeMap.Add(ATTR_SWBUILDID, new ZclAttribute(basic, ATTR_SWBUILDID, "SWBuildID", ZclDataType.Get(DataType.CHARACTER_STRING), false, true, false, false));

            return(attributeMap);
        }
Esempio n. 14
0
        private void UpdateClusters(ConcurrentDictionary <int, ZclCluster> clusters, List <ushort> newList, bool isInput)
        {
            // Get a list any clusters that are no longer in the list
            List <int> removeIds = new List <int>();

            foreach (ZclCluster cluster in clusters.Values)
            {
                if (newList.Contains(cluster.GetClusterId()))
                {
                    // The existing cluster is in the new list, so no need to remove it
                    continue;
                }

                removeIds.Add(cluster.GetClusterId());
            }

            // Remove clusters no longer in use
            foreach (int id in removeIds)
            {
                Log.Debug("{Endpoint}: Removing cluster {Cluster}", GetEndpointAddress(), id);
                clusters.TryRemove(id, out ZclCluster not_used);
            }

            // Add any missing clusters into the list
            foreach (ushort id in newList)
            {
                if (!clusters.ContainsKey(id))
                {
                    // Get the cluster type
                    ZclCluster clusterClass = GetClusterClass(id);
                    if (clusterClass == null)
                    {
                        continue;
                    }

                    if (isInput)
                    {
                        Log.Debug("{EndpointAddress}: Setting cluster {Cluster} as server", GetEndpointAddress(), ZclClusterType.GetValueById(id));
                        clusterClass.SetServer();
                    }
                    else
                    {
                        Log.Debug("{EndpointAddress}: Setting cluster {Cluster} as client", GetEndpointAddress(), ZclClusterType.GetValueById(id));
                        clusterClass.SetClient();
                    }

                    // Add to our list of clusters
                    clusters.TryAdd(id, clusterClass);
                }
            }
        }
Esempio n. 15
0
        /// <summary>
        /// Sets output cluster IDs.
        ///
        /// @param outputClusterIds
        ///            the output cluster IDs
        /// </summary>
        public void SetOutputClusterIds(List <ushort> outputClusterIds)
        {
            this._outputClusters.Clear();

            Log.Debug("{Endpoint}: Setting output clusters {Clusters}", GetEndpointAddress(), outputClusterIds.Select(c => ZclClusterType.GetValueById(c)?.Label));

            UpdateClusters(_outputClusters, outputClusterIds, false);
        }
Esempio n. 16
0
        /// <summary>
        /// Sets input cluster IDs.
        ///
        /// @param inputClusterIds
        ///            the input cluster IDs
        /// </summary>
        public void SetInputClusterIds(List <ushort> inputClusterIds)
        {
            this._inputClusters.Clear();

            Log.Debug("{Endpoint}: Setting input clusters {Clusters}", GetEndpointAddress(), inputClusterIds.Select(c => ZclClusterType.GetValueById(c)?.Label));

            UpdateClusters(_inputClusters, inputClusterIds, true);
        }