X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=iotjava%2Fiotruntime%2Fcpp%2Fiotslave%2FIoTSlave.cpp;h=e0ebcd8d8c784f13ba4c44ced08e07a5e5b9722e;hb=39563ab07eb793e7be02984f6ab5604f82bfc0c4;hp=89d99970f21ce52ec86ba529fc9761407e7432a6;hpb=ffea2cb68e5a2e1bac041fe2279620eba8d227f8;p=iot2.git diff --git a/iotjava/iotruntime/cpp/iotslave/IoTSlave.cpp b/iotjava/iotruntime/cpp/iotslave/IoTSlave.cpp index 89d9997..e0ebcd8 100644 --- a/iotjava/iotruntime/cpp/iotslave/IoTSlave.cpp +++ b/iotjava/iotruntime/cpp/iotslave/IoTSlave.cpp @@ -5,7 +5,6 @@ IoTSlave::IoTSlave(string _serverAddress, int _serverPort, string _objectName) { - //isDriverObject = false; // Default to false serverAddress = _serverAddress; serverPort = _serverPort; objectName = _objectName; @@ -117,7 +116,7 @@ char* IoTSlave::recvFileIter(char* recvBuffer, int recvLen) { void IoTSlave::openFile(string fileName) { - log.open(FILEPATH + fileName + FILEEXT); + log.open(LOGFILEPATH + fileName + FILEEXT); } @@ -203,6 +202,7 @@ void IoTSlave::instantiateMainObject() { objMainCls = create_object(params); writeToFile("Object created for " + mainObjectName); init_object(objMainCls); + // TODO: Maybe we want to change this into multithreading at some point //thread th1 (&IoTSlave::runInitObject, this, this); //th1.detach(); //thread th1 (&IoTSlave::runInitObject, this, this); @@ -308,7 +308,6 @@ int IoTSlave::recvInteger() { char recvInt[sizeof(int)]; // Normally 4 bytes // Receive and iterate until complete - //writeToFile("Receiving Integer! Size: " + to_string(toBeReceived)); recvIter(recvInt, toBeReceived); int retVal = 0; @@ -341,7 +340,6 @@ string IoTSlave::recvString() { char* recvStr = new char[strLen]; // Receive and iterate until complete - //writeToFile("Receiving String! Size: " + to_string(strLen)); recvIter(recvStr, strLen); string retVal(recvStr, strLen); @@ -365,7 +363,6 @@ void IoTSlave::unzipFile(string fileName) { // TODO: perhaps we need to replace this with libzip or zlib later writeToFile("Unzipping file!"); string chmodCmd = FILEPATH + fileName + SHELL; - //std::system(chmodCmd.c_str()); thread th1 (std::system, chmodCmd.c_str()); th1.detach(); writeToFile("Finished unzipping file!"); @@ -391,9 +388,6 @@ string IoTSlave::recvFile() { fileStream.write(recvFil, fileLen); delete[] recvFil; fileStream.close(); - // TODO: Experimental - //string chmodCmd = FILEPATH + fileName + SHELL; - //execv(chmodCmd.c_str(), 0); return fileName; } @@ -464,8 +458,6 @@ void IoTSlave::getDeviceIoTSetObject() { isetObject->insert(objDeviceAddress); writeToFile("=> Inserting IoTDeviceAddress into set..."); writeToFile("==> Now we have " + to_string(isetObject->size()) + " object(s)!"); - // Set flag to true; - //isDriverObject = true; } @@ -683,6 +675,7 @@ void IoTSlave::commIoTMaster() { break; case GET_ZB_DEV_IOTSET_OBJECT: + // TODO: Support ZigBee in the future //getZBDevIoTSetObject(); break;