edits
[iotcloud.git] / version2 / src / C / LocalComm.h
1
2 class LocalComm {
3     private Table t1;
4     private Table t2;
5
6     public LocalComm(Table _t1, Table _t2) {
7         t1 = _t1;
8         t2 = _t2;
9     }
10
11     public char[] sendDataToLocalDevice(Long deviceId, char[] data) throws InterruptedException{
12         System.out.println("Passing Locally");
13
14         if (deviceId == t1.getMachineId()) {
15             // return t1.localCommInput(data);
16         } else if (deviceId == t2.getMachineId()) {
17             // return t2.localCommInput(data);
18         } else {
19             throw new Error("Cannot send to " + deviceId + " using this local comm");
20         }
21
22         return new char[0];
23     }
24 }