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");
57 String pingTimer = Long.toString(System.currentTimeMillis());
58 IoTString ipingTimer = new IoTString(pingTimer);
61 t1.startTransaction();
62 t1.addKV(ipingTimerKey, ipingTimer);
63 t1.commitTransaction();
70 for (int i = 0; i < 2; i++) {
71 IoTString testValA1 = t1.getCommitted(keys.get(i));
72 if ((testValA1 != null) && (testValA1.equals(iValueA) == true)) {
73 wemos.get(i).turnOn();
75 wemos.get(i).turnOff();
82 Runtime runTime = Runtime.getRuntime();
83 runTime.exec("gpio mode 4 out");
87 runTime.exec("gpio write 4 1");
89 runTime.exec("gpio write 4 0");