Committing changes in driver files for paper evaluation
[iot2.git] / benchmarks / drivers / Java / LifxLightBulb / LifxLightBulb.java
index c131bfa5e5f1a594166257912f6f0b55438ab3bb..909a90c4b7e936ba86604157d34c9670add98270 100644 (file)
@@ -102,12 +102,12 @@ public class LifxLightBulb implements LightBulb {
        /*public LifxLightBulb(IoTUDP udp, byte[] macAddress) {
                communicationSockect = udp;
                bulbMacAddress = macAddress;
-       }
+       }*/
 
        public LifxLightBulb(IoTSet<IoTDeviceAddress> _lb_addresses, String macAddress) {
                this(macAddress);
                lb_addresses = _lb_addresses;
-       }*/
+       }
 
        public LifxLightBulb(String macAddress) {
                communicationSockect = null;
@@ -1200,34 +1200,29 @@ public class LifxLightBulb implements LightBulb {
        }
 
 
-       /*public static void main(String[] args) throws Exception {
+       /* TODO: Uncomment this part to do light bulb test
+       public static void main(String[] args) throws Exception {
 
                System.out.println("Executing main function!");
-               IoTDeviceAddress iotDevAdd = new IoTDeviceAddress("192.168.2.126", 12345, 56700, false, false);
+               IoTDeviceAddress iotDevAdd = new IoTDeviceAddress(args[0], 12345, 56700, false, false);
                Set<IoTDeviceAddress> set = new HashSet<IoTDeviceAddress>();
                set.add(iotDevAdd);
                IoTSet<IoTDeviceAddress> iotset = new IoTSet<IoTDeviceAddress>(set);
                LifxLightBulb lb = new LifxLightBulb(iotset, "D073D5128E300000");
-               lb.init();
+               try {
+                       lb.init();
+                       Thread.sleep(1000);
+                       for (int i = 0; i < 2; i++) {
+                               lb.turnOff();
+                               System.out.println("Turning off!");
+                               Thread.sleep(1000);
+                               lb.turnOn();
+                               System.out.println("Turning on!");
+                               Thread.sleep(1000);
+                       }
+                       lb.turnOff();
+               } catch(Exception ex) {
+                       ex.printStackTrace();
+               }
        }*/
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-