mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 12:27:14 +02:00
included settting up of udpport from client and getting receiver mac from receiver and also listening to only one ethernet interface
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@371 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
#include "receiverInterface.h"
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -44,6 +43,29 @@ int receiverInterface::sendString(int fnum, char retval[], char arg[]){
|
||||
|
||||
|
||||
|
||||
int receiverInterface::sendUDPDetails(int fnum, char retval[], char arg[2][MAX_STR_LENGTH]){
|
||||
char args[2][MAX_STR_LENGTH];
|
||||
int ret = slsDetectorDefs::FAIL;
|
||||
char mess[100] = "";
|
||||
|
||||
if (dataSocket) {
|
||||
if (dataSocket->Connect()>=0) {
|
||||
dataSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||
dataSocket->SendDataOnly(arg,sizeof(args));
|
||||
dataSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||
if (ret==slsDetectorDefs::FAIL){
|
||||
dataSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||
std::cout<< "Receiver returned error: " << mess << std::endl;
|
||||
}
|
||||
else
|
||||
dataSocket->ReceiveDataOnly(retval,MAX_STR_LENGTH);
|
||||
}
|
||||
dataSocket->Disconnect();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int receiverInterface::sendInt(int fnum, int &retval, int arg){
|
||||
int ret = slsDetectorDefs::FAIL;
|
||||
char mess[100] = "";
|
||||
|
Reference in New Issue
Block a user