edits
[iotcloud.git] / version2 / src / C / LocalComm.cc
1
2 class LocalComm {
3         Table t1;
4         Table t2;
5
6         LocalComm(Table _t1, Table _t2) {
7                 t1 = _t1;
8                 t2 = _t2;
9         }
10
11         Array<char> *sendDataToLocalDevice(Long deviceId, Array<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 }