Completing ZigbeeTest with doorlock test
[iot2.git] / benchmarks / other / ZigbeeTest / MotionSensor.java
index 68dfe29..5fe888a 100644 (file)
@@ -38,8 +38,6 @@ 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;
 
@@ -82,9 +80,10 @@ public class MotionSensor implements IoTZigbeeCallback, SmartthingsSensor {
                        //made by changwoo
                        sleep(10);
 
-                       System.out.println("Sending Management Permit Joining Request");
+                       //System.out.println("Sending Management Permit Joining Request");
                        for(int z=0; z<3; z++){
                                zigConnection.sendManagementPermitJoiningRequest(0x0001, 0x0036, 0x00);
+                               System.out.println("Sending Management Permit Joining Request");
                                sleep(0);
                        }
                        
@@ -140,18 +139,6 @@ public class MotionSensor implements IoTZigbeeCallback, SmartthingsSensor {
                }
        }
 
-       public void setId(int id) {
-
-               sensorId = id;
-
-       }
-
-       public int getId() {
-
-               return sensorId;
-
-       }
-
        public int getValue() {
 
                int tmp = 0;
@@ -216,7 +203,7 @@ public class MotionSensor implements IoTZigbeeCallback, SmartthingsSensor {
                                gettingLatestDataMutex.release();
                                try {
                                        for (SmartthingsSensorCallback cb : callbackList) {
-                                               cb.newReadingAvailable(this.getId(), this.getValue(), this.isActiveValue());
+                                               cb.newReadingAvailable(this.getValue(), this.isActiveValue());
                                        }
                                } catch (Exception e) {
                                        e.printStackTrace();