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);
13 IoTString ia = new IoTString(a);
14 t1.createNewKey(ia, 351);
20 IoTString ia1 = new IoTString(a1);
21 IoTString ia2 = new IoTString(a2);
24 List<IoTString> keys = new ArrayList<IoTString>();
29 IoTDeviceAddress devAddr1 = new IoTDeviceAddress("192.168.1.16", 49153, 49153, false, false);
30 Wemo wemo1 = new Wemo(devAddr1);
32 IoTDeviceAddress devAddr2 = new IoTDeviceAddress("192.168.1.34", 49154, 49153, false, false);
33 Wemo wemo2 = new Wemo(devAddr2);
35 List<Wemo> wemos = new ArrayList<Wemo>();
40 String pingTimerKey = "wemoController";
41 IoTString ipingTimerKey = new IoTString(pingTimerKey);
45 IoTString iValueA = new IoTString(valueA);
47 System.out.println("Starting System");
53 String pingTimer = Long.toString(System.currentTimeMillis());
54 IoTString ipingTimer = new IoTString(pingTimer);
57 t1.startTransaction();
58 t1.addKV(ipingTimerKey, ipingTimer);
59 t1.commitTransaction();
65 for (int i = 0; i < 2; i++) {
66 IoTString testValA1 = t1.getCommitted(keys.get(i));
67 if ((testValA1 != null) && (testValA1.equals(iValueA) == true)) {
68 wemos.get(i).turnOn();
70 wemos.get(i).turnOff();
77 Runtime runTime = Runtime.getRuntime();
78 runTime.exec("gpio mode 4 out");
82 runTime.exec("gpio write 4 1");
84 runTime.exec("gpio write 4 0");