6 public static void main(String[] args) throws Exception {
8 Table t1 = new Table("http://dc-6.calit2.uci.edu/test.iotcloud/", "reallysecret", 351, -1);
14 IoTString ia1 = new IoTString(a1);
15 IoTString ia2 = new IoTString(a2);
17 List<IoTString> keys = new ArrayList<IoTString>();
21 Wemo wemo1 = new Wemo();
22 Wemo wemo2 = new Wemo();
24 List<Wemo> wemos = new ArrayList<Wemo>();
29 String pingTimerKey = "wemoController";
30 IoTString ipingTimerKey = new IoTString(pingTimerKey);
34 IoTString iValueA = new IoTString(valueA);
36 System.out.println("Starting System");
42 String pingTimer = Long.toString(System.currentTimeMillis());
43 IoTString ipingTimer = new IoTString(pingTimer);
46 t1.startTransaction();
47 t1.addKV(ipingTimerKey, ipingTimer);
48 t1.commitTransaction();
54 for (int i = 0; i < 2; i++) {
55 IoTString testValA1 = t1.getCommitted(keys.get(i));
56 if ((testValA1 != null) && (testValA1.equals(iValueA) == true)) {
57 wemos.get(i).turnOn();
59 wemos.get(i).turnOff();
66 Runtime runTime = Runtime.getRuntime();
67 runTime.exec("gpio mode 4 out");
71 runTime.exec("gpio write 4 1");
73 runTime.exec("gpio write 4 0");