exceptions TCP (#31)

* WIP

* first test

* format

* test frames

* also 0:

* WIP

* WIP

* first test

* format

* test frames

* also 0:

* test and less local

* pass ret by value

* level

* WIP

* WIP

* cleaning up interface

* removed ref

* another

* updated api version

* cleanup

* cleanup

* WIP

* fixes

* fixed tests
This commit is contained in:
Erik Fröjdh
2019-06-05 15:25:18 +02:00
committed by Dhanya Thattil
parent a6144f658e
commit 1db7521cfa
14 changed files with 1048 additions and 1752 deletions

View File

@ -125,11 +125,6 @@ class slsReceiverTCPIPInterface : private virtual slsDetectorDefs {
template <typename T>
void validate(T arg, T retval, std::string modename, numberMode hex);
/** Unrecognized Function */
int M_nofunc(sls::ServerInterface2 & socket);
/** Execute command */
int exec_command(sls::ServerInterface2 &socket);
@ -298,10 +293,6 @@ class slsReceiverTCPIPInterface : private virtual slsDetectorDefs {
/** set dbit offset */
int set_dbit_offset(sls::ServerInterface2 &socket);
int LogSocketCrash();
void NullObjectError(int& ret, char* mess);
/** detector type */
detectorType myDetectorType;
@ -390,6 +381,14 @@ protected:
std::unique_ptr<sls::ServerSocket> server{nullptr};
private:
int VerifyLock(int &ret, char *mess);
int VerifyLockAndIdle(int &ret, char *mess, int fnum);
void VerifyLock();
void VerifyIdle(sls::ServerInterface2& socket);
slsReceiverImplementation* impl(){
if (receiver!=nullptr){
return receiver.get();
}else{
throw sls::SocketError("Receiver not set up. Please use rx_hostname first.\n");
}
}
};

View File

@ -571,7 +571,7 @@ void slsReceiverImplementation::setFilePath(const char c[]) {
if(stat(c,&st) == 0)
strcpy(filePath,c);
else
FILE_LOG(logERROR) << "FilePath does not exist: " << filePath;
FILE_LOG(logERROR) << "FilePath does not exist: " << c;
}
FILE_LOG(logINFO) << "File path: " << filePath;
}
@ -1059,7 +1059,7 @@ int slsReceiverImplementation::setFifoDepth(const uint32_t i) {
if (fifoDepth != i) {
fifoDepth = i;
if (SetupFifoStructure() == FAIL)
return FAIL;
throw sls::RuntimeError("Failed to setup fifo structure");
}
FILE_LOG(logINFO) << "Fifo Depth: " << i;
return OK;

File diff suppressed because it is too large Load Diff