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);
18 List<IoTString> keys = new ArrayList<IoTString>();
23 IoTDeviceAddress devAddr1 = new IoTDeviceAddress("192.168.2.145", 49153, 49153, false, false);
24 Wemo wemo1 = new Wemo(devAddr1);
26 IoTDeviceAddress devAddr2 = new IoTDeviceAddress("192.168.2.186", 49154, 49153, false, false);
27 Wemo wemo2 = new Wemo(devAddr2);
29 List<Wemo> wemos = new ArrayList<Wemo>();
34 String pingTimerKey = "wemoController";
35 IoTString ipingTimerKey = new IoTString(pingTimerKey);
39 IoTString iValueA = new IoTString(valueA);
41 System.out.println("Starting System");
47 String pingTimer = Long.toString(System.currentTimeMillis());
48 IoTString ipingTimer = new IoTString(pingTimer);
51 t1.startTransaction();
52 t1.addKV(ipingTimerKey, ipingTimer);
53 t1.commitTransaction();
59 for (int i = 0; i < 2; i++) {
60 IoTString testValA1 = t1.getCommitted(keys.get(i));
61 if ((testValA1 != null) && (testValA1.equals(iValueA) == true)) {
62 wemos.get(i).turnOn();
64 wemos.get(i).turnOff();
71 Runtime runTime = Runtime.getRuntime();
72 runTime.exec("gpio mode 4 out");
76 runTime.exec("gpio write 4 1");
78 runTime.exec("gpio write 4 0");