Changes
[iotcloud.git] / version2 / src / java / light_fan_embed_benchmark / LightsController.java
index c75821f431b527daf9d5f20679ad60a389f4fdca..b0b990cf0eeb5f54202e0b5edd764998927d0b04 100644 (file)
@@ -5,8 +5,6 @@ class LightsController {
 
     public static void main(String[] args) throws Exception {
 
-        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
-        t1.rebuild();
 
         // Bulb 1
         byte[] bulbMacAdd1 = new byte[8];
@@ -89,6 +87,37 @@ class LightsController {
         System.out.println("Starting System");
         int counter = 0;
 
+
+        Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 321, -1);
+        try {
+            
+            t1.rebuild();
+        } catch (Error e) {
+
+            e.printStackTrace();
+            for (int i = 0; i < 3; i++) {
+                bulbs.get(i).setColor(0, 100, 100);
+            }
+
+
+
+            while (true) {
+                for (int i = 0; i < 3; i++) {
+                    bulbs.get(i).turnOff();
+                }
+                Thread.sleep(1000);
+
+                for (int i = 0; i < 3; i++) {
+                    bulbs.get(i).turnOn();
+                }
+                Thread.sleep(1000);
+            }
+        }
+
+
+
+
+
         while (true) {
 
             try {
@@ -104,10 +133,10 @@ class LightsController {
                 t1.commitTransaction();
 
 
-                
 
-                
-                
+
+
+
 
                 for (int i = 0; i < 3; i++) {
                     IoTString testValA1 = t1.getCommitted(keys.get(i));