Cleaning up benchmarks and drivers code.
[iot2.git] / benchmarks / drivers / Java / DoorlockActuator / DoorlockActuator.java
index 09eb5398b5e9dca50930508fb28a94c3d7867363..be92effb66bfe09e1a2e5390d1aedcb34bab9285 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 DoorlockActuator implements IoTZigbeeCallback, SmartthingsActuator
        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 < SmartthingsActuatorSmartCallback > callbackList = new CopyOnWriteArrayList < SmartthingsActuatorSmartCallback > ();
@@ -88,14 +85,11 @@ public class DoorlockActuator implements IoTZigbeeCallback, SmartthingsActuator
 
 
             
-                       //made by changwoo
+                       // 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);
@@ -159,7 +153,7 @@ public class DoorlockActuator implements IoTZigbeeCallback, SmartthingsActuator
                }
        }
 
-       //made by changwoo
+       // made by Changwoo
        private void sleep(int multipleTime){
                if(multipleTime<=0){
                        multipleTime=1;
@@ -251,7 +245,7 @@ public class DoorlockActuator implements IoTZigbeeCallback, SmartthingsActuator
 
        public void newMessageAvailable(IoTZigbeeMessage _zm) {
                
-               //made by yuting
+               // made by Yuting
                if (_zm instanceof IoTZigbeeMessageZdoBindResponse) {
                        IoTZigbeeMessageZdoBindResponse message = (IoTZigbeeMessageZdoBindResponse)_zm;
                        if (message.getSucceeded()) {