[zb4osgi-changeset] [scm] ZigBee 4 OSGi repository change: r1176 - in /projects/zb4osgi/trunk: zb4o-ha-driver/src/main/java/it/cnr/isti/zigbee/ha/cluster/glue/general/ zb4o-ha-driver/src/main/java/it/cnr/isti/zigbee/ha/cluster/impl/ zb4o-zcl-library/src/main/java/it/cnr/isti/zigbee/zcl/library/api/general/ zb4o-zcl-library/src/main/java/it/cnr/isti/zigbee/zcl/library/impl/attribute/ zb4o-zcl-library/src/main/java/it/cnr/isti/zigbee/zcl/library/impl/general/

scm-notify at zb4osgi.aaloa.org scm-notify at zb4osgi.aaloa.org
Tue Feb 24 17:34:58 CET 2015


Author: giancarlo.riolo
Date: Tue Feb 24 17:34:58 2015
New Revision: 1176

Log:
Proprietary cluster added

Added:
    projects/zb4osgi/trunk/zb4o-ha-driver/src/main/java/it/cnr/isti/zigbee/ha/cluster/glue/general/ProprietaryGlue.java   (with props)
    projects/zb4osgi/trunk/zb4o-ha-driver/src/main/java/it/cnr/isti/zigbee/ha/cluster/impl/ProprietaryImpl.java   (with props)
    projects/zb4osgi/trunk/zb4o-zcl-library/src/main/java/it/cnr/isti/zigbee/zcl/library/api/general/Proprietary.java   (with props)
    projects/zb4osgi/trunk/zb4o-zcl-library/src/main/java/it/cnr/isti/zigbee/zcl/library/impl/attribute/ProprietaryAttributes.java   (with props)
    projects/zb4osgi/trunk/zb4o-zcl-library/src/main/java/it/cnr/isti/zigbee/zcl/library/impl/general/ProprietaryCluster.java   (with props)

Added: projects/zb4osgi/trunk/zb4o-ha-driver/src/main/java/it/cnr/isti/zigbee/ha/cluster/glue/general/ProprietaryGlue.java
==============================================================================
--- projects/zb4osgi/trunk/zb4o-ha-driver/src/main/java/it/cnr/isti/zigbee/ha/cluster/glue/general/ProprietaryGlue.java	(added)
+++ projects/zb4osgi/trunk/zb4o-ha-driver/src/main/java/it/cnr/isti/zigbee/ha/cluster/glue/general/ProprietaryGlue.java	Tue Feb 24 17:34:58 2015
@@ -0,0 +1,53 @@
+/*
+   Copyright 2008-2014 CNR-ISTI, http://isti.cnr.it
+   Institute of Information Science and Technologies
+   of the Italian National Research Council
+
+
+   See the NOTICE file distributed with this work for additional
+   information regarding copyright ownership
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+ */
+
+package it.cnr.isti.zigbee.ha.cluster.glue.general;
+
+import it.cnr.isti.zigbee.ha.cluster.glue.Cluster;
+import it.cnr.isti.zigbee.ha.driver.core.ZigBeeHAException;
+
+/**
+ *
+ * @author <a href="mailto:giancarlo.riolo at isti.cnr.it">Giancarlo Riolo</a>
+ * @version $LastChangedRevision$ ($LastChangedDate$)
+ * @since 0.9.0
+ */
+public interface ProprietaryGlue extends Cluster {
+
+	public boolean getAttributeEP1Enable() throws ZigBeeHAException;
+
+	public float getAttributeVoltageCostant() throws ZigBeeHAException;
+
+	public float getAttributeCurrentCostant() throws ZigBeeHAException;
+
+	public float getAttributeVoltageRMS() throws ZigBeeHAException;
+
+	public float getAttributeCurrentRMS() throws ZigBeeHAException;
+
+	public boolean getAttributeEP2Enable() throws ZigBeeHAException;
+
+	public boolean getAttributeEP3Enable() throws ZigBeeHAException;
+
+	public boolean getAttributeEP4EP5Enable() throws ZigBeeHAException;
+
+	public boolean getAttributeEP9Enable() throws ZigBeeHAException;
+}

Propchange: projects/zb4osgi/trunk/zb4o-ha-driver/src/main/java/it/cnr/isti/zigbee/ha/cluster/glue/general/ProprietaryGlue.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: projects/zb4osgi/trunk/zb4o-ha-driver/src/main/java/it/cnr/isti/zigbee/ha/cluster/impl/ProprietaryImpl.java
==============================================================================
--- projects/zb4osgi/trunk/zb4o-ha-driver/src/main/java/it/cnr/isti/zigbee/ha/cluster/impl/ProprietaryImpl.java	(added)
+++ projects/zb4osgi/trunk/zb4o-ha-driver/src/main/java/it/cnr/isti/zigbee/ha/cluster/impl/ProprietaryImpl.java	Tue Feb 24 17:34:58 2015
@@ -0,0 +1,164 @@
+/*
+   Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it
+   Institute of Information Science and Technologies
+   of the Italian National Research Council
+
+
+   See the NOTICE file distributed with this work for additional
+   information regarding copyright ownership
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+ */
+
+package it.cnr.isti.zigbee.ha.cluster.impl;
+
+import it.cnr.isti.zigbee.api.ZigBeeDevice;
+import it.cnr.isti.zigbee.ha.cluster.glue.general.ProprietaryGlue;
+import it.cnr.isti.zigbee.ha.driver.core.ZigBeeHAException;
+import it.cnr.isti.zigbee.zcl.library.api.core.Attribute;
+import it.cnr.isti.zigbee.zcl.library.api.core.Subscription;
+import it.cnr.isti.zigbee.zcl.library.api.core.ZigBeeClusterException;
+import it.cnr.isti.zigbee.zcl.library.impl.general.ProprietaryCluster;
+
+/**
+ * @author <a href="mailto:giancarlo.riolo at isti.cnr.it">Giancarlo Riolo</a>
+ * @since 0.1.0
+ *
+ */
+public class ProprietaryImpl implements ProprietaryGlue {
+
+	private final ProprietaryCluster proprietaryCluster;
+
+	private final Attribute eP1Enable;
+	private final Attribute voltageCostant;
+	private final Attribute currentCostant;
+	private final Attribute voltageRMS;
+	private final Attribute currentRMS;
+	private final Attribute eP2Enable;
+	private final Attribute eP3Enable;
+	private final Attribute eP4EP5Enable;
+	private final Attribute eP9Enable;
+
+	public ProprietaryImpl(ZigBeeDevice zbDevice) {
+		proprietaryCluster = new ProprietaryCluster(zbDevice);
+
+		eP1Enable = proprietaryCluster.getAttributeEP1Enable();
+		voltageCostant = proprietaryCluster.getAttributeVoltageCostant();
+		currentCostant = proprietaryCluster.getAttributeCurrentCostant();
+		voltageRMS = proprietaryCluster.getAttributeVoltageRMS();
+		currentRMS = proprietaryCluster.getAttributeCurrentRMS();
+		eP2Enable = proprietaryCluster.getAttributeEP2Enable();
+		eP3Enable = proprietaryCluster.getAttributeEP3Enable();
+		eP4EP5Enable = proprietaryCluster.getAttributeEP4EP5Enable();
+		eP9Enable = proprietaryCluster.getAttributeEP9Enable();
+
+	}
+
+	public Attribute[] getAttributes() {
+		return proprietaryCluster.getAvailableAttributes();
+	}
+
+	public Attribute getAttribute(int id) {
+		Attribute[] attributes = proprietaryCluster.getAvailableAttributes();
+		for (int i = 0; i < attributes.length; i++) {
+			if (attributes[i].getId() == id)
+				return attributes[i];
+		}
+		return null;
+	}
+
+	public Subscription[] getActiveSubscriptions() {
+		return proprietaryCluster.getActiveSubscriptions();
+	}
+
+	public int getId() {
+		return proprietaryCluster.getId();
+	}
+
+	public String getName() {
+		return proprietaryCluster.getName();
+	}
+
+	public boolean getAttributeEP1Enable() throws ZigBeeHAException {
+		try {
+			return (Boolean) eP1Enable.getValue();
+		} catch (ZigBeeClusterException e) {
+			throw new ZigBeeHAException(e);
+		}
+	}
+
+	public float getAttributeVoltageCostant() throws ZigBeeHAException {
+		try {
+			return (Float) voltageCostant.getValue();
+		} catch (ZigBeeClusterException e) {
+			throw new ZigBeeHAException(e);
+		}
+	}
+
+	public float getAttributeCurrentCostant() throws ZigBeeHAException {
+		try {
+			return (Float) currentCostant.getValue();
+		} catch (ZigBeeClusterException e) {
+			throw new ZigBeeHAException(e);
+		}
+	}
+
+	public float getAttributeVoltageRMS() throws ZigBeeHAException {
+		try {
+			return (Float) voltageRMS.getValue();
+		} catch (ZigBeeClusterException e) {
+			throw new ZigBeeHAException(e);
+		}
+	}
+
+	public float getAttributeCurrentRMS() throws ZigBeeHAException {
+		try {
+			return (Float) currentRMS.getValue();
+		} catch (ZigBeeClusterException e) {
+			throw new ZigBeeHAException(e);
+		}
+	}
+
+	public boolean getAttributeEP2Enable() throws ZigBeeHAException {
+		try {
+			return (Boolean) eP2Enable.getValue();
+		} catch (ZigBeeClusterException e) {
+			throw new ZigBeeHAException(e);
+		}
+	}
+
+	public boolean getAttributeEP3Enable() throws ZigBeeHAException {
+		try {
+			return (Boolean) eP3Enable.getValue();
+		} catch (ZigBeeClusterException e) {
+			throw new ZigBeeHAException(e);
+		}
+	}
+
+	public boolean getAttributeEP4EP5Enable() throws ZigBeeHAException {
+		try {
+			return (Boolean) eP4EP5Enable.getValue();
+		} catch (ZigBeeClusterException e) {
+			throw new ZigBeeHAException(e);
+		}
+	}
+
+	public boolean getAttributeEP9Enable() throws ZigBeeHAException {
+		try {
+			return (Boolean) eP9Enable.getValue();
+		} catch (ZigBeeClusterException e) {
+			throw new ZigBeeHAException(e);
+		}
+	}
+
+}

Propchange: projects/zb4osgi/trunk/zb4o-ha-driver/src/main/java/it/cnr/isti/zigbee/ha/cluster/impl/ProprietaryImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: projects/zb4osgi/trunk/zb4o-zcl-library/src/main/java/it/cnr/isti/zigbee/zcl/library/api/general/Proprietary.java
==============================================================================
--- projects/zb4osgi/trunk/zb4o-zcl-library/src/main/java/it/cnr/isti/zigbee/zcl/library/api/general/Proprietary.java	(added)
+++ projects/zb4osgi/trunk/zb4o-zcl-library/src/main/java/it/cnr/isti/zigbee/zcl/library/api/general/Proprietary.java	Tue Feb 24 17:34:58 2015
@@ -0,0 +1,52 @@
+/*
+   Copyright 2008-2014 CNR-ISTI, http://isti.cnr.it
+   Institute of Information Science and Technologies
+   of the Italian National Research Council
+
+
+   See the NOTICE file distributed with this work for additional
+   information regarding copyright ownership
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+ */
+
+package it.cnr.isti.zigbee.zcl.library.api.general;
+
+import it.cnr.isti.zigbee.zcl.library.api.core.Attribute;
+import it.cnr.isti.zigbee.zcl.library.api.core.ZCLCluster;
+
+public interface Proprietary extends ZCLCluster {
+
+	public static final short ID = (short) (0xF1CA);
+	static final String NAME = "Proprietary Template";
+	static final String DESCRIPTION = "Proprietary Template cluster";
+
+	public Attribute getAttributeEP1Enable();
+
+	public Attribute getAttributeVoltageCostant();
+
+	public Attribute getAttributeCurrentCostant();
+
+	public Attribute getAttributeVoltageRMS();
+
+	public Attribute getAttributeCurrentRMS();
+
+	public Attribute getAttributeEP2Enable();
+
+	public Attribute getAttributeEP3Enable();
+
+	public Attribute getAttributeEP4EP5Enable();
+
+	public Attribute getAttributeEP9Enable();
+
+}

Propchange: projects/zb4osgi/trunk/zb4o-zcl-library/src/main/java/it/cnr/isti/zigbee/zcl/library/api/general/Proprietary.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: projects/zb4osgi/trunk/zb4o-zcl-library/src/main/java/it/cnr/isti/zigbee/zcl/library/impl/attribute/ProprietaryAttributes.java
==============================================================================
--- projects/zb4osgi/trunk/zb4o-zcl-library/src/main/java/it/cnr/isti/zigbee/zcl/library/impl/attribute/ProprietaryAttributes.java	(added)
+++ projects/zb4osgi/trunk/zb4o-zcl-library/src/main/java/it/cnr/isti/zigbee/zcl/library/impl/attribute/ProprietaryAttributes.java	Tue Feb 24 17:34:58 2015
@@ -0,0 +1,102 @@
+/*
+   Copyright 2008-2014 CNR-ISTI, http://isti.cnr.it
+   Institute of Information Science and Technologies
+   of the Italian National Research Council
+
+
+   See the NOTICE file distributed with this work for additional
+   information regarding copyright ownership
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+ */
+
+package it.cnr.isti.zigbee.zcl.library.impl.attribute;
+
+import it.cnr.isti.zigbee.zcl.library.api.core.ZigBeeType;
+
+
+/**
+ *
+ * @author <a href="mailto:giancarlo.riolo at isti.cnr.it">Giancarlo Riolo</a>
+ * @version $LastChangedRevision: 937 $ ($LastChangedDate: 2014-01-30 18:47:48
+ *          +0100 (gio, 30 gen 2014) $)
+ */
+public class ProprietaryAttributes {
+
+	
+
+	public static final AttributeDescriptor EP1ENABLE = new AbstractAttribute()
+    .setId(0x0000)
+    .setName("EP1Enable")
+    .setReportable(false)
+    .setZigBeeType(ZigBeeType.Boolean)
+    .setWritable(true);
+	
+	public static final AttributeDescriptor VOLTAGECOSTANT = new AbstractAttribute()
+    .setId(0x0001)
+    .setName("VoltageCostant")
+    .setReportable(false)
+    .setZigBeeType(ZigBeeType.SinglePrecision)
+    .setWritable(true);
+	
+	
+	public static final AttributeDescriptor CURRENTCOSTANT = new AbstractAttribute()
+    .setId(0x0002)
+    .setName("EurrentCostant")
+    .setReportable(false)
+    .setZigBeeType(ZigBeeType.SinglePrecision)
+    .setWritable(true);
+
+	public static final AttributeDescriptor VOLTAGERMS = new AbstractAttribute()
+    .setId(0x0003)
+    .setName("VoltageRMS")
+    .setReportable(false)
+    .setZigBeeType(ZigBeeType.SinglePrecision)
+    .setWritable(false);
+	
+	public static final AttributeDescriptor EP3ENABLE = new AbstractAttribute()
+    .setId(0x0020)
+    .setName("EP3Enable")
+    .setReportable(false)
+    .setZigBeeType(ZigBeeType.Boolean)
+    .setWritable(true);
+	
+	public static final AttributeDescriptor EP2ENABLE = new AbstractAttribute()
+    .setId(0x0010)
+    .setName("EP2Enable")
+    .setReportable(false)
+    .setZigBeeType(ZigBeeType.Boolean)
+    .setWritable(true);
+
+	public static final AttributeDescriptor CURRENTRMS = new AbstractAttribute()
+    .setId(0x0004)
+    .setName("CurrentRMS")
+    .setReportable(false)
+    .setZigBeeType(ZigBeeType.SinglePrecision)
+    .setWritable(false);
+	
+	public static final AttributeDescriptor EP9ENABLE = new AbstractAttribute()
+    .setId(0x0040)
+    .setName("EP9Enable")
+    .setReportable(false)
+    .setZigBeeType(ZigBeeType.Boolean)
+    .setWritable(true);
+	
+	public static final AttributeDescriptor EP4EP5ENABLE = new AbstractAttribute()
+    .setId(0x0030)
+    .setName("EP4EP5Enable")
+    .setReportable(false)
+    .setZigBeeType(ZigBeeType.Boolean)
+    .setWritable(true);
+
+}

Propchange: projects/zb4osgi/trunk/zb4o-zcl-library/src/main/java/it/cnr/isti/zigbee/zcl/library/impl/attribute/ProprietaryAttributes.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: projects/zb4osgi/trunk/zb4o-zcl-library/src/main/java/it/cnr/isti/zigbee/zcl/library/impl/general/ProprietaryCluster.java
==============================================================================
--- projects/zb4osgi/trunk/zb4o-zcl-library/src/main/java/it/cnr/isti/zigbee/zcl/library/impl/general/ProprietaryCluster.java	(added)
+++ projects/zb4osgi/trunk/zb4o-zcl-library/src/main/java/it/cnr/isti/zigbee/zcl/library/impl/general/ProprietaryCluster.java	Tue Feb 24 17:34:58 2015
@@ -0,0 +1,130 @@
+/*
+   Copyright 2008-2014 CNR-ISTI, http://isti.cnr.it
+   Institute of Information Science and Technologies
+   of the Italian National Research Council
+
+
+   See the NOTICE file distributed with this work for additional
+   information regarding copyright ownership
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+ */
+
+package it.cnr.isti.zigbee.zcl.library.impl.general;
+
+import it.cnr.isti.zigbee.api.ZigBeeDevice;
+import it.cnr.isti.zigbee.zcl.library.api.core.Attribute;
+import it.cnr.isti.zigbee.zcl.library.api.general.Proprietary;
+import it.cnr.isti.zigbee.zcl.library.impl.attribute.ProprietaryAttributes;
+import it.cnr.isti.zigbee.zcl.library.impl.core.AttributeImpl;
+import it.cnr.isti.zigbee.zcl.library.impl.core.ZCLClusterBase;
+
+/**
+ *
+ * @author <a href="mailto:giancarlo.riolo at isti.cnr.it">Giancarlo Riolo</a>
+ * @version $LastChangedRevision$ ($LastChangedDate$)
+ * @since 0.9.0
+ *
+ */
+public class ProprietaryCluster extends ZCLClusterBase implements Proprietary {
+
+	private final AttributeImpl eP1Enable;
+	private final AttributeImpl voltageCostant;
+	private final AttributeImpl currentCostant;
+	private final AttributeImpl voltageRMS;
+	private final AttributeImpl currentRMS;
+	private final AttributeImpl eP2Enable;
+	private final AttributeImpl eP3Enable;
+	private final AttributeImpl eP4EP5Enable;
+	private final AttributeImpl eP9Enable;
+
+	private final Attribute[] attributes;
+
+	public ProprietaryCluster(ZigBeeDevice zbDevice) {
+		super(zbDevice);
+		eP1Enable = new AttributeImpl(zbDevice, this,
+				ProprietaryAttributes.EP1ENABLE);
+		voltageCostant = new AttributeImpl(zbDevice, this,
+				ProprietaryAttributes.VOLTAGECOSTANT);
+		currentCostant = new AttributeImpl(zbDevice, this,
+				ProprietaryAttributes.CURRENTCOSTANT);
+		voltageRMS = new AttributeImpl(zbDevice, this,
+				ProprietaryAttributes.VOLTAGERMS);
+		currentRMS = new AttributeImpl(zbDevice, this,
+				ProprietaryAttributes.CURRENTRMS);
+		eP2Enable = new AttributeImpl(zbDevice, this,
+				ProprietaryAttributes.EP2ENABLE);
+		eP3Enable = new AttributeImpl(zbDevice, this,
+				ProprietaryAttributes.EP3ENABLE);
+		eP4EP5Enable = new AttributeImpl(zbDevice, this,
+				ProprietaryAttributes.EP4EP5ENABLE);
+		eP9Enable = new AttributeImpl(zbDevice, this,
+				ProprietaryAttributes.EP9ENABLE);
+
+		attributes = new AttributeImpl[] { eP1Enable, voltageCostant,
+				currentCostant, voltageRMS, currentRMS, eP2Enable, eP3Enable,
+				eP4EP5Enable, eP9Enable };
+	}
+
+	public Attribute getAttributeEP1Enable() {
+		return eP1Enable;
+	}
+
+	public Attribute getAttributeVoltageCostant() {
+		return voltageCostant;
+	}
+
+	public Attribute getAttributeCurrentCostant() {
+		return currentCostant;
+	}
+
+	public Attribute getAttributeVoltageRMS() {
+		return voltageRMS;
+	}
+
+	public Attribute getAttributeCurrentRMS() {
+		return currentRMS;
+	}
+
+	public Attribute getAttributeEP2Enable() {
+		return eP2Enable;
+	}
+
+	public Attribute getAttributeEP3Enable() {
+		return eP3Enable;
+	}
+
+	public Attribute getAttributeEP4EP5Enable() {
+		return eP4EP5Enable;
+	}
+
+	public Attribute getAttributeEP9Enable() {
+		return eP9Enable;
+	}
+
+	@Override
+	public short getId() {
+		return Proprietary.ID;
+	}
+
+	@Override
+	public String getName() {
+		return Proprietary.NAME;
+	}
+
+	@Override
+	public Attribute[] getStandardAttributes() {
+		return attributes;
+	}
+
+}

Propchange: projects/zb4osgi/trunk/zb4o-zcl-library/src/main/java/it/cnr/isti/zigbee/zcl/library/impl/general/ProprietaryCluster.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the Commit mailing list