[zb4osgi-changeset] [scm] ZigBee 4 OSGi repository change: r1084 - in /projects/zb4osgi/trunk/zigbee.cc2480.datalink/src/main/java/com/itaca/ztool/api/af: AF_DATA_REQUEST.java AF_INCOMING_MSG.java

scm-notify at zb4osgi.aaloa.org scm-notify at zb4osgi.aaloa.org
Tue Nov 4 01:09:20 CET 2014


Author: stefano.lenzi
Date: Tue Nov  4 01:09:20 2014
New Revision: 1084

Log:
Setting some fields as attribute and preparing for delting them


Modified:
    projects/zb4osgi/trunk/zigbee.cc2480.datalink/src/main/java/com/itaca/ztool/api/af/AF_DATA_REQUEST.java
    projects/zb4osgi/trunk/zigbee.cc2480.datalink/src/main/java/com/itaca/ztool/api/af/AF_INCOMING_MSG.java

Modified: projects/zb4osgi/trunk/zigbee.cc2480.datalink/src/main/java/com/itaca/ztool/api/af/AF_DATA_REQUEST.java
==============================================================================
--- projects/zb4osgi/trunk/zigbee.cc2480.datalink/src/main/java/com/itaca/ztool/api/af/AF_DATA_REQUEST.java	(original)
+++ projects/zb4osgi/trunk/zigbee.cc2480.datalink/src/main/java/com/itaca/ztool/api/af/AF_DATA_REQUEST.java	Tue Nov  4 01:09:20 2014
@@ -38,31 +38,40 @@
 public class AF_DATA_REQUEST extends ZToolPacket/* implements IREQUEST,IAF*/{
     /// <name>TI.ZPI2.AF_DATA_REQUEST.ClusterID</name>
         /// <summary>specifies the cluster ID</summary>
-        public DoubleByte ClusterID;
+        @Deprecated
+        protected DoubleByte ClusterID;
         /// <name>TI.ZPI2.AF_DATA_REQUEST.Data</name>
         /// <summary>Dynamic array, requires memory allocation.  Variable length field of size 'Len' and is the transaction data frame</summary>
-        public int[] Data;
+        @Deprecated
+        protected int[] Data;
         /// <name>TI.ZPI2.AF_DATA_REQUEST.DestEndpoint</name>
         /// <summary>specifies the endpoint of the device</summary>
-        public int DestEndpoint;
+        @Deprecated
+        protected int DestEndpoint;
         /// <name>TI.ZPI2.AF_DATA_REQUEST.DstAddr</name>
         /// <summary>the address of the destination device</summary>
-        public ZToolAddress16 DstAddr;
+        @Deprecated
+        protected ZToolAddress16 DstAddr;
         /// <name>TI.ZPI2.AF_DATA_REQUEST.Len</name>
         /// <summary>specifies the length of the TransactionData field</summary>
-        public int Len;
+        @Deprecated
+        protected int Len;
         /// <name>TI.ZPI2.AF_DATA_REQUEST.Options</name>
         /// <summary>consists of the AF Tx Options bit fields; zero for none</summary>
-        public int Options;
+        @Deprecated
+        protected int Options;
         /// <name>TI.ZPI2.AF_DATA_REQUEST.Radius</name>
         /// <summary>the number of hops allowed to deliver the message; usually use 7</summary>
-        public int Radius;
+        @Deprecated
+        protected int Radius;
         /// <name>TI.ZPI2.AF_DATA_REQUEST.SrcEndpoint</name>
         /// <summary>specifies the endpoint of the device</summary>
-        public int SrcEndpoint;
+        @Deprecated
+        protected int SrcEndpoint;
         /// <name>TI.ZPI2.AF_DATA_REQUEST.TransID</name>
         /// <summary>specifies the transaction Id of the device</summary>
-        public int TransID;
+        @Deprecated
+        protected int TransID;
 
         /// <name>TI.ZPI2.AF_DATA_REQUEST</name>
         /// <summary>Constructor</summary>
@@ -73,6 +82,7 @@
 
         /// <name>TI.ZPI2.AF_DATA_REQUEST</name>
         /// <summary>Constructor</summary>
+        @Deprecated
         public AF_DATA_REQUEST(ZToolAddress16 num1, int num2, int num3, DoubleByte num4, int num5, int num6, int num7, int num8, int[] buffer1)
         {
             this.DstAddr = num1;
@@ -136,4 +146,22 @@
 			
 		}
 
+		public short getDstAddress() {
+			return 	(short)((super.packet[ZToolPacket.PAYLOAD_START_INDEX + 1]<<8)
+		             +(super.packet[ZToolPacket.PAYLOAD_START_INDEX + 0]));
+		}
+		
+		public byte getDstEndpoint() {
+			return 	(byte) super.packet[ZToolPacket.PAYLOAD_START_INDEX + 2];
+		}
+		
+		public byte getSrcEndpoint() {
+			return 	(byte) super.packet[ZToolPacket.PAYLOAD_START_INDEX + 3];
+		}
+		
+		public short getClusterId() {
+			return 	(short)((super.packet[ZToolPacket.PAYLOAD_START_INDEX + 5]<<8)
+		             +(super.packet[ZToolPacket.PAYLOAD_START_INDEX + 4]));
+		}
+		
 }

Modified: projects/zb4osgi/trunk/zigbee.cc2480.datalink/src/main/java/com/itaca/ztool/api/af/AF_INCOMING_MSG.java
==============================================================================
--- projects/zb4osgi/trunk/zigbee.cc2480.datalink/src/main/java/com/itaca/ztool/api/af/AF_INCOMING_MSG.java	(original)
+++ projects/zb4osgi/trunk/zigbee.cc2480.datalink/src/main/java/com/itaca/ztool/api/af/AF_INCOMING_MSG.java	Tue Nov  4 01:09:20 2014
@@ -19,7 +19,7 @@
    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 com.itaca.ztool.api.af;
 
@@ -35,144 +35,145 @@
 /**
  *
  * @author <a href="mailto:alfiva at aaa.upv.es">Alvaro Fides Valero</a>
- * @version $LastChangedRevision$ ($LastChangedDate$)
+ * @version $LastChangedRevision$ ($LastChangedDate: 2014-05-13 15:58:12
+ *          +0200 (Tue, 13 May 2014) $)
  */
-public class AF_INCOMING_MSG extends ZToolPacket /*implements IINDICATION,IAF*/{
-	
-	private final static Logger profiler = LoggerFactory.getLogger("profiling."+AF_INCOMING_MSG.class.getName());
-	
-    /// <name>TI.ZPI2.AF_INCOMING_MSG.ClusterID</name>
-        /// <summary>specifies the cluster ID</summary>
-		@Deprecated
-        public DoubleByte ClusterID;
-        /// <name>TI.ZPI2.AF_INCOMING_MSG.Data</name>
-        /// <summary>Dynamic array, variable length field of size 'Len' and is the transaction data frame</summary>
-		@Deprecated
-        public int[] Data;
-        /// <name>TI.ZPI2.AF_INCOMING_MSG.DstEndpoint</name>
-        /// <summary>specifies the endpoint of the destination device</summary>
-		@Deprecated		
-        public int DstEndpoint;
-        /// <name>TI.ZPI2.AF_INCOMING_MSG.GroupID</name>
-        /// <summary>Group ID</summary>
-		@Deprecated
-        public DoubleByte GroupID;
-        /// <name>TI.ZPI2.AF_INCOMING_MSG.Len</name>
-        /// <summary>specifies the length of the Data field</summary>
-		@Deprecated
-        public int Len;
-        /// <name>TI.ZPI2.AF_INCOMING_MSG.LinkQuality</name>
-        /// <summary>indicates the link quality measured during reception. TBD</summary>
-		@Deprecated
-        public int LinkQuality;
-        /// <name>TI.ZPI2.AF_INCOMING_MSG.SecurityUse</name>
-        /// <summary>indicates the type of security applied for the incoming NPDU. This field is no longer used.</summary>
-		@Deprecated
-        public int SecurityUse;
-        /// <name>TI.ZPI2.AF_INCOMING_MSG.SrcAddr</name>
-        /// <summary>specifies the address of the source device</summary>
-		@Deprecated
-        public ZToolAddress16 SrcAddr;
-        /// <name>TI.ZPI2.AF_INCOMING_MSG.SrcEndpoint</name>
-        /// <summary>specifies the endpoint of the source device</summary>
-		@Deprecated
-        public int SrcEndpoint;
-        /// <name>TI.ZPI2.AF_INCOMING_MSG.Timestamp</name>
-        /// <summary>Timestamp</summary>
-		@Deprecated
-        public long Timestamp;
-        /// <name>TI.ZPI2.AF_INCOMING_MSG.TransSeqNumber</name>
-        /// <summary>specifies the transaction Id of the device</summary>
-		@Deprecated
-        public int TransSeqNumber;
-        /// <name>TI.ZPI2.AF_INCOMING_MSG.WasBroadcast</name>
-        /// <summary>WasBroadcast</summary>
-		@Deprecated
-        public int WasBroadcast;		
-		private byte[] payload;
+public class AF_INCOMING_MSG extends ZToolPacket /* implements IINDICATION,IAF */{
 
-        /// <name>TI.ZPI2.AF_INCOMING_MSG</name>
-        /// <summary>Constructor</summary>
-        public AF_INCOMING_MSG()
-        {
-            this.Data = new int[0xff];
-        }
+	private final static Logger profiler = LoggerFactory.getLogger("profiling."+ AF_INCOMING_MSG.class.getName());
 
-        public AF_INCOMING_MSG(int[] framedata)
-        {
-        	profiler.info("AF_INCOMING_MSG: creating object");
-            this.GroupID = new DoubleByte(framedata[1],framedata[0]);
-            this.ClusterID = new DoubleByte(framedata[3],framedata[2]);
-            this.SrcAddr = new ZToolAddress16(framedata[5],framedata[4]);
-            this.SrcEndpoint = framedata[6];
-            this.DstEndpoint = framedata[7];
-            this.WasBroadcast = framedata[8];
-            this.LinkQuality = framedata[9];
-            this.SecurityUse = framedata[10];
-            byte[] bytes = new byte[4];
-            bytes[3]=(byte) framedata[11];
-            bytes[2]=(byte) framedata[12];
-            bytes[1]=(byte) framedata[13];
-            bytes[0]=(byte) framedata[14];
-            this.Timestamp = ByteUtils.convertMultiByteToLong(bytes);
-            this.TransSeqNumber = framedata[15];
-            this.Len = framedata[16];
-            this.Data=new int[framedata.length-17];
-            for(int i=0;i<this.Data.length;i++){
-                this.Data[i]=framedata[17+i];
-            }
-            super.buildPacket(new DoubleByte(ZToolCMD.AF_INCOMING_MSG), framedata);
-        	profiler.info("AF_INCOMING_MSG: object created");
-        }
+	// / <name>TI.ZPI2.AF_INCOMING_MSG.ClusterID</name>
+	// / <summary>specifies the cluster ID</summary>
+	@Deprecated
+	protected DoubleByte ClusterID;
+	// / <name>TI.ZPI2.AF_INCOMING_MSG.Data</name>
+	// / <summary>Dynamic array, variable length field of size 'Len' and is the
+	// transaction data frame</summary>
+	@Deprecated
+	protected int[] Data;
+	// / <name>TI.ZPI2.AF_INCOMING_MSG.DstEndpoint</name>
+	// / <summary>specifies the endpoint of the destination device</summary>
+	@Deprecated
+	protected int DstEndpoint;
+	// / <name>TI.ZPI2.AF_INCOMING_MSG.GroupID</name>
+	// / <summary>Group ID</summary>
+	@Deprecated
+	protected DoubleByte GroupID;
+	// / <name>TI.ZPI2.AF_INCOMING_MSG.Len</name>
+	// / <summary>specifies the length of the Data field</summary>
+	@Deprecated
+	protected int Len;
+	// / <name>TI.ZPI2.AF_INCOMING_MSG.LinkQuality</name>
+	// / <summary>indicates the link quality measured during reception.
+	// TBD</summary>
+	@Deprecated
+	protected int LinkQuality;
+	// / <name>TI.ZPI2.AF_INCOMING_MSG.SecurityUse</name>
+	// / <summary>indicates the type of security applied for the incoming NPDU.
+	// This field is no longer used.</summary>
+	@Deprecated
+	protected int SecurityUse;
+	// / <name>TI.ZPI2.AF_INCOMING_MSG.SrcAddr</name>
+	// / <summary>specifies the address of the source device</summary>
+	@Deprecated
+	protected ZToolAddress16 SrcAddr;
+	// / <name>TI.ZPI2.AF_INCOMING_MSG.SrcEndpoint</name>
+	// / <summary>specifies the endpoint of the source device</summary>
+	@Deprecated
+	protected int SrcEndpoint;
+	// / <name>TI.ZPI2.AF_INCOMING_MSG.Timestamp</name>
+	// / <summary>Timestamp</summary>
+	@Deprecated
+	protected long Timestamp;
+	// /<name>TI.ZPI2.AF_INCOMING_MSG.TransSeqNumber</name>
+	// / <summary>specifies the transaction Id of the device</summary>
+	@Deprecated
+	protected int TransSeqNumber;
+	// / <name>TI.ZPI2.AF_INCOMING_MSG.WasBroadcast</name>
+	// / <summary>WasBroadcast</summary>
+	@Deprecated
+	protected int WasBroadcast;
+	private byte[] payload;
 
-        /// <name>TI.ZPI2.AF_INCOMING_MSG.SECURITY_STATUS</name>
-        /// <summary>Security status</summary>
-        public class SECURITY_STATUS 
-        {
-            /// <name>TI.ZPI2.AF_INCOMING_MSG.SECURITY_STATUS.ENABLED</name>
-            /// <summary>Security status</summary>
-            public static final int ENABLED = 1;
-            /// <name>TI.ZPI2.AF_INCOMING_MSG.SECURITY_STATUS.NOT_ENABLED</name>
-            /// <summary>Security status</summary>
-            public static final int NOT_ENABLED = 0;
-        }
+	// / <name>TI.ZPI2.AF_INCOMING_MSG</name>
+	// / <summary>Constructor</summary>
+	public AF_INCOMING_MSG() {
+		this.Data = new int[0xff];
+	}
 
-		public byte getTransId() {
-			return 	(byte) (super.packet[ZToolPacket.PAYLOAD_START_INDEX + 15]);
+	public AF_INCOMING_MSG(int[] framedata) {
+		profiler.info("AF_INCOMING_MSG: creating object");
+		this.GroupID = new DoubleByte(framedata[1], framedata[0]);
+		this.ClusterID = new DoubleByte(framedata[3], framedata[2]);
+		this.SrcAddr = new ZToolAddress16(framedata[5], framedata[4]);
+		this.SrcEndpoint = framedata[6];
+		this.DstEndpoint = framedata[7];
+		this.WasBroadcast = framedata[8];
+		this.LinkQuality = framedata[9];
+		this.SecurityUse = framedata[10];
+		byte[] bytes = new byte[4];
+		bytes[3] = (byte) framedata[11];
+		bytes[2] = (byte) framedata[12];
+		bytes[1] = (byte) framedata[13];
+		bytes[0] = (byte) framedata[14];
+		this.Timestamp = ByteUtils.convertMultiByteToLong(bytes);
+		this.TransSeqNumber = framedata[15];
+		this.Len = framedata[16];
+		this.Data = new int[framedata.length - 17];
+		for (int i = 0; i < this.Data.length; i++) {
+			this.Data[i] = framedata[17 + i];
 		}
-		
-        public byte getSrcEndpoint() {
-        	return (byte) super.packet[ZToolPacket.PAYLOAD_START_INDEX + 6];
-        }
+		super.buildPacket(new DoubleByte(ZToolCMD.AF_INCOMING_MSG), framedata);
+		profiler.info("AF_INCOMING_MSG: object created");
+	}
 
-        public short getDstEndpoint() {
-        	return (byte) super.packet[ZToolPacket.PAYLOAD_START_INDEX + 7];        	
-        }
-        
-		public short getSrcAddr() {
-			return 	(short)((super.packet[ZToolPacket.PAYLOAD_START_INDEX + 5]<<8)
-		             +(super.packet[ZToolPacket.PAYLOAD_START_INDEX + 4]));
+	// / <name>TI.ZPI2.AF_INCOMING_MSG.SECURITY_STATUS</name>
+	// / <summary>Security status</summary>
+	public class SECURITY_STATUS {
+		// / <name>TI.ZPI2.AF_INCOMING_MSG.SECURITY_STATUS.ENABLED</name>
+		// / <summary>Security status</summary>
+		public static final int ENABLED = 1;
+		// / <name>TI.ZPI2.AF_INCOMING_MSG.SECURITY_STATUS.NOT_ENABLED</name>
+		// / <summary>Security status</summary>
+		public static final int NOT_ENABLED = 0;
+	}
+
+	public byte getTransId() {
+		return (byte) (super.packet[ZToolPacket.PAYLOAD_START_INDEX + 15]);
+	}
+
+	public byte getSrcEndpoint() {
+		return (byte) super.packet[ZToolPacket.PAYLOAD_START_INDEX + 6];
+	}
+
+	public short getDstEndpoint() {
+		return (byte) super.packet[ZToolPacket.PAYLOAD_START_INDEX + 7];
+	}
+
+	public short getSrcAddr() {
+		return (short) ((super.packet[ZToolPacket.PAYLOAD_START_INDEX + 5] << 8) 
+				+ (super.packet[ZToolPacket.PAYLOAD_START_INDEX + 4]));
+	}
+
+	public short getClusterId() {
+		return (short) ((super.packet[ZToolPacket.PAYLOAD_START_INDEX + 3] << 8) 
+				+ (super.packet[ZToolPacket.PAYLOAD_START_INDEX + 2]));
+	}
+
+	public short getGroupId() {
+		return (short) ((super.packet[ZToolPacket.PAYLOAD_START_INDEX + 1] << 8) 
+				+ (super.packet[ZToolPacket.PAYLOAD_START_INDEX + 0]));
+	}
+
+	public byte[] getData() {
+		if (payload == null) {
+			payload = new byte[Data.length];
+			for (int i = 0; i < payload.length; i++) {
+				payload[i] = (byte) Data[i];
+			}
+
 		}
+		return payload;
+	}
 
-		public short getClusterId() {
-			return 	(short)((super.packet[ZToolPacket.PAYLOAD_START_INDEX + 3]<<8)
-		             +(super.packet[ZToolPacket.PAYLOAD_START_INDEX + 2]));
-		}
-		
-		public short getGroupId() {
-			return 	(short)((super.packet[ZToolPacket.PAYLOAD_START_INDEX + 1]<<8)
-		             +(super.packet[ZToolPacket.PAYLOAD_START_INDEX + 0]));
-		}
-
-		public byte[] getData() {
-			if( payload == null ){
-				payload = new byte[Data.length];
-				for (int i = 0; i < payload.length; i++) {
-					payload [i] = (byte) Data[i];
-				}
-				
-			}
-			return payload;
-		}
-		
 }




More information about the Commit mailing list