Adjusting files in ZigbeeTest; preparing things for 4th benchmark, i.e. generating...
[iot2.git] / benchmarks / other / ZigbeeTest / MotionSensor.java
index 2ad54902649989ef9edb738db55908049b70d52a..68dfe29d9def4914971e7842d4257a9c4415a0e5 100644 (file)
@@ -38,6 +38,8 @@ public class MotionSensor implements IoTZigbeeCallback, SmartthingsSensor {
 
        private List < SmartthingsSensorCallback > callbackList = new CopyOnWriteArrayList < SmartthingsSensorCallback > ();
 
+       private int sensorId = 0;
+
        @config private IoTSet<IoTDeviceAddress> devUdpAddress;
        @config private IoTSet<IoTZigbeeAddress> devZigbeeAddress;
 
@@ -138,6 +140,18 @@ public class MotionSensor implements IoTZigbeeCallback, SmartthingsSensor {
                }
        }
 
+       public void setId(int id) {
+
+               sensorId = id;
+
+       }
+
+       public int getId() {
+
+               return sensorId;
+
+       }
+
        public int getValue() {
 
                int tmp = 0;
@@ -202,7 +216,7 @@ public class MotionSensor 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();