Cleaning up benchmarks and drivers code.
[iot2.git] / benchmarks / drivers / Java / DoorlockSensor / DoorlockSensor.java
index a3ea7721e74edcbb529e2154d10f4bf2716c2f26..ac3b7f77ac494c65c6058f668f6e261fc61dc35a 100644 (file)
@@ -6,11 +6,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.Semaphore;
 
-// Checker annotations
-//import iotchecker.qual.*;
-import iotcode.annotation.*;
-
 // IoT Packages
+import iotcode.annotation.*;
 import iotruntime.slave.*;
 import iotcode.interfaces.*;
 import iotruntime.zigbee.*;
@@ -37,7 +34,7 @@ public class DoorlockSensor implements IoTZigbeeCallback, SmartthingsSensor {
        private AtomicBoolean didWriteAttrb = new AtomicBoolean(false);
        private AtomicBoolean didMatchDscr = new AtomicBoolean(false);
        private AtomicBoolean didBind = new AtomicBoolean(false);
-       private AtomicBoolean didDoorLockConfigureReporting = new AtomicBoolean(false); //made by Jiawei
+       private AtomicBoolean didDoorLockConfigureReporting = new AtomicBoolean(false); // made by Jiawei
        static Semaphore gettingLatestDataMutex = new Semaphore(1);
 
        private List < SmartthingsSensorSmartCallback > callbackList = new CopyOnWriteArrayList < SmartthingsSensorSmartCallback > ();
@@ -91,11 +88,8 @@ public class DoorlockSensor implements IoTZigbeeCallback, SmartthingsSensor {
                        //made by changwoo
                        sleep(10);
 
-            // System.out.println("BroadcastingRouteRecordRequest ");
-                       // zigConnection.sendBroadcastingRouteRecordRequest(0x0001);
-            // sleep(6);
-
                        System.out.println("Sending Management Permit Joining Request");
+                       // TODO: Might/might not need to send this 3 times
                        // for(int z=0; z<3; z++){
                                zigConnection.sendManagementPermitJoiningRequest(0x0002, 0x0036, 0x00);
                                sleep(0);
@@ -141,7 +135,7 @@ public class DoorlockSensor implements IoTZigbeeCallback, SmartthingsSensor {
                }
        }
 
-       //made by changwoo
+       // made by Changwoo
        private void sleep(int multipleTime){
                if(multipleTime<=0){
                        multipleTime=1;
@@ -154,7 +148,6 @@ public class DoorlockSensor implements IoTZigbeeCallback, SmartthingsSensor {
        }
 
        // made by Jiawei
-    //public int getStatus() {
        public int getValue() {
                int tmp = 0;
 
@@ -233,7 +226,7 @@ public class DoorlockSensor implements IoTZigbeeCallback, SmartthingsSensor {
 
        public void newMessageAvailable(IoTZigbeeMessage _zm) {
                
-               //made by yuting
+               // made by Yuting
                if (_zm instanceof IoTZigbeeMessageZdoBindResponse) {
                        IoTZigbeeMessageZdoBindResponse message = (IoTZigbeeMessageZdoBindResponse)_zm;
                        if (message.getSucceeded()) {