diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 26b93ecb3..1c9da8946 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -703,12 +703,12 @@ Result Detector::printRxConfiguration(Positions pos) const { } Result Detector::getTenGiga(Positions pos) const { - return pimpl->Parallel(&Module::enableTenGigabitEthernet, pos, -1); + return pimpl->Parallel(&Module::getTenGiga, pos); } void Detector::setTenGiga(bool value, Positions pos) { - pimpl->Parallel(&Module::enableTenGigabitEthernet, pos, - static_cast(value)); + pimpl->Parallel(&Module::setTenGiga, pos, value); + pimpl->Parallel3(&Receiver::setTenGiga, value); } Result Detector::getTenGigaFlowControl(Positions pos) const { @@ -751,7 +751,7 @@ void Detector::removeReceivers(const int udpInterface) { Result Detector::getUseReceiverFlag(Positions pos) const { - return pimpl->Parallel(&Module::getUseReceiverFlag, pos); + return (pimpl->isReceiverInitialized(1) || pimpl->isReceiverInitialized(2)); } Result Detector::getRxHostname(const int udpInterface, Positions pos) const { @@ -816,19 +816,19 @@ void Detector::setRxPort(const int udpInterface, int port, int module_id) { } Result Detector::getRxFifoDepth(Positions pos) const { - return pimpl->Parallel(&Module::setReceiverFifoDepth, pos, -1); + return pimpl->Parallel3(&Receiver::getFifoDepth); } void Detector::setRxFifoDepth(int nframes, Positions pos) { - pimpl->Parallel(&Module::setReceiverFifoDepth, pos, nframes); + pimpl->Parallel3(&Receiver::setFifoDepth, nframes); } Result Detector::getRxSilentMode(Positions pos) const { - return pimpl->Parallel(&Module::getReceiverSilentMode, pos); + return pimpl->Parallel3(&Receiver::getSilentMode); } void Detector::setRxSilentMode(bool value, Positions pos) { - pimpl->Parallel(&Module::setReceiverSilentMode, pos, value); + pimpl->Parallel3(&Receiver::setSilentMode, value); } Result @@ -1439,6 +1439,7 @@ Result Detector::getCounterMask(Positions pos) const { void Detector::setCounterMask(uint32_t countermask, Positions pos) { pimpl->Parallel(&Module::setCounterMask, pos, countermask); + pimpl->Parallel3(&Receiver::setCounterMask, countermask); } // CTB/ Moench Specific diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index 559ea8b8a..0bcb9566e 100755 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -1330,7 +1330,7 @@ void DetectorImpl::startProcessingThread() { } void DetectorImpl::processData() { - if (Parallel(&Module::getUseReceiverFlag, {}).squash(false)) { + if (isReceiverInitialized(1) || isReceiverInitialized(2)) { if (dataReady != nullptr) { readFrameFromReceiver(); } diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index 958e72e12..d62a39fa0 100755 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -242,102 +242,6 @@ void Module::sendToDetectorStop(int fnum) const { sendToDetectorStop(fnum, nullptr, 0, nullptr, 0); } -void Module::sendToReceiver(int fnum, const void *args, size_t args_size, - void *retval, size_t retval_size) { - static_cast(*this).sendToReceiver( - fnum, args, args_size, retval, retval_size); -} - -void Module::sendToReceiver(int fnum, const void *args, size_t args_size, - void *retval, size_t retval_size) const { - auto receiver = ReceiverSocket(shm()->rxHostname, shm()->rxTCPPort); - receiver.sendCommandThenRead(fnum, args, args_size, retval, retval_size); - receiver.close(); -} - -template -void Module::sendToReceiver(int fnum, const Arg &args, Ret &retval) { - sendToReceiver(fnum, &args, sizeof(args), &retval, sizeof(retval)); -} - -template -void Module::sendToReceiver(int fnum, const Arg &args, Ret &retval) const { - sendToReceiver(fnum, &args, sizeof(args), &retval, sizeof(retval)); -} - -template -void Module::sendToReceiver(int fnum, const Arg &args, std::nullptr_t) { - sendToReceiver(fnum, &args, sizeof(args), nullptr, 0); -} - -template -void Module::sendToReceiver(int fnum, const Arg &args, - std::nullptr_t) const { - sendToReceiver(fnum, &args, sizeof(args), nullptr, 0); -} - -template -void Module::sendToReceiver(int fnum, std::nullptr_t, Ret &retval) { - sendToReceiver(fnum, nullptr, 0, &retval, sizeof(retval)); -} - -template -void Module::sendToReceiver(int fnum, std::nullptr_t, Ret &retval) const { - sendToReceiver(fnum, nullptr, 0, &retval, sizeof(retval)); -} - -template -Ret Module::sendToReceiver(int fnum){ - LOG(logDEBUG1) << "Sending: [" - << getFunctionNameFromEnum(static_cast(fnum)) - << ", nullptr, 0, " << typeid(Ret).name() << ", " << sizeof(Ret) << "]"; - Ret retval{}; - sendToReceiver(fnum, nullptr, 0, &retval, sizeof(retval)); - LOG(logDEBUG1) << "Got back: " << retval; - return retval; -} - -template -Ret Module::sendToReceiver(int fnum) const{ - LOG(logDEBUG1) << "Sending: [" - << getFunctionNameFromEnum(static_cast(fnum)) - << ", nullptr, 0, " << typeid(Ret).name() << ", " << sizeof(Ret) << "]"; - Ret retval{}; - sendToReceiver(fnum, nullptr, 0, &retval, sizeof(retval)); - LOG(logDEBUG1) << "Got back: " << retval; - return retval; -} - -template -Ret Module::sendToReceiver(int fnum, const Arg &args){ - LOG(logDEBUG1) << "Sending: [" - << getFunctionNameFromEnum(static_cast(fnum)) - << ", " << args << ", " << sizeof(args) << ", " << typeid(Ret).name() << ", " << sizeof(Ret) << "]"; - Ret retval{}; - sendToReceiver(fnum, &args, sizeof(args), &retval, sizeof(retval)); - LOG(logDEBUG1) << "Got back: " << retval; - return retval; -} - -template -Ret Module::sendToReceiver(int fnum, const Arg &args) const{ - LOG(logDEBUG1) << "Sending: [" - << getFunctionNameFromEnum(static_cast(fnum)) - << ", " << args << ", " << sizeof(args) << ", " << typeid(Ret).name() << ", " << sizeof(Ret) << "]"; - Ret retval{}; - sendToReceiver(fnum, &args, sizeof(args), &retval, sizeof(retval)); - LOG(logDEBUG1) << "Got back: " << retval; - return retval; -} - -// void Module::sendToReceiver(int fnum) { -// sendToReceiver(fnum, nullptr, 0, nullptr, 0); -// } - -// void Module::sendToReceiver(int fnum) const { -// sendToReceiver(fnum, nullptr, 0, nullptr, 0); -// } - void Module::freeSharedMemory() { if (shm.IsExisting()) { shm.RemoveSharedMemory(); @@ -395,12 +299,6 @@ void Module::initializeDetectorStructure(detectorType type) { shm()->controlPort = DEFAULT_PORTNO; shm()->stopPort = DEFAULT_PORTNO + 1; sls::strcpy_safe(shm()->settingsDir, getenv("HOME")); - sls::strcpy_safe(shm()->rxHostname, "none"); - shm()->rxTCPPort = DEFAULT_PORTNO + 2; - shm()->useReceiver = false; - shm()->zmqport = DEFAULT_ZMQ_CL_PORTNO + - (moduleId * ((shm()->myDetectorType == EIGER) ? 2 : 1)); - shm()->zmqip = IpAddr{}; shm()->numUDPInterfaces = 1; // get the detector parameters based on type @@ -2264,50 +2162,20 @@ void Module::updateRateCorrection() { sendToDetector(F_UPDATE_RATE_CORRECTION); } -bool Module::getUseReceiverFlag() const { return shm()->useReceiver; } - -bool Module::enableTenGigabitEthernet(int value) { - int retval = -1; - LOG(logDEBUG1) << "Enabling / Disabling 10Gbe: " << value; - sendToDetector(F_ENABLE_TEN_GIGA, value, retval); - if (value != -1) { - int stopRetval = -1; - sendToDetectorStop(F_ENABLE_TEN_GIGA, value, stopRetval); - } +bool Module::getTenGiga() { + int retval = -1, arg = -1; + LOG(logDEBUG1) << "Getting 10Gbe"; + sendToDetector(F_ENABLE_TEN_GIGA, arg, retval); LOG(logDEBUG1) << "10Gbe: " << retval; - value = retval; - if (shm()->useReceiver && value != -1) { - int retval = -1; - LOG(logDEBUG1) << "Sending 10Gbe enable to receiver: " << value; - sendToReceiver(F_ENABLE_RECEIVER_TEN_GIGA, value, retval); - LOG(logDEBUG1) << "Receiver 10Gbe enable: " << retval; - } - return static_cast(retval); -} - -int Module::setReceiverFifoDepth(int n_frames) { - int retval = -1; - LOG(logDEBUG1) << "Sending Receiver Fifo Depth: " << n_frames; - if (shm()->useReceiver) { - sendToReceiver(F_SET_RECEIVER_FIFO_DEPTH, n_frames, retval); - LOG(logDEBUG1) << "Receiver Fifo Depth: " << retval; - } return retval; } -bool Module::getReceiverSilentMode() { - if (!shm()->useReceiver) { - throw RuntimeError("Set rx_hostname first to use receiver parameters (silent mode)"); - } - return sendToReceiver(F_GET_RECEIVER_SILENT_MODE); -} - -void Module::setReceiverSilentMode(bool enable) { - if (!shm()->useReceiver) { - throw RuntimeError("Set rx_hostname first to use receiver parameters (silent mode)"); - } +void Module::setTenGiga(bool enable) { + int retval = -1; int arg = static_cast(enable); - sendToReceiver(F_SET_RECEIVER_SILENT_MODE, arg, nullptr); + LOG(logDEBUG1) << "Enabling / Disabling 10Gbe: " << arg; + sendToDetector(F_ENABLE_TEN_GIGA, arg, retval); + sendToDetectorStop(F_ENABLE_TEN_GIGA, arg, retval); } void Module::setPattern(const std::string &fname) { @@ -2510,11 +2378,6 @@ void Module::setPipeline(int clkIndex, int value) { void Module::setCounterMask(uint32_t countermask) { LOG(logDEBUG1) << "Setting Counter mask to " << countermask; sendToDetector(F_SET_COUNTER_MASK, countermask, nullptr); - if (shm()->useReceiver) { - int ncounters = __builtin_popcount(countermask); - LOG(logDEBUG1) << "Sending Reciver #counters: " << ncounters; - sendToReceiver(F_RECEIVER_SET_NUM_COUNTERS, ncounters, nullptr); - } } uint32_t Module::getCounterMask() { diff --git a/slsDetectorSoftware/src/Module.h b/slsDetectorSoftware/src/Module.h index 928fe70b2..82412b91f 100755 --- a/slsDetectorSoftware/src/Module.h +++ b/slsDetectorSoftware/src/Module.h @@ -15,7 +15,7 @@ class ServerInterface; #define MODULE_SHMRXVERSION 0x200415 #define MODULE_SHMAPIVERSION 0x190726 -#define MODULE_SHMVERSION 0x200415 +#define MODULE_SHMVERSION 0x200423 namespace sls{ @@ -66,22 +66,6 @@ struct sharedModule { /** number of dacs per module*/ int nDacs; - /** ip address/hostname of the receiver for client control via TCP */ - char rxHostname[MAX_STR_LENGTH]; - - /** is the TCP port used to communicate between client and the receiver */ - int rxTCPPort; - - /** is set if the receiver hostname given and is connected, - * unset if socket connection is not possible */ - bool useReceiver; - - /** tcp port from gui/different process to receiver (only data) */ - int zmqport; - - /** zmq tcp src ip address in client (only data) **/ - sls::IpAddr zmqip; - /** num udp interfaces */ int numUDPInterfaces; }; @@ -1139,27 +1123,8 @@ class Module : public virtual slsDetectorDefs { */ void updateRateCorrection(); - /** - * Gets the use receiver flag from shared memory - */ - bool getUseReceiverFlag() const; - - /** - * Enable/disable or 10Gbe - * @param i is -1 to get, 0 to disable and 1 to enable - * @returns if 10Gbe is enabled - */ - bool enableTenGigabitEthernet(int value = -1); - - /** - * Set/get receiver fifo depth - * @param i is -1 to get, any other value to set the fifo deph - * @returns the receiver fifo depth - */ - int setReceiverFifoDepth(int n_frames = -1); - - bool getReceiverSilentMode(); - void setReceiverSilentMode(bool enable); + bool getTenGiga(); + void setTenGiga(bool value); /** * Opens pattern file and sends pattern to CTB @@ -1360,50 +1325,6 @@ class Module : public virtual slsDetectorDefs { void sendToDetectorStop(int fnum) const; - /** - * Send function parameters to receiver - * @param fnum function enum - * @param args argument pointer - * @param args_size size of argument - * @param retval return pointers - * @param retval_size size of return value - */ - void sendToReceiver(int fnum, const void *args, size_t args_size, - void *retval, size_t retval_size); - - void sendToReceiver(int fnum, const void *args, size_t args_size, - void *retval, size_t retval_size) const; - - template - void sendToReceiver(int fnum, const Arg &args, Ret &retval); - - template - void sendToReceiver(int fnum, const Arg &args, Ret &retval) const; - - template - void sendToReceiver(int fnum, const Arg &args, std::nullptr_t); - - template - void sendToReceiver(int fnum, const Arg &args, std::nullptr_t) const; - - template - void sendToReceiver(int fnum, std::nullptr_t, Ret &retval); - - template - void sendToReceiver(int fnum, std::nullptr_t, Ret &retval) const; - - template - Ret sendToReceiver(int fnum); - - template - Ret sendToReceiver(int fnum) const; - - template - Ret sendToReceiver(int fnum, const Arg &args); - - template - Ret sendToReceiver(int fnum, const Arg &args) const; - /** * Get Detector Type from Shared Memory (opening shm without verifying size) * @param detector_id multi detector Id diff --git a/slsDetectorSoftware/src/Receiver.cpp b/slsDetectorSoftware/src/Receiver.cpp index 3caceefb5..743bae302 100755 --- a/slsDetectorSoftware/src/Receiver.cpp +++ b/slsDetectorSoftware/src/Receiver.cpp @@ -297,6 +297,20 @@ void Receiver::setUDPPort(const int port) { sendToReceiver(F_SET_RECEIVER_UDP_PORT, port, nullptr); } +int64_t Receiver::getUDPSocketBufferSize() const { + return sendToReceiver(F_GET_RECEIVER_UDP_SOCK_BUF_SIZE); +} + +void Receiver::setUDPSocketBufferSize(int64_t value) { + LOG(logDEBUG1) << "Sending UDP Socket Buffer size to receiver: " + << value; + sendToReceiver(F_SET_RECEIVER_UDP_SOCK_BUF_SIZE, value, nullptr); +} + +int64_t Receiver::getRealUDPSocketBufferSize() const { + return sendToReceiver(F_GET_RECEIVER_REAL_UDP_SOCK_BUF_SIZE); +} + /** ZMQ Streaming Parameters (Receiver<->Client) */ bool Receiver::getZmq() const { @@ -308,50 +322,6 @@ void Receiver::setZmq(const bool enable) { sendToReceiver(F_SET_RECEIVER_STREAMING, arg, nullptr); } -int Receiver::getClientZmqPort() const { - return shm()->zmqPort; -} - -void Receiver::setClientZmqPort(const int port) { - shm()->zmqPort = port; -} - -int Receiver::getZmqPort() const { - return sendToReceiver(F_GET_RECEIVER_STREAMING_PORT); -} - -void Receiver::setZmqPort(int port) { - sendToReceiver(F_SET_RECEIVER_STREAMING_PORT, port, nullptr); -} - -sls::IpAddr Receiver::getClientZmqIP() const { - return shm()->zmqIp; -} - -void Receiver::setClientZmqIP(const sls::IpAddr ip) { - LOG(logDEBUG1) << "Setting client zmq ip to " << ip; - if (ip == 0) { - throw RuntimeError("Invalid client zmq ip address"); - } - shm()->zmqIp = ip; -} - -sls::IpAddr Receiver::getZmqIP() const { - return sendToReceiver(F_GET_RECEIVER_STREAMING_SRC_IP); -} - -void Receiver::setZmqIP(const sls::IpAddr ip) { - if (ip == 0) { - throw RuntimeError("Invalid receiver zmq ip address"); - } - - // if client zmqip is empty, update it - if (shm()->zmqIp == 0) { - shm()->zmqIp = ip; - } - sendToReceiver(F_SET_RECEIVER_STREAMING_SRC_IP, ip, nullptr); -} - int Receiver::getZmqFrequency() const { return sendToReceiver(F_GET_RECEIVER_STREAMING_FREQUENCY); } @@ -371,6 +341,50 @@ void Receiver::setZmqTimer(const int time_in_ms) { sendToReceiver(F_SET_RECEIVER_STREAMING_TIMER, time_in_ms, nullptr); } +int Receiver::getZmqPort() const { + return sendToReceiver(F_GET_RECEIVER_STREAMING_PORT); +} + +void Receiver::setZmqPort(int port) { + sendToReceiver(F_SET_RECEIVER_STREAMING_PORT, port, nullptr); +} + +sls::IpAddr Receiver::getZmqIP() const { + return sendToReceiver(F_GET_RECEIVER_STREAMING_SRC_IP); +} + +void Receiver::setZmqIP(const sls::IpAddr ip) { + if (ip == 0) { + throw RuntimeError("Invalid receiver zmq ip address"); + } + + // if client zmqip is empty, update it + if (shm()->zmqIp == 0) { + shm()->zmqIp = ip; + } + sendToReceiver(F_SET_RECEIVER_STREAMING_SRC_IP, ip, nullptr); +} + +int Receiver::getClientZmqPort() const { + return shm()->zmqPort; +} + +void Receiver::setClientZmqPort(const int port) { + shm()->zmqPort = port; +} + +sls::IpAddr Receiver::getClientZmqIP() const { + return shm()->zmqIp; +} + +void Receiver::setClientZmqIP(const sls::IpAddr ip) { + LOG(logDEBUG1) << "Setting client zmq ip to " << ip; + if (ip == 0) { + throw RuntimeError("Invalid client zmq ip address"); + } + shm()->zmqIp = ip; +} + /** Receiver Parameters */ bool Receiver::getLock() const { @@ -391,20 +405,6 @@ void Receiver::exitServer() { sendToReceiver(F_EXIT_RECEIVER, nullptr, nullptr); } -int64_t Receiver::getUDPSocketBufferSize() const { - return sendToReceiver(F_GET_RECEIVER_UDP_SOCK_BUF_SIZE); -} - -void Receiver::setUDPSocketBufferSize(int64_t value) { - LOG(logDEBUG1) << "Sending UDP Socket Buffer size to receiver: " - << value; - sendToReceiver(F_SET_RECEIVER_UDP_SOCK_BUF_SIZE, value, nullptr); -} - -int64_t Receiver::getRealUDPSocketBufferSize() const { - return sendToReceiver(F_GET_RECEIVER_REAL_UDP_SOCK_BUF_SIZE); -} - bool Receiver::getDeactivatedPaddingMode() const { return sendToReceiver(F_GET_RECEIVER_DEACTIVATED_PADDING); } @@ -445,6 +445,23 @@ void Receiver::setPartialFramesPadding(const bool padding) { sendToReceiver(F_SET_RECEIVER_PADDING, arg, nullptr); } +int Receiver::getFifoDepth() const { + return sendToReceiver(F_GET_RECEIVER_FIFO_DEPTH); +} + +void Receiver::setFifoDepth(const int value) { + sendToReceiver(F_SET_RECEIVER_FIFO_DEPTH, value, nullptr); +} + +bool Receiver::getSilentMode() const { + return sendToReceiver(F_GET_RECEIVER_SILENT_MODE); +} + +void Receiver::setSilentMode(const bool enable) { + int arg = static_cast(enable); + sendToReceiver(F_SET_RECEIVER_SILENT_MODE, arg, nullptr); +} + /** File */ std::string Receiver::getFilePath() const { @@ -669,6 +686,17 @@ void Receiver::setActivate(const bool enable) { sendToReceiver(F_RECEIVER_ACTIVATE, arg, nullptr); } +void Receiver::setTenGiga(const bool enable) { + int arg = static_cast(enable); + sendToReceiver(F_ENABLE_RECEIVER_TEN_GIGA, arg, nullptr); +} + +void Receiver::setCounterMask(const uint32_t mask) { + int ncounters = __builtin_popcount(mask); + LOG(logDEBUG1) << "Sending Reciver #counters: " << ncounters; + sendToReceiver(F_RECEIVER_SET_NUM_COUNTERS, ncounters, nullptr); +} + /** Json */ std::map Receiver::getAdditionalJsonHeader() const { diff --git a/slsDetectorSoftware/src/Receiver.h b/slsDetectorSoftware/src/Receiver.h index cc03afbdd..dfa99544d 100755 --- a/slsDetectorSoftware/src/Receiver.h +++ b/slsDetectorSoftware/src/Receiver.h @@ -81,6 +81,9 @@ class Receiver : public virtual slsDetectorDefs { * ************************************************/ sls::MacAddr setUDPIP(const sls::IpAddr ip); void setUDPPort(const int udpport); + int64_t getUDPSocketBufferSize() const; + void setUDPSocketBufferSize(int64_t value); + int64_t getRealUDPSocketBufferSize() const; /************************************************** * * @@ -89,19 +92,21 @@ class Receiver : public virtual slsDetectorDefs { * ************************************************/ bool getZmq() const; void setZmq(const bool enable); - int getClientZmqPort() const; - void setClientZmqPort(const int port); - int getZmqPort() const; - void setZmqPort(int port); - sls::IpAddr getClientZmqIP() const; - void setClientZmqIP(const sls::IpAddr ip); - sls::IpAddr getZmqIP() const; - void setZmqIP(const sls::IpAddr ip); int getZmqFrequency() const; /** Freq = 0 for a timer, else frequency */ void setZmqFrequency(const int freq); int getZmqTimer() const; void setZmqTimer(const int time_in_ms = 200); + int getZmqPort() const; + void setZmqPort(int port); + sls::IpAddr getZmqIP() const; + void setZmqIP(const sls::IpAddr ip); + int getClientZmqPort() const; + void setClientZmqPort(const int port); + sls::IpAddr getClientZmqIP() const; + void setClientZmqIP(const sls::IpAddr ip); + + /************************************************** * * @@ -111,11 +116,7 @@ class Receiver : public virtual slsDetectorDefs { bool getLock() const; void setLock(const bool lock); sls::IpAddr getLastClientIP() const; - void exitServer(); - - int64_t getUDPSocketBufferSize() const; - void setUDPSocketBufferSize(int64_t value); - int64_t getRealUDPSocketBufferSize() const; + void exitServer(); bool getDeactivatedPaddingMode() const; void setDeactivatedPaddingMode(const bool padding); @@ -125,6 +126,10 @@ class Receiver : public virtual slsDetectorDefs { void setFramesDiscardPolicy(const frameDiscardPolicy f); bool getPartialFramesPadding() const; void setPartialFramesPadding(const bool padding); + int getFifoDepth() const; + void setFifoDepth(const int value); + bool getSilentMode() const; + void setSilentMode(const bool value); /************************************************** * * @@ -181,6 +186,8 @@ class Receiver : public virtual slsDetectorDefs { /** Set digital data offset in bytes (CTB only) */ void setDbitOffset(const int value); void setActivate(const bool enable); + void setTenGiga(const bool enable); + void setCounterMask(const uint32_t mask); /************************************************** * * diff --git a/slsReceiverSoftware/src/ClientInterface.cpp b/slsReceiverSoftware/src/ClientInterface.cpp index aea40b244..405d8a295 100755 --- a/slsReceiverSoftware/src/ClientInterface.cpp +++ b/slsReceiverSoftware/src/ClientInterface.cpp @@ -146,6 +146,7 @@ int ClientInterface::functionTable(){ flist[F_GET_RECEIVER_OVERWRITE] = &ClientInterface::get_overwrite; flist[F_ENABLE_RECEIVER_TEN_GIGA] = &ClientInterface::enable_tengiga; flist[F_SET_RECEIVER_FIFO_DEPTH] = &ClientInterface::set_fifo_depth; + flist[F_GET_RECEIVER_FIFO_DEPTH] = &ClientInterface::get_fifo_depth; flist[F_RECEIVER_ACTIVATE] = &ClientInterface::set_activate; flist[F_SET_RECEIVER_STREAMING] = &ClientInterface::set_streaming; flist[F_GET_RECEIVER_STREAMING] = &ClientInterface::get_streaming; @@ -1006,7 +1007,8 @@ int ClientInterface::enable_tengiga(Interface &socket) { int retval = impl()->getTenGigaEnable(); validate(val, retval, "set 10GbE", DEC); LOG(logDEBUG1) << "10Gbe:" << retval; - return socket.sendResult(retval); + socket.Send(OK); + return OK; } int ClientInterface::set_fifo_depth(Interface &socket) { @@ -1023,6 +1025,14 @@ int ClientInterface::set_fifo_depth(Interface &socket) { int retval = impl()->getFifoDepth(); validate(value, retval, std::string("set fifo depth"), DEC); LOG(logDEBUG1) << "fifo depth:" << retval; + socket.Send(OK); + return OK; +} + + +int ClientInterface::get_fifo_depth(Interface &socket) { + int retval = impl()->getFifoDepth(); + LOG(logDEBUG1) << "fifo depth:" << retval; return socket.sendResult(retval); } diff --git a/slsReceiverSoftware/src/ClientInterface.h b/slsReceiverSoftware/src/ClientInterface.h index 73c4fe3ed..f9b029946 100755 --- a/slsReceiverSoftware/src/ClientInterface.h +++ b/slsReceiverSoftware/src/ClientInterface.h @@ -105,6 +105,7 @@ class ClientInterface : private virtual slsDetectorDefs { int get_overwrite(sls::ServerInterface &socket); int enable_tengiga(sls::ServerInterface &socket); int set_fifo_depth(sls::ServerInterface &socket); + int get_fifo_depth(sls::ServerInterface &socket); int set_activate(sls::ServerInterface &socket); int set_streaming(sls::ServerInterface &socket); int get_streaming(sls::ServerInterface &socket); diff --git a/slsSupportLib/include/sls_detector_funcs.h b/slsSupportLib/include/sls_detector_funcs.h index b64d6e010..7113bf51c 100755 --- a/slsSupportLib/include/sls_detector_funcs.h +++ b/slsSupportLib/include/sls_detector_funcs.h @@ -245,6 +245,7 @@ enum detFuncs{ F_GET_RECEIVER_OVERWRITE, F_ENABLE_RECEIVER_TEN_GIGA, F_SET_RECEIVER_FIFO_DEPTH, + F_GET_RECEIVER_FIFO_DEPTH, F_RECEIVER_ACTIVATE, F_SET_RECEIVER_STREAMING, F_GET_RECEIVER_STREAMING, @@ -538,6 +539,7 @@ static const char* getFunctionNameFromEnum(enum detFuncs func) { case F_GET_RECEIVER_OVERWRITE: return "F_GET_RECEIVER_OVERWRITE"; case F_ENABLE_RECEIVER_TEN_GIGA: return "F_ENABLE_RECEIVER_TEN_GIGA"; case F_SET_RECEIVER_FIFO_DEPTH: return "F_SET_RECEIVER_FIFO_DEPTH"; + case F_GET_RECEIVER_FIFO_DEPTH: return "F_GET_RECEIVER_FIFO_DEPTH"; case F_RECEIVER_ACTIVATE: return "F_RECEIVER_ACTIVATE"; case F_SET_RECEIVER_STREAMING: return "F_SET_RECEIVER_STREAMING"; case F_GET_RECEIVER_STREAMING: return "F_GET_RECEIVER_STREAMING";