ce8b1e9295c85d0c9cfb670ceea906c3dfccf2b9
[iot2.git] / iotjava / iotruntime / zigbee / IoTZigbeeMessageZclReadAttributesResponse.java
1 package iotruntime.zigbee;
2
3 import java.util.List;
4
5 /** Zigbee Message Zcl Read Attributes Response.
6  *
7  * @author      Ali Younis <ayounis @ uci.edu>
8  * @version     1.0
9  * @since       2016-04-19
10  */
11 public final class IoTZigbeeMessageZclReadAttributesResponse extends IoTZigbeeMessage {
12
13         static class Attribute {
14
15                 // private variables
16                 private int attributeId;
17                 private int dataType;
18                 private boolean successOrFail;
19                 private byte[] data;
20
21                 /**
22                  * Constructor
23                  */
24                 public Attribute(int _attributeId, int _dataType, boolean _successOrFail, byte[] _data) {
25                         attributeId = _attributeId;
26                         dataType = _dataType;
27                         successOrFail = _successOrFail;
28                         data = _data;
29                 }
30
31
32                 /**
33                  * getAttributeId() method that returns attribute id
34                  *
35                  * @return int
36                  */
37                 public int getAttributeId() {
38                         return attributeId;
39                 }
40
41
42                 /**
43                  * getDataType() method that returns attribute data type
44                  *
45                  * @return int
46                  */
47                 public int getDataType() {
48                         return dataType;
49                 }
50
51
52                 /**
53                  * getSuccessOrFail() method is if the configure for this attribute failed or succeeded
54                  *
55                  * @return boolean
56                  */
57                 public boolean getSuccessOrFail() {
58                         return successOrFail;
59                 }
60
61
62                 /**
63                  * getData() method that returns attribute data
64                  *
65                  * @return byte[]
66                  */
67                 public byte[] getData() {
68                         return data;
69                 }
70         }
71
72         // private variables
73         private int clusterId;
74         private int profileId;
75         private List <Attribute> attributes;
76
77         /**
78          * Constructor
79          */
80         public IoTZigbeeMessageZclReadAttributesResponse(int _packetId, int _clusterId, int _profileId, List <Attribute> _attributes) {
81                 super(_packetId);
82
83                 clusterId = _clusterId;
84                 profileId = _profileId;
85                 attributes = _attributes;
86         }
87
88         /**
89          * getClusterId() method that returns the cluster id
90          *
91          * @return int
92          */
93         public int getClusterId() {
94                 return clusterId;
95         }
96
97         /**
98          * getProfileId() method that returns the profile id
99          *
100          * @return int
101          */
102         public int getProfileId() {
103                 return profileId;
104         }
105
106         /**
107          * getAttributes() method that returns all attributes data
108          *
109          * @return List <Attribute>
110          */
111         public List <Attribute> getAttributes() {
112                 return attributes;
113         }
114 }