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