Adjusting files in ZigbeeTest; preparing things for 4th benchmark, i.e. generating...
[iot2.git] / benchmarks / other / ZigbeeTest / WaterLeakSensor.java
index 75923a44171b1241165ee8252565c92ee8c5b115..8a56aabf035be5a9bd8e24cdfb04dfb3f4511bc0 100644 (file)
@@ -41,6 +41,8 @@ public class WaterLeakSensor implements IoTZigbeeCallback, SmartthingsSensor {
        @config private IoTSet<IoTDeviceAddress> devUdpAddress;
        @config private IoTSet<IoTZigbeeAddress> devZigbeeAddress;
 
+       private int sensorId = 0;
+
        public WaterLeakSensor(IoTSet<IoTDeviceAddress> dSet, IoTSet<IoTZigbeeAddress> zigSet) {
                devUdpAddress = dSet;
                devZigbeeAddress = zigSet;
@@ -136,6 +138,18 @@ public class WaterLeakSensor implements IoTZigbeeCallback, SmartthingsSensor {
                }
        }
 
+       public void setId(int id) {
+
+               sensorId = id;
+
+       }
+
+       public int getId() {
+
+               return sensorId;
+
+       }
+
        public int getValue() {
 
                int tmp = 0;
@@ -199,7 +213,7 @@ public class WaterLeakSensor 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();