solved errors with client compile, rxr yet to do

This commit is contained in:
maliakal_d 2018-10-09 13:43:50 +02:00
parent 4bcc24a59f
commit 7d5b24fe33
4 changed files with 8 additions and 9 deletions

View File

@ -957,8 +957,10 @@ int slsDetector::setDetectorType(detectorType const type) {
(int)thisDetector->myDetectorType << std::endl; (int)thisDetector->myDetectorType << std::endl;
#endif #endif
if (connectData() == OK){ if (connectData() == OK){
ret=thisReceiver->sendInt(fnum2,retval,(int)thisDetector->myDetectorType); int arg = 0;
ret=thisReceiver->sendInt(fnum2,arg,(int)thisDetector->myDetectorType);
disconnectData(); disconnectData();
retval = (detectorType)arg;
} }
if(ret==FAIL){ if(ret==FAIL){
std::cout << "ERROR: Could not send detector type to receiver" << std::endl; 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; int fnum=F_GET_LAST_CLIENT_IP;
char clientName[INET_ADDRSTRLEN]; char clientName[INET_ADDRSTRLEN];
char mess[MAX_STR_LENGTH]="";
int ret=OK; int ret=OK;
if (thisDetector->onlineFlag==ONLINE_FLAG) { if (thisDetector->onlineFlag==ONLINE_FLAG) {
@ -1555,7 +1556,7 @@ int slsDetector::exitServer() {
std::cout<< "Shutting down the Detector server" << std::endl; std::cout<< "Shutting down the Detector server" << std::endl;
std::cout<< std::endl; std::cout<< std::endl;
} }
return retval; return ret;
} }
@ -1669,8 +1670,6 @@ int slsDetector::updateDetectorNoWait() {
int slsDetector::updateDetector() { int slsDetector::updateDetector() {
int fnum=F_UPDATE_CLIENT; int fnum=F_UPDATE_CLIENT;
int ret=OK; int ret=OK;
char mess[MAX_STR_LENGTH]="";
if (thisDetector->onlineFlag==ONLINE_FLAG) { if (thisDetector->onlineFlag==ONLINE_FLAG) {
if (connectControl() == OK){ if (connectControl() == OK){
controlSocket->SendDataOnly(&fnum,sizeof(fnum)); controlSocket->SendDataOnly(&fnum,sizeof(fnum));

View File

@ -576,10 +576,9 @@ public:
* Executes a system command on the detector server * Executes a system command on the detector server
* e.g. mount an nfs disk, reboot and returns answer etc. * e.g. mount an nfs disk, reboot and returns answer etc.
* @param cmd command to be executed * @param cmd command to be executed
* @param answer is the answer from the detector
* @returns OK or FAIL * @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 * Updates some of the shared memory receiving the data from the detector

View File

@ -2434,9 +2434,10 @@ string slsDetectorCommand::cmdExitServer(int narg, char *args[], int action, int
} }
else if (cmd=="execcommand"){ else if (cmd=="execcommand"){
myDet->setOnline(ONLINE_FLAG, detPos); 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"); return string("Command executed successfully\n");
else else
return string("Command failed\n"); return string("Command failed\n");
} }
else return("cannot decode command\n"); else return("cannot decode command\n");

View File

@ -1,4 +1,4 @@
MAINDIR=slsDetectorsPackage MAINDIR=slsDetectorPackage
SPECDIR=slsReceiverSoftware SPECDIR=slsReceiverSoftware
TMPFILE=include/gitInfoReceiverTmp.h TMPFILE=include/gitInfoReceiverTmp.h
INCLFILE=include/gitInfoReceiver.h INCLFILE=include/gitInfoReceiver.h