From 0eb204bfd3d99bb4739908f5401e2bf8b0518a84 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 27 Nov 2020 12:37:22 +0100 Subject: [PATCH] compile for servers too --- .../ctbDetectorServer/CMakeLists.txt | 1 + slsDetectorServers/ctbDetectorServer/Makefile | 3 ++- .../moenchDetectorServer/CMakeLists.txt | 1 + .../moenchDetectorServer/Makefile | 3 ++- .../mythen3DetectorServer/CMakeLists.txt | 1 + .../mythen3DetectorServer/Makefile | 3 ++- .../src/slsDetectorServer_funcs.c | 25 +++++++++++++------ 7 files changed, 26 insertions(+), 11 deletions(-) diff --git a/slsDetectorServers/ctbDetectorServer/CMakeLists.txt b/slsDetectorServers/ctbDetectorServer/CMakeLists.txt index 26c9ec0ee..d06ea78f7 100644 --- a/slsDetectorServers/ctbDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/ctbDetectorServer/CMakeLists.txt @@ -22,6 +22,7 @@ add_executable(ctbDetectorServer_virtual include_directories( ../slsDetectorServer/include ../../slsSupportLib/include + ../../slsDetectorSoftware/include/sls/ ) target_include_directories(ctbDetectorServer_virtual diff --git a/slsDetectorServers/ctbDetectorServer/Makefile b/slsDetectorServers/ctbDetectorServer/Makefile index 6d6aab318..3d2260816 100755 --- a/slsDetectorServers/ctbDetectorServer/Makefile +++ b/slsDetectorServers/ctbDetectorServer/Makefile @@ -2,10 +2,11 @@ current_dir = $(shell pwd) main_inc = ../slsDetectorServer/include/ main_src = ../slsDetectorServer/src/ support_lib = ../../slsSupportLib/include/ +det_lib = ../../slsDetectorSoftware/include/sls/ CROSS = bfin-uclinux- CC = $(CROSS)gcc -CFLAGS += -Wall -std=gnu99 -DCHIPTESTBOARDD -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(current_dir) #-DDEBUG1 #-DVERBOSEI #-DVERBOSE +CFLAGS += -Wall -std=gnu99 -DCHIPTESTBOARDD -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(det_lib) -I$(current_dir) #-DDEBUG1 #-DVERBOSEI #-DVERBOSE LDLIBS += -lm -lrt -pthread PROGS = ctbDetectorServer DESTDIR ?= bin diff --git a/slsDetectorServers/moenchDetectorServer/CMakeLists.txt b/slsDetectorServers/moenchDetectorServer/CMakeLists.txt index 056ee1f5e..a5c224491 100644 --- a/slsDetectorServers/moenchDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/moenchDetectorServer/CMakeLists.txt @@ -20,6 +20,7 @@ add_executable(moenchDetectorServer_virtual include_directories( ../slsDetectorServer/include ../../slsSupportLib/include + ../../slsDetectorSoftware/include/sls/ ) target_include_directories(moenchDetectorServer_virtual diff --git a/slsDetectorServers/moenchDetectorServer/Makefile b/slsDetectorServers/moenchDetectorServer/Makefile index a34b3f6b3..a73300c7f 100755 --- a/slsDetectorServers/moenchDetectorServer/Makefile +++ b/slsDetectorServers/moenchDetectorServer/Makefile @@ -2,10 +2,11 @@ current_dir = $(shell pwd) main_inc = ../slsDetectorServer/include/ main_src = ../slsDetectorServer/src/ support_lib = ../../slsSupportLib/include/ +det_lib = ../../slsDetectorSoftware/include/sls/ CROSS = bfin-uclinux- CC = $(CROSS)gcc -CFLAGS += -Wall -std=gnu99 -DMOENCHD -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(current_dir)#-DVERBOSEI #-DVERBOSE +CFLAGS += -Wall -std=gnu99 -DMOENCHD -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(det_lib) -I$(current_dir)#-DVERBOSEI #-DVERBOSE LDLIBS += -lm -lrt -pthread PROGS = moenchDetectorServer DESTDIR ?= bin diff --git a/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt b/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt index 85baade80..b9740a0fe 100644 --- a/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt +++ b/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt @@ -17,6 +17,7 @@ add_executable(mythen3DetectorServer_virtual include_directories( ../slsDetectorServer/include ../../slsSupportLib/include + ../../slsDetectorSoftware/include/sls/ ) target_include_directories(mythen3DetectorServer_virtual diff --git a/slsDetectorServers/mythen3DetectorServer/Makefile b/slsDetectorServers/mythen3DetectorServer/Makefile index c07029041..149cf15c6 100755 --- a/slsDetectorServers/mythen3DetectorServer/Makefile +++ b/slsDetectorServers/mythen3DetectorServer/Makefile @@ -2,10 +2,11 @@ current_dir = $(shell pwd) main_inc = ../slsDetectorServer/include/ main_src = ../slsDetectorServer/src/ support_lib = ../../slsSupportLib/include/ +det_lib = ../../slsDetectorSoftware/include/sls/ CROSS = nios2-buildroot-linux-gnu- CC = $(CROSS)gcc -CFLAGS += -Wall -std=gnu99 -DMYTHEN3D -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(current_dir) #-DDEBUG1 #-DVERBOSEI #-DVERBOSE +CFLAGS += -Wall -std=gnu99 -DMYTHEN3D -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(det_lib) -I$(current_dir) #-DDEBUG1 #-DVERBOSEI #-DVERBOSE LDLIBS += -lm -lrt -pthread PROGS = mythen3DetectorServer DESTDIR ?= bin diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index ede5d5c86..156fb405c 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -5,6 +5,10 @@ #include "sls/sls_detector_funcs.h" #include "slsDetectorFunctionList.h" +#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(MYTHEN3D) +#include "Pattern.h" +#endif + #include #include #include @@ -7532,6 +7536,10 @@ int set_pattern(int file_des) { ret = OK; memset(mess, 0, sizeof(mess)); +#if !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D) + functionNotImplemented(); +#else + patternParameters *pat = malloc(sizeof(patternParameters)); memset(pat, 0, sizeof(patternParameters)); @@ -7542,9 +7550,6 @@ int set_pattern(int file_des) { return printSocketReadError(); } -#if !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D) - functionNotImplemented(); -#else if (Server_VerifyLock() == OK) { LOG(logINFO, ("Setting Pattern from structure\n")); LOG(logINFO, @@ -7622,9 +7627,10 @@ int set_pattern(int file_des) { } } } -#endif if (pat != NULL) free(pat); +#endif + return Server_SendResult(file_des, INT32, NULL, 0); } @@ -7632,12 +7638,14 @@ int get_pattern(int file_des) { ret = OK; memset(mess, 0, sizeof(mess)); +#if !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D) + functionNotImplemented(); + return Server_SendResult(file_des, INT32, NULL, 0); +#else + patternParameters *pat = malloc(sizeof(patternParameters)); memset(pat, 0, sizeof(patternParameters)); -#if !defined(CHIPTESTBOARDD) && !defined(MOENCHD) && !defined(MYTHEN3D) - functionNotImplemented(); -#else if (Server_VerifyLock() == OK) { LOG(logINFO, ("Getting Pattern from structure\n")); @@ -7732,13 +7740,14 @@ int get_pattern(int file_des) { } } } -#endif + // ignoring endianness for eiger int ret = Server_SendResult(file_des, INT32, pat, sizeof(patternParameters)); if (pat != NULL) free(pat); return ret; +#endif } int get_scan(int file_des) {