From 7d5b24fe331c8fb5f9e2556f5b3177cf95d07e60 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Tue, 9 Oct 2018 13:43:50 +0200 Subject: [PATCH] solved errors with client compile, rxr yet to do --- slsDetectorSoftware/slsDetector/slsDetector.cpp | 9 ++++----- slsDetectorSoftware/slsDetector/slsDetector.h | 3 +-- slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp | 3 ++- slsReceiverSoftware/updateGitVersion.sh | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index d00df76ba..ae646c880 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -957,8 +957,10 @@ int slsDetector::setDetectorType(detectorType const type) { (int)thisDetector->myDetectorType << std::endl; #endif if (connectData() == OK){ - ret=thisReceiver->sendInt(fnum2,retval,(int)thisDetector->myDetectorType); + int arg = 0; + ret=thisReceiver->sendInt(fnum2,arg,(int)thisDetector->myDetectorType); disconnectData(); + retval = (detectorType)arg; } if(ret==FAIL){ std::cout << "ERROR: Could not send detector type to receiver" << std::endl; @@ -1521,7 +1523,6 @@ std::string slsDetector::getLastClientIP() { int fnum=F_GET_LAST_CLIENT_IP; char clientName[INET_ADDRSTRLEN]; - char mess[MAX_STR_LENGTH]=""; int ret=OK; if (thisDetector->onlineFlag==ONLINE_FLAG) { @@ -1555,7 +1556,7 @@ int slsDetector::exitServer() { std::cout<< "Shutting down the Detector server" << std::endl; std::cout<< std::endl; } - return retval; + return ret; } @@ -1669,8 +1670,6 @@ int slsDetector::updateDetectorNoWait() { int slsDetector::updateDetector() { int fnum=F_UPDATE_CLIENT; int ret=OK; - char mess[MAX_STR_LENGTH]=""; - if (thisDetector->onlineFlag==ONLINE_FLAG) { if (connectControl() == OK){ controlSocket->SendDataOnly(&fnum,sizeof(fnum)); diff --git a/slsDetectorSoftware/slsDetector/slsDetector.h b/slsDetectorSoftware/slsDetector/slsDetector.h index 05431f08c..759ff8d8b 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.h +++ b/slsDetectorSoftware/slsDetector/slsDetector.h @@ -576,10 +576,9 @@ public: * Executes a system command on the detector server * e.g. mount an nfs disk, reboot and returns answer etc. * @param cmd command to be executed - * @param answer is the answer from the detector * @returns OK or FAIL */ - int execCommand(std::string cmd, std::string answer); + int execCommand(std::string cmd); /** * Updates some of the shared memory receiving the data from the detector diff --git a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp index dafa72b0f..68823a18c 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp @@ -2434,9 +2434,10 @@ string slsDetectorCommand::cmdExitServer(int narg, char *args[], int action, int } else if (cmd=="execcommand"){ myDet->setOnline(ONLINE_FLAG, detPos); - if(myDet->execCommand(std::string(argv[1]), detPos)==OK) + if(myDet->execCommand(std::string(args[1]), detPos)==OK) return string("Command executed successfully\n"); else + return string("Command failed\n"); } else return("cannot decode command\n"); diff --git a/slsReceiverSoftware/updateGitVersion.sh b/slsReceiverSoftware/updateGitVersion.sh index 83b9a65bb..96e58f255 100755 --- a/slsReceiverSoftware/updateGitVersion.sh +++ b/slsReceiverSoftware/updateGitVersion.sh @@ -1,4 +1,4 @@ -MAINDIR=slsDetectorsPackage +MAINDIR=slsDetectorPackage SPECDIR=slsReceiverSoftware TMPFILE=include/gitInfoReceiverTmp.h INCLFILE=include/gitInfoReceiver.h