mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-19 00:07:13 +02:00
implemented sending hostname to the receiver for eiger
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@764 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -318,6 +318,8 @@ int slsReceiverFuncs::function_table(){
|
||||
flist[F_START_READOUT] = &slsReceiverFuncs::start_readout;
|
||||
flist[F_SET_TIMER] = &slsReceiverFuncs::set_timer;
|
||||
flist[F_ENABLE_COMPRESSION] = &slsReceiverFuncs::enable_compression;
|
||||
flist[F_SET_DETECTOR_HOSTNAME] = &slsReceiverFuncs::set_detector_hostname;
|
||||
|
||||
|
||||
//General Functions
|
||||
flist[F_LOCK_SERVER] = &slsReceiverFuncs::lock_receiver;
|
||||
@ -1541,6 +1543,64 @@ int slsReceiverFuncs::enable_compression() {
|
||||
|
||||
|
||||
|
||||
int slsReceiverFuncs::set_detector_hostname() {
|
||||
ret=OK;
|
||||
char retval[MAX_STR_LENGTH]="";
|
||||
char hostname[MAX_STR_LENGTH]="";
|
||||
strcpy(mess,"Could not set detector hostname");
|
||||
|
||||
// receive arguments
|
||||
if(socket->ReceiveDataOnly(hostname,MAX_STR_LENGTH) < 0 ){
|
||||
strcpy(mess,"Error reading from socket\n");
|
||||
ret = FAIL;
|
||||
}
|
||||
|
||||
// execute action if the arguments correctly arrived
|
||||
#ifdef SLS_RECEIVER_FUNCTION_LIST
|
||||
if (ret==OK) {
|
||||
|
||||
if (lockStatus==1 && socket->differentClients==1){
|
||||
sprintf(mess,"Receiver locked by %s\n", socket->lastClientIP);
|
||||
ret=FAIL;
|
||||
}
|
||||
#ifdef EIGER_RECEIVER_H
|
||||
else
|
||||
strcpy(retval,slsReceiverList->setDetectorHostname(hostname));
|
||||
#endif
|
||||
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
if(ret!=FAIL)
|
||||
cout << "hostname:" << retval << endl;
|
||||
else
|
||||
cout << mess << endl;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if(ret==OK && socket->differentClients){
|
||||
cout << "Force update" << endl;
|
||||
ret=FORCE_UPDATE;
|
||||
}
|
||||
|
||||
// send answer
|
||||
socket->SendDataOnly(&ret,sizeof(ret));
|
||||
if(ret==FAIL)
|
||||
socket->SendDataOnly(mess,sizeof(mess));
|
||||
socket->SendDataOnly(retval,MAX_STR_LENGTH);
|
||||
|
||||
//return ok/fail
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user