compile for servers too

This commit is contained in:
maliakal_d 2020-11-27 12:37:22 +01:00
parent d9b2a90651
commit 0eb204bfd3
7 changed files with 26 additions and 11 deletions

View File

@ -22,6 +22,7 @@ add_executable(ctbDetectorServer_virtual
include_directories(
../slsDetectorServer/include
../../slsSupportLib/include
../../slsDetectorSoftware/include/sls/
)
target_include_directories(ctbDetectorServer_virtual

View File

@ -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

View File

@ -20,6 +20,7 @@ add_executable(moenchDetectorServer_virtual
include_directories(
../slsDetectorServer/include
../../slsSupportLib/include
../../slsDetectorSoftware/include/sls/
)
target_include_directories(moenchDetectorServer_virtual

View File

@ -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

View File

@ -17,6 +17,7 @@ add_executable(mythen3DetectorServer_virtual
include_directories(
../slsDetectorServer/include
../../slsSupportLib/include
../../slsDetectorSoftware/include/sls/
)
target_include_directories(mythen3DetectorServer_virtual

View File

@ -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

View File

@ -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 <arpa/inet.h>
#include <pthread.h>
#include <string.h>
@ -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) {