From 298e1dd1fe7259f8a95aa59fa81167b40d0a30b8 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Mon, 26 Aug 2019 10:54:01 +0200 Subject: [PATCH] udp virtual of gotthard2 --- .../slsDetectorFunctionList.c | 17 +++++++++++++++++ .../slsDetectorServer/slsDetectorFunctionList.h | 2 +- .../slsDetectorServer/slsDetectorServer_funcs.c | 4 ++-- slsSupportLib/include/versionAPI.h | 2 +- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c index b292e7f4d..784dc7727 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c @@ -273,6 +273,23 @@ int64_t getTimeLeft(enum timerIndex ind){ return -1; } + +int configureMAC(uint32_t destip, uint64_t destmac, uint64_t sourcemac, uint32_t sourceip, uint32_t udpport) { +#ifdef VIRTUAL + char cDestIp[MAX_STR_LENGTH]; + memset(cDestIp, 0, MAX_STR_LENGTH); + sprintf(cDestIp, "%d.%d.%d.%d", (destip>>24)&0xff,(destip>>16)&0xff,(destip>>8)&0xff,(destip)&0xff); + FILE_LOG(logINFO, ("1G UDP: Destination (IP: %s, port:%d)\n", cDestIp, udpport)); + if (setUDPDestinationDetails(0, cDestIp, udpport) == FAIL) { + FILE_LOG(logERROR, ("could not set udp destination IP and port\n")); + return FAIL; + } + return OK; +#endif + return OK; +} + + int startStateMachine(){ #ifdef VIRTUAL // create udp socket diff --git a/slsDetectorServers/slsDetectorServer/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/slsDetectorFunctionList.h index d92aa99f9..2bac9677d 100755 --- a/slsDetectorServers/slsDetectorServer/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/slsDetectorFunctionList.h @@ -255,7 +255,7 @@ int configureMAC(int numInterfaces, int selInterface, uint32_t destip, uint64_t destmac, uint64_t sourcemac, uint32_t sourceip, uint32_t udpport, uint32_t destip2, uint64_t destmac2, uint64_t sourcemac2, uint32_t sourceip2, uint32_t udpport2); #else -#if !defined(MYTHEN3D) && !defined(GOTTHARD2D) +#ifndef MYTHEN3D int configureMAC(uint32_t destip, uint64_t destmac, uint64_t sourcemac, uint32_t sourceip, uint32_t udpport); #endif #endif diff --git a/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c index 4c70ff225..dc447ca5e 100755 --- a/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c @@ -2321,7 +2321,7 @@ int configure_mac(int file_des) { if (receiveData(file_des, args, sizeof(args), OTHER) < 0) return printSocketReadError(); -#if defined(MYTHEN3D) || defined(GOTTHARD2D) +#if defined(MYTHEN3D) functionNotImplemented(); #else FILE_LOG(logDEBUG1, ("\n Configuring MAC\n")); @@ -2442,7 +2442,7 @@ int configure_mac(int file_des) { if (status != IDLE && status != RUN_FINISHED && status != STOPPED) { if (status == RUNNING) stopStateMachine(); -#ifndef EIGERD +#if !defined(EIGERD) && !defined(GOTTHARD2D) cleanFifos(); #endif status = getRunStatus(); diff --git a/slsSupportLib/include/versionAPI.h b/slsSupportLib/include/versionAPI.h index bd0e17cdd..cc57630a4 100644 --- a/slsSupportLib/include/versionAPI.h +++ b/slsSupportLib/include/versionAPI.h @@ -9,5 +9,5 @@ #define APIJUNGFRAU 0x190821 #define APIEIGER 0x190821 #define APIMYTHEN3 0x190822 -#define APIGOTTHARD2 0x190826 +#define APIGOTTHARD2 0x190826