mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 09:08:00 +02:00
gotthard2: vetostream (detector: only 3gbe, 10gbe via numudpinterfaces)
This commit is contained in:
@ -369,6 +369,8 @@ void function_table() {
|
||||
flist[F_LOAD_DEFAULT_PATTERN] = &load_default_pattern;
|
||||
flist[F_GET_ALL_THRESHOLD_ENERGY] = &get_all_threshold_energy;
|
||||
flist[F_GET_MASTER] = &get_master;
|
||||
flist[F_GET_VETO_STREAM] = &get_veto_stream;
|
||||
flist[F_SET_VETO_STREAM] = &set_veto_stream;
|
||||
|
||||
// check
|
||||
if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) {
|
||||
@ -8406,3 +8408,52 @@ int get_master(int file_des){
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
|
||||
}
|
||||
|
||||
int get_veto_stream(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
enum EthernetInterface retval = NONE;
|
||||
|
||||
LOG(logDEBUG1, ("Getting veto stream\n"));
|
||||
|
||||
#ifndef GOTTHARD2D
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// get only
|
||||
retval = getVetoStream();
|
||||
LOG(logDEBUG1, ("vetostream retval: %u\n", retval));
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
|
||||
}
|
||||
|
||||
int set_veto_stream(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
enum EthernetInterface arg = 0;
|
||||
|
||||
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
|
||||
return printSocketReadError();
|
||||
LOG(logINFO, ("Setting vetostream: %u\n", (int)arg));
|
||||
|
||||
#ifndef GOTTHARD2D
|
||||
functionNotImplemented();
|
||||
#else
|
||||
// only set
|
||||
if (Server_VerifyLock() == OK) {
|
||||
|
||||
if (arg != 0 && arg != 1) {
|
||||
ret = FAIL;
|
||||
sprintf(mess,
|
||||
"Could not set vetostream 3GbE. Invalid argument %d.\n",
|
||||
arg);
|
||||
LOG(logERROR, (mess));
|
||||
} else {
|
||||
setVetoStream(arg);
|
||||
int retval = getVetoStream();
|
||||
LOG(logDEBUG1, ("vetostream retval: %u\n", retval));
|
||||
validate(arg, retval, "set veto stream", DEC);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||
}
|
Reference in New Issue
Block a user