Adjusting files in ZigbeeTest; preparing things for 4th benchmark, i.e. generating...
[iot2.git] / benchmarks / other / ZigbeeTest / MultipurposeSensor.java
index a21155fcd3e8423361efe013a16320b54dddb5f2..0243091ededf3cabdbf26eed52bd406ed1ae7e8e 100644 (file)
@@ -38,6 +38,8 @@ public class MultipurposeSensor implements IoTZigbeeCallback, SmartthingsSensor
 
        private List < SmartthingsSensorCallback > callbackList = new CopyOnWriteArrayList < SmartthingsSensorCallback > ();
 
+       private int sensorId = 0;
+
        @config private IoTSet<IoTDeviceAddress> devUdpAddress;
        @config private IoTSet<IoTZigbeeAddress> devZigbeeAddress;
 
@@ -136,6 +138,18 @@ public class MultipurposeSensor implements IoTZigbeeCallback, SmartthingsSensor
                }
        }
 
+       public void setId(int id) {
+
+               sensorId = id;
+
+       }
+
+       public int getId() {
+
+               return sensorId;
+
+       }
+
        public int getValue() {
 
                int tmp = 0;
@@ -198,7 +212,7 @@ public class MultipurposeSensor implements IoTZigbeeCallback, SmartthingsSensor
                                gettingLatestDataMutex.release();
                                try {
                                        for (SmartthingsSensorCallback cb : callbackList) {
-                                               cb.newReadingAvailable(this.getValue(), this.isActiveValue());
+                                               cb.newReadingAvailable(this.getId(), this.getValue(), this.isActiveValue());
                                        }
                                } catch (Exception e) {
                                        e.printStackTrace();