X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=version2%2Fsrc%2FC%2FLocalComm.cc;h=ac4c3439d94f8600e4fccdce942dfd755ce5254d;hb=816ad1a5d417a8710281974df64ab97e3369360f;hp=213fb3ed73430a3193cd3db48d9be42133de3849;hpb=0b9aca2b62c74f68652b170a92271a98d5b96666;p=iotcloud.git diff --git a/version2/src/C/LocalComm.cc b/version2/src/C/LocalComm.cc index 213fb3e..ac4c343 100644 --- a/version2/src/C/LocalComm.cc +++ b/version2/src/C/LocalComm.cc @@ -1,24 +1,17 @@ +#include "LocalComm.h" +#include "Error.h" +#include "Table.h" -class LocalComm { - Table t1; - Table t2; +Array *LocalComm::sendDataToLocalDevice(int64_t deviceId, Array *data) { + printf("Passing Locally\n"); - LocalComm(Table _t1, Table _t2) { - t1 = _t1; - t2 = _t2; + if (deviceId == t1->getMachineId()) { + // return t1.localCommInput(data); + } else if (deviceId == t2->getMachineId()) { + // return t2.localCommInput(data); + } else { + throw new Error("Cannot send to deviceId using this local comm"); } - char[] sendDataToLocalDevice(Long deviceId, char[] data) throws InterruptedException { - System.out.println("Passing Locally"); - - if (deviceId == t1.getMachineId()) { - // return t1.localCommInput(data); - } else if (deviceId == t2.getMachineId()) { - // return t2.localCommInput(data); - } else { - throw new Error("Cannot send to " + deviceId + " using this local comm"); - } - - return new char[0]; - } + return new Array((uint32_t)0); }